报工+成品计划升级

highway
zhaoxiaolin 1 year ago
parent d53c96be6b
commit 20abf4cde4

@ -161,6 +161,15 @@ public class MesReportWorkDTO extends BaseEntity {
private String createTimeEnd;
private String feedbackTimeStart;
private String feedbackTimeEnd;
private String endReport;
public String getEndReport() {
return endReport;
}
public void setEndReport(String endReport) {
this.endReport = endReport;
}
public BigDecimal getQuantitySplit() {
return quantitySplit;

@ -364,6 +364,10 @@ public class MesReportWorkController extends BaseController {
return getDataTable(list);
}
@PutMapping("/getBatchList")
public List<ProOrderWorkorder> getBatchList(@RequestBody ProOrderWorkorder ProOrderWorkorder) {
return mesReportWorkService.getBatchList(ProOrderWorkorder);
}
public static void main(String args[]){
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:00:00");

@ -163,6 +163,24 @@ public class MesReportWork extends BaseEntity {
private String createTimeEnd;
private String feedbackTimeStart;
private String feedbackTimeEnd;
private String batch;
private String endReport;
public String getEndReport() {
return endReport;
}
public void setEndReport(String endReport) {
this.endReport = endReport;
}
public String getBatch() {
return batch;
}
public void setBatch(String batch) {
this.batch = batch;
}
public Long getUseMan() {
return useMan;

@ -154,6 +154,24 @@ public class ProOrderWorkorder extends TreeEntity {
// 料罐名称(湿料计划模块使用)
private String bucketName;
private String batchCode;
private String batchId;
public String getBatchCode() {
return batchCode;
}
public void setBatchCode(String batchCode) {
this.batchCode = batchCode;
}
public String getBatchId() {
return batchId;
}
public void setBatchId(String batchId) {
this.batchId = batchId;
}
public String getBucketName() {
return bucketName;

@ -106,4 +106,6 @@ public interface MesReportWorkMapper {
Map<String, EquEquipmentDTO> getEquipInfoByCodes(String substring);
List<EquEquipmentDTO> getMesListEquip(EquEquipmentDTO qo);
List<ProOrderWorkorder> getBatchList(ProOrderWorkorder proOrderWorkorder);
}

@ -88,4 +88,6 @@ public interface IMesReportWorkService {
List<EquEquipmentDTO> getMesListEquip(EquEquipmentDTO equEquipmentDTO);
R reportSap(MesReportWork mesReportWork);
List<ProOrderWorkorder> getBatchList(ProOrderWorkorder proOrderWorkorder);
}

@ -330,7 +330,10 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
//工单完成数量>工单数量:关闭订单
MesReportWork proResult = mesReportWorkMapper.getProdResult(work);
//ProOrderWorkorder topOrder = this.getTopOrder(work.getWorkorderCode());
if(proResult.getQuantityFeedback().compareTo(work.getQuantitySplit())>=0){
if(proResult.getQuantityFeedback().compareTo(work.getQuantitySplit())>=0
||
"1".equals(work.getEndReport())//最终报工标识
){
//工单完成,关闭工单
remoteSapService.sapCloseOrder(work.getWorkorderCodeSap());
work.setStatus("w3");

@ -122,6 +122,12 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService {
return s;
}
@Override
@DS("#header.poolName")
public List<ProOrderWorkorder> getBatchList(ProOrderWorkorder proOrderWorkorder) {
return mesReportWorkMapper.getBatchList(proOrderWorkorder);
}
/**
*
*

@ -42,6 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="uploadStatus" column="upload_status" />
<result property="uploadMsg" column="upload_msg" />
<result property="orderCode" column="order_code" />
<result property="batch" column="batch" />
</resultMap>
<resultMap type="com.op.system.api.domain.mes.ProOrderWorkorderDTO" id="ProOrderWorkorderDTOResult">
<result property="workorderId" column="workorder_id" />
@ -96,7 +97,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mrw.feedback_time, mrw.record_user, mrw.status, mrw.remark, mrw.work_time, mrw.machine_code,
mrw.machine_name, mrw.team_code, mrw.shift_code, mrw.create_by,
mrw.create_time,mrw.upload_time,mrw.upload_status,mrw.upload_msg,
mrw.use_man,
mrw.use_man,mrw.batch,
pow.order_code,pow.quantity_split
from mes_report_work mrw
left join pro_order_workorder pow on mrw.workorder_code = pow.workorder_code
@ -228,7 +229,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mrw.id,
mrw.quantity_feedback quantityFeedback,
mrw.product_code productCode,
mrw.product_name productName
mrw.product_name productName,
mrw.end_report endReport
from mes_report_work mrw
left join pro_order_workorder ow on mrw.workorder_code = ow.workorder_code
left join pro_route rte on rte.route_code = ow.route_code
@ -433,6 +435,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from base_equipment
where equipment_type_code = 'equ_type_bzx' and del_flag = '0'
</select>
<select id="getBatchList" resultType="com.op.mes.domain.ProOrderWorkorder">
select powb.batch_id batchId,
powb.batch_code batchCode
from pro_order_workorder_batch powb
left join pro_order_workorder pow on powb.workorder_id = pow.workorder_id
where powb.del_flag = '0' and pow.del_flag = '0'
and pow.workorder_code = #{workorderCode}
</select>
<insert id="insertMesReportWork" parameterType="MesReportWork">
insert into mes_report_work
@ -471,6 +481,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateTime != null">update_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="prodType != null and prodType != ''">prod_type,</if>
<if test="batch != null and batch != ''">batch,</if>
<if test="endReport != null and endReport != ''">end_report,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
@ -507,6 +519,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateTime != null">#{updateTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="prodType != null and prodType != ''">#{prodType},</if>
<if test="batch != null and batch != ''">#{batch},</if>
<if test="endReport != null and endReport != ''">#{endReport},</if>
</trim>
</insert>
@ -545,6 +559,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="batch != null and batch != ''">batch = #{batch},</if>
<if test="endReport != null and endReport != ''">end_report = #{endReport},</if>
</trim>
where id = #{id}
</update>

@ -199,7 +199,10 @@ public class OpenServiceImpl implements OpenService {
//工单完成数量>工单数量:关闭订单
MesReportWorkDTO proResult = openMapper.getProdResult(work);
//ProOrderWorkorderDTO topOrder = this.getTopOrder(work.getWorkorderCode());
if(proResult.getQuantityFeedback().compareTo(work.getQuantitySplit())>=0){
if(proResult.getQuantityFeedback().compareTo(work.getQuantitySplit())>=0
||
"1".equals(work.getEndReport())//最终报工标识
){
//工单完成,关闭工单
remoteSapService.sapCloseOrder(work.getWorkorderCodeSap());
work.setStatus("w3");

@ -84,7 +84,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mrw.id,
mrw.quantity_feedback quantityFeedback,
mrw.product_code productCode,
mrw.product_name productName
mrw.product_name productName,
mrw.end_report endReport
from mes_report_work mrw
left join pro_order_workorder ow on mrw.workorder_code = ow.workorder_code
left join pro_route rte on rte.route_code = ow.route_code

@ -208,10 +208,19 @@ public class ProOrderWorkorder extends TreeEntity {
/** 批次号 */
private List<StringBuilder> batchCodeList;
private List<StringBuilder> batchNumList;
private List<String> batchInfo;
/** $column.columnComment */
private String factoryCode;
public List<String> getBatchInfo() {
return batchInfo;
}
public void setBatchInfo(List<String> batchInfo) {
this.batchInfo = batchInfo;
}
public List<StringBuilder> getBatchNumList() {
return batchNumList;
}

@ -152,5 +152,7 @@ public interface ProOrderWorkorderMapper {
int getProSortNo(ProOrder proOrder);
void deleteProOrderWorkorderByOrderIds(String[] orderIds);
List<String> getBatchInfo(String workorderCode);
}

@ -110,6 +110,10 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
// workorder.setProdLineCode(proOrderMapper.selectProdLineName(workorder.getProdLineCode()));
// 通过工艺编码code查询出机型名称
workorder.setRouteName(proOrderWorkorderMapper.selectRouteNameByRouteCode(workorder.getRouteCode()));
//
// //批次信息(母)
// List<String> batchs = proOrderWorkorderMapper.getBatchInfo(workorder.getWorkorderId());
// workorder.setBatchInfo(batchs);
}
return workorderList;
}
@ -973,14 +977,16 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
// 通过工单id查询批次号
List<ProOrderWorkorderBatch> batchCodeList = proOrderMapper.selectBatchCodesById(proOrderWorkorder.getWorkorderId());
List<StringBuilder> batchCodes = new ArrayList<>();
List<StringBuilder> batchNums = new ArrayList<>();
// 格式化数据
for (ProOrderWorkorderBatch batchCode : batchCodeList) {
batchCodes.add(new StringBuilder(batchCode.getBatchCode()).append(";").append("\n"));
batchNums.add(new StringBuilder(batchCode.getBatchQuantity()+"").append(";").append("\n"));
}
// 将查询结果设置到当前工单对象
proOrderWorkorder.setShiftDesc(shiftDesc);
proOrderWorkorder.setBatchCodeList(batchCodes);
proOrderWorkorder.setBatchNumList(batchNums);
// 通过母工单workorder_id查询子工单
List<ProOrderWorkorder> childWorkorders = proOrderWorkorderMapper.selectChildWorkOrder(proOrderWorkorder.getWorkorderCode());
if (!childWorkorders.isEmpty()) {

@ -348,6 +348,11 @@
select count(0)+1 from pro_order_workorder
where product_date = #{productDate} and end_flag='1'
</select>
<select id="getBatchInfo" resultType="java.lang.String">
select concat(batch_code,':',batch_quantity)
from pro_order_workorder_batch
where workorder_id = #{workorderId} and del_flag = '0'
</select>
<insert id="createPrepareDetails">
insert into mes_prepare_detail

Loading…
Cancel
Save