fix:增加工单工作顺序字段,删除工序顺序号字段;
This commit is contained in:
@@ -4,23 +4,24 @@ import cn.hutool.core.util.StrUtil;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 工序类型枚举类
|
* 工序类型枚举类
|
||||||
|
*
|
||||||
* @author: geng by
|
* @author: geng by
|
||||||
* @createDate: 2022/12/8
|
* @createDate: 2022/12/8
|
||||||
*/
|
*/
|
||||||
public enum WorkOrderImportEnum{
|
public enum WorkOrderImportEnum{
|
||||||
JGXL(1, "01", "激光下料","1535143737330634752"),
|
JGXL(0, "00", "激光下料", "1535143737330634752"),
|
||||||
XYXL(2, "02", "旋压下料","1535143882327724032"),
|
XYXL(1, "01", "旋压下料", "1535143882327724032"),
|
||||||
PGWXXL(3, "03", "盘管无屑下料","1535144117946945536"),
|
PGWXXL(2, "02", "盘管无屑下料", "1535144117946945536"),
|
||||||
ZGWXXL(4, "04", "直管无屑下料","1535144223790206976"),
|
TWYTJ(3, "03", "推弯一体机", "1535144427977314304"),
|
||||||
|
ZJDC(4, "04", "直接打槽", "1535144356586165920"),
|
||||||
STLS(5, "05", "三通拉伸", "1535144290030850048"),
|
STLS(5, "05", "三通拉伸", "1535144290030850048"),
|
||||||
TK(6, "06", "镗孔", "1535144356586065920"),
|
TK(6, "06", "镗孔", "1535144356586065920"),
|
||||||
TWYTJ(7, "07", "推弯一体机","1535144427977314304"),
|
ZGWXXL(7, "07", "直管无屑下料", "1535144223790206976"),
|
||||||
CPQX(8, "08", "成品清洗", "1535144552481034240"),
|
CPQX(8, "08", "成品清洗", "1535144552481034240"),
|
||||||
KZ(9, "09", "刻字", "1535144682756116480"),
|
KZ(9, "09", "刻字", "1535144682756116480"),
|
||||||
BZ(10, "10", "包装", "1535144822984282112"),
|
BZ(10, "10", "包装", "1535144822984282112"),
|
||||||
MP(11, "11", "码盘", "1535144873605337088"),
|
MP(11, "11", "码盘", "1535144873605337088"),
|
||||||
CC(12, "12", "仓储", "1535144934791843840");
|
CC(12, "12", "仓储", "1535144934791843840");
|
||||||
|
|
||||||
private int index;
|
private int index;
|
||||||
private String code;
|
private String code;
|
||||||
private String name;
|
private String name;
|
||||||
@@ -38,6 +39,10 @@ public enum WorkOrderImportEnum {
|
|||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Integer getIndex() {
|
||||||
|
return index;
|
||||||
|
}
|
||||||
|
|
||||||
public static WorkOrderImportEnum getIdByName(String name) {
|
public static WorkOrderImportEnum getIdByName(String name) {
|
||||||
name = name.replace("", "");
|
name = name.replace("", "");
|
||||||
for(WorkOrderImportEnum workOrderImportEnum : WorkOrderImportEnum.values()) {
|
for(WorkOrderImportEnum workOrderImportEnum : WorkOrderImportEnum.values()) {
|
||||||
@@ -48,10 +53,20 @@ public enum WorkOrderImportEnum {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static WorkOrderImportEnum getIdByIndex(Integer id) {
|
||||||
|
for(WorkOrderImportEnum workOrderImportEnum : WorkOrderImportEnum.values()) {
|
||||||
|
if(workOrderImportEnum.getIndex().equals(id)) {
|
||||||
|
return workOrderImportEnum;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
WorkOrderImportEnum(int index, String code, String name, String id) {
|
WorkOrderImportEnum(int index, String code, String name, String id) {
|
||||||
this.index = index;
|
this.index = index;
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.code = code;
|
this.code = code;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
|
this.index = index;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -216,5 +216,36 @@ public class PdmProduceWorkorderController {
|
|||||||
public void download(@RequestBody Map map, HttpServletResponse response) throws IOException {
|
public void download(@RequestBody Map map, HttpServletResponse response) throws IOException {
|
||||||
iPdmProduceWorkorderService.download(map, response);
|
iPdmProduceWorkorderService.download(map, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/queryAdjustWorkOrder")
|
||||||
|
@Log("根据设备获取工单信息")
|
||||||
|
//("根据设备获取工单信息")
|
||||||
|
public ResponseEntity<Object> queryAdjustWorkOrder(@RequestBody WorkorderQuery param) {
|
||||||
|
return new ResponseEntity<>(TableDataInfo.build(iPdmProduceWorkorderService.queryAdjustWorkOrder(param.getDevice_code())), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/submitAdjustWorkOrder")
|
||||||
|
@Log("提交排产调整的工单信息")
|
||||||
|
//("提交排产调整的工单信息")
|
||||||
|
public ResponseEntity<Object> submitWorkOrder(@RequestBody JSONArray param) {
|
||||||
|
iPdmProduceWorkorderService.submitAdjustWorkOrder(param);
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -159,4 +159,8 @@ public interface IPdmProduceWorkorderService extends IService<PdmProduceWorkorde
|
|||||||
|
|
||||||
void download(Map map, HttpServletResponse response)
|
void download(Map map, HttpServletResponse response)
|
||||||
throws IOException;
|
throws IOException;
|
||||||
|
|
||||||
|
void submitAdjustWorkOrder(JSONArray param);
|
||||||
|
|
||||||
|
List<Map> queryAdjustWorkOrder(String device_code);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -224,4 +224,14 @@ public class PdmProduceWorkorder implements Serializable{
|
|||||||
* 修改时间
|
* 修改时间
|
||||||
*/
|
*/
|
||||||
private Date update_time;
|
private Date update_time;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* aps工作顺序号
|
||||||
|
*/
|
||||||
|
private Integer aps_workorder_no;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,4 +47,13 @@ public interface PdmProduceWorkorderMapper extends BaseMapper<PdmProduceWorkorde
|
|||||||
*/
|
*/
|
||||||
List<Map> goodAnalysis(ByProcessQuery query);
|
List<Map> goodAnalysis(ByProcessQuery query);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排产调整按设备查工单
|
||||||
|
* @param device_code
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<Map> queryAdjustWorkOrder(String device_code);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,8 @@
|
|||||||
and find_in_set(ShiftOrder.workorder_status, #{query.order_status})
|
and find_in_set(ShiftOrder.workorder_status, #{query.order_status})
|
||||||
</if>
|
</if>
|
||||||
<if test="query.device_code != null and query.device_code != ''">
|
<if test="query.device_code != null and query.device_code != ''">
|
||||||
and (ShiftOrder.device_code like concat('%',${query.device_code},'%') or ShiftOrder.device_name like concat('%',${query.device_code},'%'))
|
and (ShiftOrder.device_code like concat('%',${query.device_code},'%') or ShiftOrder.device_name like
|
||||||
|
concat('%',${query.device_code},'%'))
|
||||||
</if>
|
</if>
|
||||||
<if test="query.shift_type_scode != null and query.shift_type_scode != ''">
|
<if test="query.shift_type_scode != null and query.shift_type_scode != ''">
|
||||||
and ShiftOrder.shift_type_scode = #{query.shift_type_scode}
|
and ShiftOrder.shift_type_scode = #{query.shift_type_scode}
|
||||||
@@ -140,7 +141,6 @@
|
|||||||
workorder.aps_update_time,
|
workorder.aps_update_time,
|
||||||
workorder.package_ext,
|
workorder.package_ext,
|
||||||
workorder.is_used_fxx,
|
workorder.is_used_fxx,
|
||||||
workorder.aps_workprocedure_no,
|
|
||||||
workorder.aps_update_inner_flag,
|
workorder.aps_update_inner_flag,
|
||||||
workorder.update_id,
|
workorder.update_id,
|
||||||
workorder.update_name,
|
workorder.update_name,
|
||||||
@@ -180,7 +180,8 @@
|
|||||||
</if>
|
</if>
|
||||||
order by workorder_code desc
|
order by workorder_code desc
|
||||||
</select>
|
</select>
|
||||||
<select id="orderListByDevLimit" resultType="org.nl.wms.product_manage.service.workorder.dto.PdmProduceWorkorderDto">
|
<select id="orderListByDevLimit"
|
||||||
|
resultType="org.nl.wms.product_manage.service.workorder.dto.PdmProduceWorkorderDto">
|
||||||
select pdm_bi_device.deviceinstor_qty,
|
select pdm_bi_device.deviceinstor_qty,
|
||||||
(pdm_produce_workorder.plan_qty- pdm_produce_workorder.dq_real_qty) as needQty,
|
(pdm_produce_workorder.plan_qty- pdm_produce_workorder.dq_real_qty) as needQty,
|
||||||
(pdm_bi_device.inupperlimit_qty - pdm_bi_device.deviceinstor_qty ) as limitQty,
|
(pdm_bi_device.inupperlimit_qty - pdm_bi_device.deviceinstor_qty ) as limitQty,
|
||||||
@@ -221,10 +222,29 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertBatch" keyProperty="workorder_id" useGeneratedKeys="false">
|
<insert id="insertBatch" keyProperty="workorder_id" useGeneratedKeys="false">
|
||||||
insert into pdm_produce_workorder(workorder_id,workorder_code, shift_type_scode, workprocedure_id, product_area, plan_qty, person_real_qty, dq_real_qty, material_id, material_weight, planproducestart_date, planproduceend_date, realproducestart_date, realproduceend_date, device_code, current_produce_person_id, is_canupdate_update, materialprocess_series, workorder_status, is_needmove, sale_id, create_type, is_error, error_info, remark, create_id, create_name, create_time, is_delete, report_qty, order_type_scode, nok_qty, repare_qty, down_id, down_name, down_time, confirm_id, confirm_name, confirm_time, aps_workorder_status, aps_update_flag, aps_update_time, package_ext, is_used_fxx, aps_workprocedure_no, aps_update_inner_flag, update_id, update_name, update_time, device_name)
|
insert into pdm_produce_workorder(workorder_id,workorder_code, shift_type_scode, workprocedure_id, product_area,
|
||||||
|
plan_qty, person_real_qty, dq_real_qty, material_id, material_weight, planproducestart_date,
|
||||||
|
planproduceend_date, realproducestart_date, realproduceend_date, device_code, current_produce_person_id,
|
||||||
|
is_canupdate_update, materialprocess_series, workorder_status, is_needmove, sale_id, create_type, is_error,
|
||||||
|
error_info, remark, create_id, create_name, create_time, is_delete, report_qty, order_type_scode, nok_qty,
|
||||||
|
repare_qty, down_id, down_name, down_time, confirm_id, confirm_name, confirm_time, aps_workorder_status,
|
||||||
|
aps_update_flag, aps_update_time, package_ext, is_used_fxx, aps_update_inner_flag,
|
||||||
|
update_id, update_name, update_time, device_name)
|
||||||
values
|
values
|
||||||
<foreach collection="entities" item="entity" separator=",">
|
<foreach collection="entities" item="entity" separator=",">
|
||||||
(#{entity.workorder_id},#{entity.workorder_code}, #{entity.shift_type_scode}, #{entity.workprocedure_id}, #{entity.product_area}, #{entity.plan_qty}, #{entity.person_real_qty}, #{entity.dq_real_qty}, #{entity.material_id}, #{entity.material_weight}, #{entity.planproducestart_date}, #{entity.planproduceend_date}, #{entity.realproducestart_date}, #{entity.realproduceend_date}, #{entity.device_code}, #{entity.current_produce_person_id}, #{entity.is_canupdate_update}, #{entity.materialprocess_series}, #{entity.workorder_status}, #{entity.is_needmove}, #{entity.sale_id}, #{entity.create_type}, #{entity.is_error}, #{entity.error_info}, #{entity.remark}, #{entity.create_id}, #{entity.create_name}, #{entity.create_time}, #{entity.is_delete}, #{entity.report_qty}, #{entity.order_type_scode}, #{entity.nok_qty}, #{entity.repare_qty}, #{entity.down_id}, #{entity.down_name}, #{entity.down_time}, #{entity.confirm_id}, #{entity.confirm_name}, #{entity.confirm_time}, #{entity.aps_workorder_status}, #{entity.aps_update_flag}, #{entity.aps_update_time}, #{entity.package_ext}, #{entity.is_used_fxx}, #{entity.aps_workprocedure_no}, #{entity.aps_update_inner_flag}, #{entity.update_id}, #{entity.update_name}, #{entity.update_time}, #{entity.device_name})
|
(#{entity.workorder_id},#{entity.workorder_code}, #{entity.shift_type_scode}, #{entity.workprocedure_id},
|
||||||
|
#{entity.product_area}, #{entity.plan_qty}, #{entity.person_real_qty}, #{entity.dq_real_qty},
|
||||||
|
#{entity.material_id}, #{entity.material_weight}, #{entity.planproducestart_date},
|
||||||
|
#{entity.planproduceend_date}, #{entity.realproducestart_date}, #{entity.realproduceend_date},
|
||||||
|
#{entity.device_code}, #{entity.current_produce_person_id}, #{entity.is_canupdate_update},
|
||||||
|
#{entity.materialprocess_series}, #{entity.workorder_status}, #{entity.is_needmove}, #{entity.sale_id},
|
||||||
|
#{entity.create_type}, #{entity.is_error}, #{entity.error_info}, #{entity.remark}, #{entity.create_id},
|
||||||
|
#{entity.create_name}, #{entity.create_time}, #{entity.is_delete}, #{entity.report_qty},
|
||||||
|
#{entity.order_type_scode}, #{entity.nok_qty}, #{entity.repare_qty}, #{entity.down_id}, #{entity.down_name},
|
||||||
|
#{entity.down_time}, #{entity.confirm_id}, #{entity.confirm_name}, #{entity.confirm_time},
|
||||||
|
#{entity.aps_workorder_status}, #{entity.aps_update_flag}, #{entity.aps_update_time}, #{entity.package_ext},
|
||||||
|
#{entity.is_used_fxx}, #{entity.aps_update_inner_flag}, #{entity.update_id},
|
||||||
|
#{entity.update_name}, #{entity.update_time}, #{entity.device_name})
|
||||||
</foreach>
|
</foreach>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
@@ -237,9 +257,12 @@
|
|||||||
md_me_materialbase.material_spec,
|
md_me_materialbase.material_spec,
|
||||||
sum( pdm_produce_workorder.real_qty )*rate_qty*1000 as rate_weight,
|
sum( pdm_produce_workorder.real_qty )*rate_qty*1000 as rate_weight,
|
||||||
sum( pdm_produce_workorder.real_qty )*md_me_materialbase.net_weight as product_weight,
|
sum( pdm_produce_workorder.real_qty )*md_me_materialbase.net_weight as product_weight,
|
||||||
if(sum(pdm_produce_workorder.real_qty )>0,sum( pdm_produce_workorder.real_qty )*md_me_materialbase.net_weight/(sum( pdm_produce_workorder.real_qty )*rate_qty*1000),1) as yield_rate,
|
if(sum(pdm_produce_workorder.real_qty )>0,sum( pdm_produce_workorder.real_qty
|
||||||
if(sum(pdm_produce_workorder.real_qty )>0,sum( pdm_produce_workorder.nok_qty )/sum(pdm_produce_workorder.real_qty ),0) as nok_rate,
|
)*md_me_materialbase.net_weight/(sum( pdm_produce_workorder.real_qty )*rate_qty*1000),1) as yield_rate,
|
||||||
if(sum(pdm_produce_workorder.real_qty )>0,1-sum( pdm_produce_workorder.nok_qty )/sum(pdm_produce_workorder.real_qty ),1) as endproduct_rate,
|
if(sum(pdm_produce_workorder.real_qty )>0,sum( pdm_produce_workorder.nok_qty
|
||||||
|
)/sum(pdm_produce_workorder.real_qty ),0) as nok_rate,
|
||||||
|
if(sum(pdm_produce_workorder.real_qty )>0,1-sum( pdm_produce_workorder.nok_qty
|
||||||
|
)/sum(pdm_produce_workorder.real_qty ),1) as endproduct_rate,
|
||||||
MD_ME_SemiRealRawMaterial.raw_material_code,
|
MD_ME_SemiRealRawMaterial.raw_material_code,
|
||||||
pdm_bi_workprocedure.workprocedure_name,
|
pdm_bi_workprocedure.workprocedure_name,
|
||||||
md_me_materialbase.material_code
|
md_me_materialbase.material_code
|
||||||
@@ -247,7 +270,8 @@
|
|||||||
pdm_produce_workorder
|
pdm_produce_workorder
|
||||||
LEFT JOIN pdm_bi_workprocedure ON pdm_produce_workorder.workprocedure_id = pdm_bi_workprocedure.workprocedure_id
|
LEFT JOIN pdm_bi_workprocedure ON pdm_produce_workorder.workprocedure_id = pdm_bi_workprocedure.workprocedure_id
|
||||||
LEFT JOIN md_me_materialbase ON pdm_produce_workorder.material_id = md_me_materialbase.material_id
|
LEFT JOIN md_me_materialbase ON pdm_produce_workorder.material_id = md_me_materialbase.material_id
|
||||||
LEFT JOIN MD_ME_SemiRealRawMaterial ON pdm_produce_workorder.material_id = MD_ME_SemiRealRawMaterial.semi_material_id
|
LEFT JOIN MD_ME_SemiRealRawMaterial ON pdm_produce_workorder.material_id =
|
||||||
|
MD_ME_SemiRealRawMaterial.semi_material_id
|
||||||
WHERE
|
WHERE
|
||||||
pdm_bi_workprocedure.is_first = '1'
|
pdm_bi_workprocedure.is_first = '1'
|
||||||
AND md_me_materialbase.material_code IS NOT NULL
|
AND md_me_materialbase.material_code IS NOT NULL
|
||||||
@@ -270,5 +294,31 @@
|
|||||||
pdm_bi_workprocedure.workprocedure_name
|
pdm_bi_workprocedure.workprocedure_name
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="queryAdjustWorkOrder" resultType="java.util.Map">
|
||||||
|
SELECT
|
||||||
|
w.workprocedure_name,
|
||||||
|
DATE_FORMAT( orders.plandeliver_date, '%Y-%m-%d' ) AS plandeliver_date,
|
||||||
|
mater.material_spec,
|
||||||
|
SUBSTRING_INDEX( workorder.workorder_id, ':', 2 ) AS workorder_no,
|
||||||
|
COUNT( DISTINCT workorder.device_code ) AS device_count,
|
||||||
|
COUNT( workorder.workorder_code ) AS workorder_count,
|
||||||
|
MIN(DATE_FORMAT(workorder.planproducestart_date, '%Y-%m-%d %H:%i:%s')) AS start_time
|
||||||
|
FROM
|
||||||
|
pdm_produce_workorder workorder
|
||||||
|
LEFT JOIN mps_sale_order orders ON workorder.sale_id = orders.sale_code
|
||||||
|
LEFT JOIN md_me_materialbase mater ON workorder.material_id = mater.material_id
|
||||||
|
LEFT JOIN pdm_bi_workprocedure w ON workorder.workprocedure_id = w.workprocedure_id
|
||||||
|
WHERE
|
||||||
|
workorder.is_delete = '0' and workorder.workorder_status = '1'
|
||||||
|
<if test="device_code != null and device_code != ''">
|
||||||
|
and workorder.device_code =#{device_code}
|
||||||
|
</if>
|
||||||
|
GROUP BY
|
||||||
|
workorder.sale_id
|
||||||
|
ORDER BY
|
||||||
|
start_time
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|||||||
@@ -876,4 +876,14 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
|||||||
public List<Map> goodAnilysis(ByProcessQuery query) {
|
public List<Map> goodAnilysis(ByProcessQuery query) {
|
||||||
return this.baseMapper.goodAnalysis(query);
|
return this.baseMapper.goodAnalysis(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void submitAdjustWorkOrder(JSONArray param) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Map> queryAdjustWorkOrder(String device_code) {
|
||||||
|
return pdmProduceWorkorderMapper.queryAdjustWorkOrder(device_code);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user