| | |
| | | .techfather(technology.getFather()) |
| | | .deviceGroup(technology.getDeviceGroup()) |
| | | .manufactureOrderId(manufactureOrder.getId()) |
| | | .period((int) Math.ceil((double)manufactureOrder.getNumber()/technology.getProductionQuota())) |
| | | .technologyId(technology.getId()) |
| | | .build(); |
| | | //新增编制工序表 |
| | | manualTechnologyMapper.insert(manualTechnology); |
| | |
| | | import com.yuanchu.mom.service.ManufactureOrderService; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.text.ParseException; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | return Result.success(map); |
| | | } |
| | | |
| | | @ApiOperation(value = "排产-->1.查看") |
| | | @ApiOperation(value = "点击排产获取表格二级树") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "manOrdId", value = "生产订单id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | |
| | | return Result.success(manualTechnologyService.seleDatil(manOrdId)); |
| | | } |
| | | |
| | | @ApiOperation(value = "排产-->2.选择设备") |
| | | @ApiOperation(value = "点击排产-->二级树选择设备") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "deviceGroup", value = "设备组", dataTypeClass = String.class, required = true) |
| | | }) |
| | |
| | | return Result.success(deviceService.getDeviceNameByGroup(deviceGroup)); |
| | | } |
| | | |
| | | @ApiOperation(value = "排产-->3.更新") |
| | | @ApiOperation(value = "点击排产-->确定按钮") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "date", value = "排产开始日期", dataTypeClass = String.class, required = true) |
| | | @ApiImplicitParam(name = "date", value = "排产开始日期", dataTypeClass = String.class, required = true), |
| | | @ApiImplicitParam(name = "manOrdId", value = "生产订单Id", dataTypeClass = String.class, required = true), |
| | | @ApiImplicitParam(name = "schedulingNumber", value = "排产数量", dataTypeClass = Integer.class, required = true), |
| | | }) |
| | | @PostMapping("/output") |
| | | public Result output(String date ,@Validated @RequestBody List<ManualTechnologyDto> manualTechnologyDtoList) throws ParseException { |
| | | manualTechnologyService.output(date,manualTechnologyDtoList); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "查看排产详情") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "manOrdId", value = "生产订单id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/sePros") |
| | | public Result sePros(Integer manOrdId) { |
| | | return Result.success(manufactureOrderService.sePros(manOrdId)); |
| | | public Result<?> output(@RequestParam(value = "date") @NotBlank(message = "排产开始日期不能为空") String date, |
| | | @RequestParam(value = "manOrdId") @NotNull(message = "生产订单Id不能为空") Integer manOrdId, |
| | | @RequestParam(value = "schedulingNumber") @NotNull(message = "排产数量不能为空") Integer schedulingNumber, |
| | | @Validated @RequestBody List<ManualTechnologyDto> manualTechnologyDtoList |
| | | ) throws ParseException { |
| | | manualTechnologyService.output(date, manOrdId, schedulingNumber, manualTechnologyDtoList); |
| | | return Result.success("排产成功!"); |
| | | } |
| | | |
| | | @ApiOperation(value = "下达") |
| | |
| | | @ApiImplicitParam(name = "manOrdId", value = "生产订单id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/down") |
| | | public Result down(Integer manOrdId) { |
| | | public Result<?> down(Integer manOrdId) { |
| | | manufactureOrderService.down(manOrdId); |
| | | return Result.success("下达成功!"); |
| | | } |
| | | |
| | | @ApiOperation(value = "多选删除") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "manOrdId", value = "生产订单id", dataTypeClass = String.class, dataType = "list", required = true) |
| | | }) |
| | | @DeleteMapping("/delete") |
| | | public Result<?> deleteManufacture(List<String> manOrdId) { |
| | | manufactureOrderService.deleteManufacture(manOrdId); |
| | | return Result.success("删除成功!"); |
| | | } |
| | | } |
| | | |
| | |
| | | package com.yuanchu.mom.controller; |
| | | |
| | | import com.yuanchu.mom.service.ManufactureOrderService; |
| | | import com.yuanchu.mom.service.ProductionPlanService; |
| | | import com.yuanchu.mom.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | |
| | | @Resource |
| | | ProductionPlanService productionPlanService; |
| | | |
| | | |
| | | @ApiOperation(value = "查询设备列表") |
| | | @GetMapping("/selectAllDev") |
| | | public Result selectAllDev() { |
| | | return Result.success(productionPlanService.selectAllDev()); |
| | | } |
| | | @Autowired |
| | | private ManufactureOrderService manufactureOrderService; |
| | | |
| | | @ApiOperation(value = "查询生产计划列表") |
| | | @ApiImplicitParams(value = { |
| | |
| | | public Result selectAllPlan(Integer deviceId, String orderCode, String name, String startTime, String endTime) { |
| | | return Result.success(productionPlanService.selectAllPlan(deviceId,orderCode,name,startTime,endTime)); |
| | | } |
| | | |
| | | @ApiOperation(value = "二级树") |
| | | @GetMapping("/tow_tree") |
| | | public Result<?> towTree() { |
| | | return Result.success(manufactureOrderService.towTree()); |
| | | } |
| | | |
| | | @ApiOperation(value = "查看排产详情") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "manOrdId", value = "生产订单id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/sePros") |
| | | public Result sePros(Integer manOrdId) { |
| | | return Result.success(manufactureOrderService.sePros(manOrdId)); |
| | | } |
| | | } |
| | |
| | | List<Map<String, Object>> seleDatil(Integer manOrdId); |
| | | |
| | | //批量更新 |
| | | void updateBatchManualTechnology(List<ManualTechnology> manualTechnologies); |
| | | |
| | | //查询所有设备列表 |
| | | List<Map<String, Object>> selectAllDev(); |
| | | void updateBatchManualTechnology(Integer schedulingNumber, List<ManualTechnology> manualTechnologies); |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | //查看生产计划 |
| | | List<Map<String, Object>> selectAllPlan(Integer deviceId, String orderCode, String name, String startTime, String endTime); |
| | | |
| | | void deleteManufacture(List<String> manOrdId); |
| | | |
| | | List<Map<String, Object>> towTree(); |
| | | |
| | | void updateManufacture(Integer manufactureOrderId, Integer manufactureOrder); |
| | | } |
| | | |
| | |
| | | **/ |
| | | private Integer deviceId; |
| | | |
| | | @ApiModelProperty(value = "关联 工艺Id") |
| | | private Integer technologyId; |
| | | |
| | | /** |
| | | * 关联 生产订单id |
| | | **/ |
| | |
| | | * 周期 |
| | | **/ |
| | | private Integer period; |
| | | |
| | | @ApiModelProperty(value = "排产数量") |
| | | private Integer schedulingNumber; |
| | | } |
| | | |
| | |
| | | package com.yuanchu.mom.pojo.dto; |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | |
| | | public class ManualTechnologyDto { |
| | | |
| | | //工序id |
| | | @NotNull(message = "id不能为空") |
| | | @JsonSerialize |
| | | @NotNull(message = "工序Id不能为空") |
| | | @ApiModelProperty(value = "工序Id", example = "1", required = true) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 工序名称 |
| | | **/ |
| | | @NotBlank(message = "工序名称不能为空") |
| | | @JsonSerialize |
| | | private String techname; |
| | | @ApiModelProperty(value = "工艺Id", example = "2", required = true) |
| | | private Integer technologyId; |
| | | |
| | | /** |
| | | * 工序父类 |
| | | **/ |
| | | @NotBlank(message = "工序父类不能为空") |
| | | @JsonSerialize |
| | | private String techfather; |
| | | |
| | | /** |
| | | * 设备组 |
| | | **/ |
| | | @NotBlank(message = "设备组不能为空") |
| | | @JsonSerialize |
| | | private String deviceGroup; |
| | | |
| | | /** |
| | | * 关联 设备id |
| | | **/ |
| | | @NotNull(message = "设备id不能为空") |
| | | @JsonSerialize |
| | | @ApiModelProperty(value = "设备Id", example = "1", required = true) |
| | | private Integer deviceId; |
| | | |
| | | } |
| | |
| | | * 排产==>更新 |
| | | * @param manualTechnologyDtoList |
| | | */ |
| | | void output(String date, List<ManualTechnologyDto> manualTechnologyDtoList) throws ParseException; |
| | | void output(String date, Integer manufactureOrderId, Integer schedulingNumber, List<ManualTechnologyDto> manualTechnologyDtoList) throws ParseException; |
| | | |
| | | } |
| | | |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.mom.pojo.ManufactureOrder; |
| | | import com.yuanchu.mom.pojo.dto.ManufactureOrderDto; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | * @param manOrdId |
| | | */ |
| | | void down(Integer manOrdId); |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * @param manOrdId |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | void deleteManufacture(List<String> manOrdId); |
| | | |
| | | /** |
| | | * 生产计划二级树 |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> towTree(); |
| | | } |
| | | |
| | |
| | | |
| | | public interface ProductionPlanService { |
| | | |
| | | |
| | | /** |
| | | * 查询设备列表 |
| | | * @return |
| | | */ |
| | | List<Map<String,Object>> selectAllDev(); |
| | | |
| | | /** |
| | | * 查询生产计划列表 |
| | | * @param deviceId |
| | |
| | | package com.yuanchu.mom.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.mom.mapper.DeviceMapper; |
| | |
| | | import com.yuanchu.mom.mapper.ManufactureOrderMapper; |
| | | import com.yuanchu.mom.pojo.ManualTechnology; |
| | | import com.yuanchu.mom.pojo.ManufactureOrder; |
| | | import com.yuanchu.mom.pojo.Technology; |
| | | import com.yuanchu.mom.pojo.dto.ManualTechnologyDto; |
| | | import com.yuanchu.mom.service.ManualTechnologyService; |
| | | import com.yuanchu.mom.service.TechnologyService; |
| | | import com.yuanchu.mom.utils.MyUtil; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | import java.text.DateFormat; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | @Resource |
| | | ManufactureOrderMapper manufactureOrderMapper; |
| | | |
| | | @Autowired |
| | | private TechnologyService technologyService; |
| | | |
| | | //排产-->查看 |
| | | @Override |
| | | public List<Map<String, Object>> seleDatil(Integer manOrdId) { |
| | | |
| | | return manualTechnologyMapper.seleDatil(manOrdId); |
| | | } |
| | | |
| | | //排产-->更新 |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void output(String date, List<ManualTechnologyDto> manualTechnologyDtoList) throws ParseException { |
| | | //更新每个工序的设备 |
| | | public void output(String date, Integer manufactureOrderId, Integer schedulingNumber, List<ManualTechnologyDto> manualTechnologyDtoList) throws ParseException { |
| | | // 查询工艺,用于匹配每个订单的工序周期 |
| | | LambdaQueryWrapper<Technology> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.select(Technology::getId, Technology::getProductionQuota); |
| | | List<Technology> technologies = technologyService.list(wrapper); |
| | | |
| | | |
| | | //匹配每个订单的工序周期 |
| | | List<ManualTechnology> manualTechnologies = manualTechnologyDtoList.stream().map(manualTechnologyDto -> { |
| | | ManualTechnology manualTechnology = new ManualTechnology(); |
| | | BeanUtils.copyProperties(manualTechnologyDto, manualTechnology); |
| | | technologies.forEach(i -> { |
| | | if (Objects.equals(manualTechnology.getTechnologyId(), i.getId())){ |
| | | manualTechnology.setPeriod((int) Math.ceil((double)schedulingNumber/i.getProductionQuota())); |
| | | } |
| | | }); |
| | | return manualTechnology; |
| | | }).collect(Collectors.toList()); |
| | | //批量更新设备id |
| | | manualTechnologyMapper.updateBatchManualTechnology(manualTechnologies); |
| | | Integer manufactureOrderId = manualTechnologyMapper.selectById(manualTechnologyDtoList.get(1).getId()).getManufactureOrderId(); |
| | | List<ManualTechnology> manualTechnologyList = manualTechnologyMapper.selectList(Wrappers.<ManualTechnology>query().eq("manufacture_order_id", manufactureOrderId)); |
| | | /*赋值(最开始第一个工序的开始日期)*/ |
| | | |
| | | |
| | | // 计算工序的开始日期以及结束日期 |
| | | DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | | Date parse = dateFormat.parse(date); |
| | | //将起始日期赋值给Calendar对象 |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(parse); |
| | | //第一个工序 |
| | | ManualTechnology manualTechnology = manualTechnologyList.get(0); |
| | | ManualTechnology manualTechnology = manualTechnologies.get(0); |
| | | calendar.add(Calendar.DATE, manualTechnology.getPeriod()); |
| | | |
| | | |
| | | manualTechnology.setStartTime(parse).setEndTime(calendar.getTime()); |
| | | //循环赋值时间 |
| | | for (int i = 0; i < manualTechnologyList.size()-1 ; i++) { |
| | | for (int i = 0; i < manualTechnologies.size()-1 ; i++) { |
| | | Calendar calendar1 = Calendar.getInstance(); |
| | | calendar1.setTime(manualTechnologyList.get(i).getEndTime()); |
| | | ManualTechnology technology = manualTechnologyList.get(i + 1); |
| | | calendar1.setTime(manualTechnologies.get(i).getEndTime()); |
| | | ManualTechnology technology = manualTechnologies.get(i + 1); |
| | | calendar1.add(Calendar.DATE,1); |
| | | technology.setStartTime(calendar1.getTime()); |
| | | calendar1.add(Calendar.DATE,technology.getPeriod()); |
| | | technology.setEndTime(calendar1.getTime()); |
| | | } |
| | | //批量更新 |
| | | manualTechnologyMapper.updateBatchManualTechnology(manualTechnologyList); |
| | | //如果该产品下的所有工序都安排了,则将状态改为已排产还有待下达 |
| | | if (checkFieldExistence(manualTechnologies)) { |
| | | ManufactureOrder manufactureOrder = new ManufactureOrder(); |
| | | manufactureOrder.setId(manufactureOrderId).setType(1).setGoState(0); |
| | | manufactureOrderMapper.updateById(manufactureOrder); |
| | | } |
| | | } |
| | | |
| | | |
| | | /*判断是否所有工序全部都安排了设备*/ |
| | | public static boolean checkFieldExistence(List<ManualTechnology> dataList) { |
| | | for (ManualTechnology data : dataList) { |
| | | if (data.getDeviceId() == null) { |
| | | return false; |
| | | } |
| | | } |
| | | return true; |
| | | // 数据处理完成开始批量更新Mysql |
| | | manualTechnologyMapper.updateBatchManualTechnology(schedulingNumber, manualTechnologies); |
| | | |
| | | |
| | | // 工序更新完毕,更新订单的状态,将其更新为已排产:1,还有待下达:0 |
| | | manufactureOrderMapper.updateManufacture(manufactureOrderId, schedulingNumber); |
| | | } |
| | | } |
| | | |
| | |
| | | package com.yuanchu.mom.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | import com.yuanchu.mom.pojo.dto.ManualTechnologyDto1; |
| | | import com.yuanchu.mom.pojo.dto.ManufactureOrderDto; |
| | | import com.yuanchu.mom.service.ManufactureOrderService; |
| | | import com.yuanchu.mom.utils.MyUtil; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | BeanUtils.copyProperties(manufactureOrder,manufactureOrderDto); |
| | | //计划编制 |
| | | List<ManualTechnology> manualTechnologies = manualTechnologyMapper.selectList(Wrappers.<ManualTechnology>query().eq("manufacture_order_id", manOrdId)); |
| | | List<ManualTechnologyDto1> manualTechnologyDto1s = manualTechnologies.stream().map(manualTechnology -> { |
| | | ManualTechnologyDto1 manualTechnologyDto1 = new ManualTechnologyDto1(); |
| | | BeanUtils.copyProperties(manualTechnology, manualTechnologyDto1); |
| | | manualTechnologyDto1.setMtechId(manualTechnology.getId()); |
| | | manualTechnologyDto1.setDeviceName(deviceMapper.selectById(manualTechnology.getDeviceId()).getName()); |
| | | return manualTechnologyDto1; |
| | | }).collect(Collectors.toList()); |
| | | manufactureOrderDto.setMessage(manualTechnologyDto1s); |
| | | MyUtil.PrintLog(manualTechnologies.toString()); |
| | | |
| | | // List<ManualTechnologyDto1> manualTechnologyDto1s = manualTechnologies.stream().map(manualTechnology -> { |
| | | // ManualTechnologyDto1 manualTechnologyDto1 = new ManualTechnologyDto1(); |
| | | // BeanUtils.copyProperties(manualTechnology, manualTechnologyDto1); |
| | | // manualTechnologyDto1.setMtechId(manualTechnology.getId()); |
| | | // manualTechnologyDto1.setDeviceName(deviceMapper.selectById(manualTechnology.getDeviceId()).getName()); |
| | | // return manualTechnologyDto1; |
| | | // }).collect(Collectors.toList()); |
| | | // manufactureOrderDto.setMessage(manualTechnologyDto1s); |
| | | return manufactureOrderDto; |
| | | } |
| | | |
| | | //下达 |
| | | @Override |
| | | public void down(Integer manOrdId) { |
| | | ManufactureOrder manufactureOrder = new ManufactureOrder().setId(manOrdId).setGoState(1); |
| | | ManufactureOrder manufactureOrder = new ManufactureOrder().setId(manOrdId).setGoState(1).setType(0); |
| | | manufactureOrderMapper.updateById(manufactureOrder); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteManufacture(List<String> manOrdId) { |
| | | manufactureOrderMapper.deleteManufacture(manOrdId); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> towTree() { |
| | | return manufactureOrderMapper.towTree(); |
| | | } |
| | | } |
| | | |
| | |
| | | @Resource |
| | | ManufactureOrderMapper manufactureOrderMapper; |
| | | |
| | | @Resource |
| | | ManualTechnologyMapper manualTechnologyMapper; |
| | | |
| | | //查询设备列表 |
| | | @Override |
| | | public List<Map<String, Object>> selectAllDev() { |
| | | return manualTechnologyMapper.selectAllDev(); |
| | | } |
| | | |
| | | //查询生产计划列表 |
| | | @Override |
| | | public List<Map<String, Object>> selectAllPlan(Integer deviceId, String orderCode, String name, String startTime, String endTime) { |
| | |
| | | WHEN id =#{manualTechnologie.id} THEN #{manualTechnologie.endTime} |
| | | </foreach> |
| | | </trim> |
| | | <trim prefix="scheduling_number=case" suffix="end,"> |
| | | <foreach collection="manualTechnologies" item="manualTechnologie"> |
| | | WHEN id =#{manualTechnologie.id} THEN #{schedulingNumber} |
| | | </foreach> |
| | | </trim> |
| | | </trim> |
| | | <where> |
| | | <foreach collection="manualTechnologies" separator="or" item="manualTechnologie"> |
| | |
| | | </where> |
| | | </update> |
| | | |
| | | <select id="seleDatil" resultType="java.util.Map"> |
| | | <resultMap id="seleDatilMap" type="map"> |
| | | <id property="lable" column="techfather"/> |
| | | <collection property="children" resultMap="seleDatilTowMap" javaType="List"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="seleDatilTowMap" type="map"> |
| | | <id property="lable" column="techname"/> |
| | | <result property="id" column="id"/> |
| | | <result property="deviceGroup" column="device_group"/> |
| | | <result property="deviceName" column="name"/> |
| | | <result property="technologyId" column="manufacture_order_id"/> |
| | | </resultMap> |
| | | |
| | | <select id="seleDatil" resultMap="seleDatilMap"> |
| | | select manual_technology.id, |
| | | techfather, |
| | | techname, |
| | | device_group, |
| | | name |
| | | name, |
| | | manufacture_order_id |
| | | from mom_ocean.manual_technology |
| | | left join mom_ocean.device |
| | | on device.id = device_id |
| | | where manufacture_order_id = #{manOrdId} |
| | | </select> |
| | | <!--查询所有设备列表--> |
| | | <select id="selectAllDev" resultType="java.util.Map"> |
| | | select distinct manual_technology.id, |
| | | device_group, |
| | | name |
| | | from mom_ocean.manual_technology |
| | | left join mom_ocean.device |
| | | on device.id = manual_technology.device_id |
| | | order by device_group |
| | | </select> |
| | | </mapper> |
| | | </mapper> |
| | |
| | | </if> |
| | | order by start_time |
| | | </select> |
| | | </mapper> |
| | | |
| | | <update id="deleteManufacture"> |
| | | UPDATE manufacture_order m |
| | | SET m.`state` = 0 |
| | | WHERE m.id IN |
| | | <foreach collection="list" index="index" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </update> |
| | | |
| | | <resultMap id="towTreeFirstMap" type="map"> |
| | | <id property="orderCode" column="order_code"/> |
| | | <collection property="children" javaType="list" resultMap="towTreeSecondMap"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="towTreeSecondMap" type="map"> |
| | | <id property="manufactureId" column="id"/> |
| | | <result property="manufactureName" column="name"/> |
| | | </resultMap> |
| | | |
| | | <select id="towTree" resultMap="towTreeFirstMap"> |
| | | SELECT m.`order_code`, m.`name`, m.`id` |
| | | FROM manufacture_order m |
| | | WHERE m.`state` = 1 |
| | | </select> |
| | | |
| | | <update id="updateManufacture"> |
| | | UPDATE manufacture_order m |
| | | SET m.`type` = 1, m.`go_state` = 0, m.`scheduled_production` = m.`scheduled_production` + #{schedulingNumber} |
| | | where m.id = #{manufactureOrderId} |
| | | </update> |
| | | </mapper> |
| | |
| | | AND d.`father` = #{fatherName} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="getDeviceNameByGroup" resultType="java.util.Map"> |
| | | select id, name |
| | | select id as deviceid, name deviceName |
| | | from mom_ocean.device |
| | | where state = 1 |
| | | and father = #{deviceGroup} |
| | |
| | | package com.yuanchu.mom; |
| | | |
| | | import com.yuanchu.mom.mapper.ManufactureOrderMapper; |
| | | import com.yuanchu.mom.utils.MyUtil; |
| | | import org.junit.jupiter.api.Test; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @SpringBootTest |
| | | class SystemRunApplicationTest { |
| | | |
| | | @Resource |
| | | private ManufactureOrderMapper manufactureOrderMapper; |
| | | @Test |
| | | void contextLoads() { |
| | | |
| | | } |
| | | } |