生产订单管理模块(机型回显问题修复)

highway
wws 1 year ago
parent b3440cfbbb
commit cca119c843

@ -4,6 +4,7 @@ import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.op.mes.domain.ProOrderWorkorder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -35,6 +36,17 @@ public class ProWetMaterialPlanController extends BaseController {
@Autowired
private IProWetMaterialPlanService proWetMaterialPlanService;
/**
* 湿
*
* @param proOrderWorkorderList
* @return
*/
@PostMapping("/addWetPlan")
public AjaxResult addWetPlan(@RequestBody List<ProOrderWorkorder> proOrderWorkorderList) {
return proWetMaterialPlanService.addWetPlan(proOrderWorkorderList);
}
/**
* list
*
@ -42,7 +54,7 @@ public class ProWetMaterialPlanController extends BaseController {
* @return
*/
@GetMapping("/getBMSList")
public AjaxResult getBMSList(Date planTime){
public AjaxResult getBMSList(Date planTime) {
return proWetMaterialPlanService.getBMSList(planTime);
}

@ -119,9 +119,86 @@ public class ProOrderWorkorder extends TreeEntity {
@Excel(name = "是否为底层节点")
private Integer isEnd;
/** 班次名称 */
/** 班次名称(数据库无该字段,需自行查询) */
private String shiftDesc;
// 料罐id湿料计划模块使用
private Integer bucketId;
// 料罐编码(湿料计划模块使用)
private String bucketCode;
// 物料id湿料计划模块使用
private Integer materialId;
// 物料编码(湿料计划模块使用)
private String materialCode;
// 物料名称(湿料计划模块使用)
private String materialName;
// 计划日期(湿料计划模块使用)
private Date planTime;
// 料罐名称(湿料计划模块使用)
private String bucketName;
public String getBucketName() {
return bucketName;
}
public void setBucketName(String bucketName) {
this.bucketName = bucketName;
}
public Integer getBucketId() {
return bucketId;
}
public void setBucketId(Integer bucketId) {
this.bucketId = bucketId;
}
public String getBucketCode() {
return bucketCode;
}
public void setBucketCode(String bucketCode) {
this.bucketCode = bucketCode;
}
public Integer getMaterialId() {
return materialId;
}
public void setMaterialId(Integer materialId) {
this.materialId = materialId;
}
public String getMaterialCode() {
return materialCode;
}
public void setMaterialCode(String materialCode) {
this.materialCode = materialCode;
}
public String getMaterialName() {
return materialName;
}
public void setMaterialName(String materialName) {
this.materialName = materialName;
}
public Date getPlanTime() {
return planTime;
}
public void setPlanTime(Date planTime) {
this.planTime = planTime;
}
public String getShiftDesc() {
return shiftDesc;
}
@ -365,6 +442,13 @@ public class ProOrderWorkorder extends TreeEntity {
.append("batchCodeList",getBatchCodeList())
.append("isEnd",getIsEnd())
.append("shiftDesc",getShiftDesc())
.append("bucketId",getBucketId())
.append("bucketCode",getBucketCode())
.append("materialId",getMaterialId())
.append("materialCode",getMaterialCode())
.append("materialName",getMaterialName())
.append("planTime",getPlanTime())
.append("bucketName",getBucketName())
.toString();
}
}

@ -76,6 +76,28 @@ public class ProWetMaterialPlan extends BaseEntity {
/** 结束时间 */
private Date endTime;
/** 班次id */
private Integer shiftId;
/** 班次简称desc */
private String shiftDesc;
public Integer getShiftId() {
return shiftId;
}
public void setShiftId(Integer shiftId) {
this.shiftId = shiftId;
}
public String getShiftDesc() {
return shiftDesc;
}
public void setShiftDesc(String shiftDesc) {
this.shiftDesc = shiftDesc;
}
public Date getEndTime() {
return endTime;
}
@ -230,6 +252,8 @@ public class ProWetMaterialPlan extends BaseEntity {
.append("planCode", getPlanCode())
.append("startTime",getStartTime())
.append("endTime",getEndTime())
.append("shiftId",getShiftId())
.append("shiftDesc",getShiftDesc())
.toString();
}
}

@ -101,7 +101,7 @@ public interface ProOrderMapper {
*
* @return
*/
@Select("SELECT equipment_name AS 'prodLineName' FROM base_equipment WHERE equipment_type_code = 'equ_type_cxj' AND equipment_id = #{prodLineName}")
@Select("SELECT equipment_name AS 'prodLineName' FROM base_equipment WHERE equipment_id = #{prodLineCode}")
String selectProdLineName(String prodLineCode);
/**

@ -4,6 +4,7 @@ import java.util.Date;
import java.util.List;
import com.op.common.core.web.domain.AjaxResult;
import com.op.mes.domain.ProOrderWorkorder;
import com.op.mes.domain.ProWetMaterialPlan;
/**
@ -90,4 +91,12 @@ public interface IProWetMaterialPlanService {
* @return
*/
AjaxResult getBMSList(Date planTime);
/**
* 湿
*
* @param proOrderWorkorderList
* @return
*/
AjaxResult addWetPlan(List<ProOrderWorkorder> proOrderWorkorderList);
}

@ -5,14 +5,12 @@ import java.util.*;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.web.domain.AjaxResult;
import com.op.mes.domain.BMS;
import com.op.mes.domain.ProOrderWorkorder;
import com.op.mes.domain.Product;
import com.op.mes.domain.*;
import com.op.mes.mapper.ProOrderMapper;
import com.op.mes.mapper.ProOrderWorkorderMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.mes.mapper.ProWetMaterialPlanMapper;
import com.op.mes.domain.ProWetMaterialPlan;
import com.op.mes.service.IProWetMaterialPlanService;
import static com.op.common.core.web.domain.AjaxResult.error;
@ -30,6 +28,8 @@ public class ProWetMaterialPlanServiceImpl implements IProWetMaterialPlanService
private ProWetMaterialPlanMapper proWetMaterialPlanMapper;
@Autowired
private ProOrderWorkorderMapper proOrderWorkorderMapper;
@Autowired
private ProOrderMapper proOrderMapper;
/**
* 湿
@ -41,7 +41,7 @@ public class ProWetMaterialPlanServiceImpl implements IProWetMaterialPlanService
@DS("#header.poolName")
public ProWetMaterialPlan selectProWetMaterialPlanById(String id) {
// 参数判空
if (id == null || id.equals("")){
if (id == null || id.equals("")) {
return null;
}
return proWetMaterialPlanMapper.selectProWetMaterialPlanById(id);
@ -122,7 +122,7 @@ public class ProWetMaterialPlanServiceImpl implements IProWetMaterialPlanService
@DS("#header.poolName")
public AjaxResult getWorkOrderByTime(Date productDate) {
// 参数判空
if (productDate == null){
if (productDate == null) {
return error("参数为空!");
}
List<ProOrderWorkorder> workorderList = proOrderWorkorderMapper.selectWorkOrderByTime(productDate);
@ -166,9 +166,58 @@ public class ProWetMaterialPlanServiceImpl implements IProWetMaterialPlanService
@DS("#header.poolName")
public AjaxResult getBMSList(Date planTime) {
// 参数判空
if (planTime == null){
if (planTime == null) {
return error("参数为空!");
}
return success(proWetMaterialPlanMapper.selectBMSList(planTime));
}
/**
* 湿
*
* @param proOrderWorkorderList
* @return
*/
@Override
public AjaxResult addWetPlan(List<ProOrderWorkorder> proOrderWorkorderList) {
// 获取料罐信息list
List<Bucket> bucketList = proWetMaterialPlanMapper.selectBucketList();
// 获取班次信息list
List<ProShift> shiftList = proOrderMapper.selectProShift();
// 湿料计划分类
for (int shift = 0; shift < shiftList.size(); shift++){
}
return null;
}
public static Map<String, Map<String, List<String>>> classifyWorkOrders(List<String> shifts, List<String> tanks, List<String> workOrders) {
Map<String, Map<String, List<String>>> classifiedWorkOrders = new HashMap<>();
for (int i = 0; i < shifts.size(); i++) {
String shift = shifts.get(i);
String tank = tanks.get(i);
String workOrder = workOrders.get(i);
// 获取当前班次的工单分类
Map<String, List<String>> shiftMap = classifiedWorkOrders.getOrDefault(shift, new HashMap<>());
// 获取当前料罐的工单列表
List<String> tankOrders = shiftMap.getOrDefault(tank, new ArrayList<>());
// 添加工单到料罐列表
tankOrders.add(workOrder);
// 更新料罐的工单列表
shiftMap.put(tank, tankOrders);
// 更新班次的工单分类
classifiedWorkOrders.put(shift, shiftMap);
}
return classifiedWorkOrders;
}
}

@ -25,10 +25,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="status" column="status" />
<result property="prodType" column="prod_type" />
<result property="planCode" column="plan_code" />
<result property="shiftId" column="shift_id" />
<result property="shiftDesc" column="shift_desc" />
</resultMap>
<sql id="selectProWetMaterialPlanVo">
select id, factory_code, plan_time, sync_flag, create_by, create_time, update_by, update_time, order_type, prod_code, prod_desc, prod_source, quantity, unit, atrr1, atrr2, atrr3, status, prod_type, plan_code from pro_wet_material_plan
select id, factory_code, plan_time, sync_flag, create_by, create_time, update_by, update_time, order_type, prod_code, prod_desc, prod_source, quantity, unit, atrr1, atrr2, atrr3, status, prod_type, plan_code, shift_id, shift_desc from pro_wet_material_plan
</sql>
<select id="selectProWetMaterialPlanList" parameterType="ProWetMaterialPlan" resultMap="ProWetMaterialPlanResult">
@ -77,6 +79,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null">status,</if>
<if test="prodType != null">prod_type,</if>
<if test="planCode != null">plan_code,</if>
<if test="shiftId != null">shift_id,</if>
<if test="shiftDesc != null">shift_desc,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
@ -99,6 +103,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null">#{status},</if>
<if test="prodType != null">#{prodType},</if>
<if test="planCode != null">#{planCode},</if>
<if test="shiftId != null">#{shiftId},</if>
<if test="shiftDesc != null">#{shiftDesc},</if>
</trim>
</insert>
@ -124,6 +130,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null">status = #{status},</if>
<if test="prodType != null">prod_type = #{prodType},</if>
<if test="planCode != null">plan_code = #{planCode},</if>
<if test="shiftId != null">plan_code = #{shiftId},</if>
<if test="shiftDesc != null">plan_code = #{shiftDesc},</if>
</trim>
where id = #{id}
</update>

Loading…
Cancel
Save