opt:刻字输送线任务下发控制

This commit is contained in:
zhangzhiqiang
2023-09-13 18:33:59 +08:00
parent aae00c55c4
commit 88c6ad2d37
16 changed files with 234 additions and 110 deletions

View File

@@ -22,8 +22,6 @@
LEFT JOIN md_pb_classstandard class ON class.class_id = mb.material_type_id
<where>
ivt.canuse_qty > 0
AND
sa.lock_type = '0'
<if test="query.material_search != null and query.material_search != ''">
and (mb.material_code like '%${query.material_search}%' OR
mb.material_name like '%${query.material_search}%' OR

View File

@@ -293,20 +293,6 @@ public class DevicemaintenanceplanmstServiceImpl implements Devicemaintenancepla
map.put("useIds", useIds);
}
// 如果班组为空 则默认当前用户部门
/* if (ObjectUtil.isEmpty(use_id) && ObjectUtil.isEmpty(dept_id)) {
// 获取当前登陆用户
Long currentUserId = Long.parseLong(SecurityUtils.getCurrentUserId());
JSONObject jsonUser = WQLObject.getWQLObject("sys_user").query("user_id = '" + currentUserId + "'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(jsonUser)) {
String dept_str = deptService.getChildIdStr(jsonUser.getLong("dept_id"));
if (ObjectUtil.isNotEmpty(dept_str)) {
map.put("dept_str",dept_str);
}
}
}*/
JSONObject json = WQL.getWO("EM_BIDEVICEMAINTENANCEPLAN_01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "file.update_time DESC");
return json;

View File

@@ -14,6 +14,7 @@ import org.nl.wms.quality_manage.service.report.IQlTestInspectionsheetmstService
import org.nl.wms.quality_manage.service.report.dao.QlTestInspectionsheetdtl;
import org.nl.wms.quality_manage.service.report.dao.QlTestInspectionsheetmst;
import org.nl.wms.quality_manage.service.report.dto.SheetQuery;
import org.nl.wms.storage_manage.rawmanage.service.iostorInv.IStIvtIostorinvYlService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
@@ -36,6 +37,7 @@ public class QlTestInspectionsheetmstController {
@Autowired
private IQlTestInspectionsheetdtlService inspectionsheetdtlService;
@PostMapping
@Log("新增质检单")
//("新增质检单")
@@ -89,11 +91,8 @@ public class QlTestInspectionsheetmstController {
@Log("确认质检单")
//("确认质检单")
public ResponseEntity<Object> confirm(@RequestBody QlTestInspectionsheetmst mst) {
mst.setBill_status(TCEnum.BILL_STATUS.code("完成"));
mst.setConfirm_optid(SecurityUtils.getCurrentUserId());
mst.setConfirm_optname(SecurityUtils.getCurrentNickName());
mst.setConfirm_time(DateUtil.now());
inspectionsheetmstService.updateById(mst);
inspectionsheetmstService.confirm(mst);
return new ResponseEntity<>(HttpStatus.OK);
}
}

View File

@@ -18,7 +18,7 @@ public enum TCEnum {
//出入库类型
RESULT_TYPE(MapOf.of("合格", "1", "不合格", "2","紧急放行","3")),
//生成方式
CREATE_MODE(MapOf.of("PC生成", "1", "终端生成", "2","外部借口产生","3")),
CREATE_MODE(MapOf.of("PC生成", "01", "终端生成", "02","外部借口产生","03")),
//是否
GRADE_TYPE(MapOf.of("一级", "1", "二级", "2", "三级", "3")),
//单据状态

View File

@@ -24,6 +24,8 @@ public interface IQlTestInspectionsheetmstService extends IService<QlTestInspect
void update(JSONObject jo);
void confirm(QlTestInspectionsheetmst jo);
Object pageQuery(SheetQuery query, PageQuery page);
JSONObject getResult(JSONObject whereJson);

View File

@@ -158,12 +158,12 @@ public class QlTestInspectionsheetmst implements Serializable {
/**
* 修改人
*/
private String update_optid;
private String update_id;
/**
* 修改人姓名
*/
private String update_optname;
private String update_name;
/**
* 修改时间
@@ -173,12 +173,12 @@ public class QlTestInspectionsheetmst implements Serializable {
/**
* 确认人
*/
private String confirm_optid;
private String confirm_id;
/**
* 确认人姓名
*/
private String confirm_optname;
private String confirm_name;
/**
* 确认时间
@@ -208,7 +208,7 @@ public class QlTestInspectionsheetmst implements Serializable {
/**
* 车间标识
*/
private String workshop_id;
private String product_area;
}

View File

@@ -27,8 +27,13 @@ import org.nl.wms.quality_manage.service.report.dao.mapper.QlTestInspectionsheet
import org.nl.wms.quality_manage.service.report.IQlTestInspectionsheetmstService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.nl.wms.quality_manage.service.report.dto.SheetQuery;
import org.nl.wms.storage_manage.IOSEnum;
import org.nl.wms.storage_manage.IVTEnum;
import org.nl.wms.storage_manage.rawmanage.service.iostorInv.IStIvtIostorinvYlService;
import org.nl.wms.storage_manage.rawmanage.service.iostorInv.dao.StIvtIostorinvYl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
@@ -49,7 +54,11 @@ public class QlTestInspectionsheetmstServiceImpl extends ServiceImpl<QlTestInspe
@Autowired
private IMdMeMaterialbaseService meMaterialbaseService;
@Autowired
private IStIvtIostorinvYlService iostorinvYlService;
@Override
@Transactional
public void create(JSONObject jo) {
// 调用主表 插入/更新方法
QlTestInspectionsheetmst mst = packageMstForm(new QlTestInspectionsheetmst(), jo);
@@ -60,11 +69,12 @@ public class QlTestInspectionsheetmstServiceImpl extends ServiceImpl<QlTestInspe
}
@Override
@Transactional
public void update(JSONObject form) {
Assert.notNull(form.get("inspection_id"), "请求参数不能为空");
QlTestInspectionsheetmst mst = form.toJavaObject(QlTestInspectionsheetmst.class);
mst.setUpdate_optid(SecurityUtils.getCurrentUserId());
mst.setUpdate_optname(SecurityUtils.getCurrentNickName());
mst.setUpdate_id(SecurityUtils.getCurrentUserId());
mst.setUpdate_name(SecurityUtils.getCurrentNickName());
mst.setUpdate_time(DateUtil.now());
this.updateById(mst);
@@ -72,6 +82,66 @@ public class QlTestInspectionsheetmstServiceImpl extends ServiceImpl<QlTestInspe
inspectionsheetdtlService.create(mst);
}
@Override
@Transactional
public void confirm(QlTestInspectionsheetmst mst) {
//生成原材料入库单据
String now = DateUtil.now();
mst.setBill_status(TCEnum.BILL_STATUS.code("完成"));
mst.setConfirm_id(SecurityUtils.getCurrentUserId());
mst.setConfirm_name(SecurityUtils.getCurrentNickName());
mst.setConfirm_time(now);
this.updateById(mst);
JSONArray tableData = new JSONArray();
{
JSONObject item = new JSONObject();
item.put("agree_time", DateUtil.today());
item.put("syscompanyid", "111");
item.put("sysdeptid", "111");
item.put("audit_id", SecurityUtils.getCurrentUserId());
item.put("audit_time", now);
item.put("need_qty", mst.getQty());
item.put("create_id", SecurityUtils.getCurrentUserId());
item.put("create_time", now);
item.put("create_name", SecurityUtils.getCurrentUsername());
item.put("create_mode", TCEnum.CREATE_MODE.code("PC生成"));
item.put("purchase_time", now);
item.put("purchase_id", SecurityUtils.getCurrentUserId());
item.put("purchase_name", SecurityUtils.getCurrentUsername());
item.put("qty_unit_name", "KG");
item.put("qty_unit_id", "1");
item.put("sect_id", "1528631043903590400");
item.put("struct_id", "1528636861080276992");
item.put("source_bill_code", mst.getInspection_code());
item.put("po_code", mst.getInspection_code());
item.put("source_bill_type_name", "质检单");
item.put("total_qty", 0);
item.put("safe_qty", 0);
item.put("instor_qty", 0);
item.put("plan_qty", mst.getQty());
item.put("is_delete", false);
item.put("workshop_id", mst.getProduct_area());
item.put("material_id", mst.getMaterial_id());
item.put("status", mst.getProduct_area());
item.put("ivt_level", IVTEnum.IVT_LEVEL.code("一级"));
item.put("quality_scode", IVTEnum.QUALITY_SCODE.code("合格品"));
item.put("is_active", "1");
tableData.add(item);
}
JSONObject ylmst = new JSONObject();
// 新增
ylmst.put("bill_status",IOSEnum.BILL_STATUS.code("生成"));
ylmst.put("total_qty",mst.getQty());
ylmst.put("detail_count",1);
ylmst.put("stor_id",IOSEnum.STOR_CODE.code("原材料仓"));
ylmst.put("bill_type",IOSEnum.BILL_TYPE.code("手工入库"));
ylmst.put("buss_type",IOSEnum.BILL_TYPE.code("手工入库"));
ylmst.put("biz_date",DateUtil.today());
ylmst.put("tableData",tableData);
iostorinvYlService.create(ylmst);
}
@Override
public Object pageQuery(SheetQuery query, PageQuery pageQuery) {
Page<Object> page = PageHelper.startPage(pageQuery.getPage() + 1, pageQuery.getSize());
@@ -88,6 +158,7 @@ public class QlTestInspectionsheetmstServiceImpl extends ServiceImpl<QlTestInspe
mst.setBiz_date(DateUtil.today());
mst.setMaterial_id(whereJson.getString("material_id"));
mst.setPcsn(DateUtil.today());
mst.setQty(whereJson.getBigDecimal("qty"));
mst.setQty_unit_id(whereJson.getString("qty_unit_id"));
mst.setQty_unit_name(whereJson.getString("qty_unit_name"));
mst.setSource_bill_id(whereJson.getString("source_bill_id"));
@@ -106,8 +177,8 @@ public class QlTestInspectionsheetmstServiceImpl extends ServiceImpl<QlTestInspe
@Override
public void saveResult(JSONObject whereJson) {
QlTestInspectionsheetmst mst = whereJson.toJavaObject(QlTestInspectionsheetmst.class);
mst.setUpdate_optid(SecurityUtils.getCurrentUserId());
mst.setUpdate_optname(SecurityUtils.getCurrentNickName());
mst.setUpdate_id(SecurityUtils.getCurrentUserId());
mst.setUpdate_name(SecurityUtils.getCurrentNickName());
mst.setUpdate_time(DateUtil.now());
mst.setBill_status(TCEnum.BILL_STATUS.code("确认"));
this.updateById(mst);

View File

@@ -32,5 +32,32 @@ INSERT INTO `hl_one_mes`.`sys_dict`(`dict_id`, `code`, `name`, `label`, `value`,
INSERT INTO `hl_one_mes`.`sys_dict`(`dict_id`, `code`, `name`, `label`, `value`, `dict_sort`, `dict_type`, `para1`, `para2`, `para3`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('1701563798009286656', 'ST_INV_BCP_IN_OUT_TYPE', '半成品出入库类型', '出库', '1', 1, NULL, NULL, NULL, NULL, '1694303357524643840', '管理员', '2023-09-12 19:49:57', '1694303357524643840', '管理员', '2023-09-12 19:49:57');
INSERT INTO `hl_one_mes`.`sys_dict`(`dict_id`, `code`, `name`, `label`, `value`, `dict_sort`, `dict_type`, `para1`, `para2`, `para3`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('1701558260970164224', 'ST_INV_BCP_IN_OUT_TYPE', '半成品出入库类型', '入库', '0', 0, NULL, NULL, NULL, NULL, '1694303357524643840', '管理员', '2023-09-12 19:27:57', '1694303357524643840', '管理员', '2023-09-12 19:27:57');
-- ql_test_inspectionsheetmst表更新
-- 质检相关
INSERT INTO `hl_one_mes`.`sys_code_rule`(`id`, `code`, `name`, `current_value`, `remark`, `is_active`, `is_delete`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('c9674fd7ef1e4511111b32a05ba511cd', 'F_CODE', '移库单编码', NULL, NULL, '1', '0', 0, NULL, '2022-01-06 08:51:50', NULL, NULL, NULL);
INSERT INTO `hl_one_mes`.`sys_code_rule_detail`(`id`, `type`, `init_value`, `current_value`, `max_value`, `step`, `fillchar`, `format`, `length`, `sort_num`, `remark`, `code_rule_id`, `is_active`, `is_delete`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('af1de297e11111159f74b7dc1c462c67', '02', '20230912', '20230912', '', '', '', 'yyyyMMdd', NULL, 2, '', 'c9674fd7ef1e4511111b32a05ba511cd', '1', '0', 0, '', '2022-01-06 08:55:31', 0, '', '');
INSERT INTO `hl_one_mes`.`sys_code_rule_detail`(`id`, `type`, `init_value`, `current_value`, `max_value`, `step`, `fillchar`, `format`, `length`, `sort_num`, `remark`, `code_rule_id`, `is_active`, `is_delete`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('bbadbd46d11111191213d35c7f99c5f', '01', 'F', 'F', '', '', '', '', NULL, 1, '', 'c9674fd7ef1e4511111b32a05ba511cd', '1', '0', 0, '', '2022-01-06 08:54:58', 0, '', '2022-01-06 08:55:25');
INSERT INTO `hl_one_mes`.`sys_code_rule_detail`(`id`, `type`, `init_value`, `current_value`, `max_value`, `step`, `fillchar`, `format`, `length`, `sort_num`, `remark`, `code_rule_id`, `is_active`, `is_delete`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('eb7f7e7bf3754f1111110b202def07b9', '03', '0', '19', '999', '1', '0', '', 3, 3, '', 'c9674fd7ef1e4511111b32a05ba511cd', '1', '0', 0, '', '2022-01-06 08:56:01', 0, '', '');
INSERT INTO `sys_dict`(`dict_id`, `code`, `name`, `label`, `value`, `dict_sort`, `dict_type`, `para1`, `para2`, `para3`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('1670995728920612864', 'QL_TEST_POINTTYPE', '项点类别', '质保项', '01', 10, NULL, NULL, NULL, NULL, '1', '管理员', '2023-06-20 11:23:22', '1', '管理员', '2023-06-20 11:23:22');
INSERT INTO `sys_dict`(`dict_id`, `code`, `name`, `label`, `value`, `dict_sort`, `dict_type`, `para1`, `para2`, `para3`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('1670995948370792448', 'QL_TEST_POINTTYPE', '项点类别', '自检项', '02', 20, NULL, NULL, NULL, NULL, '1', '管理员', '2023-06-20 11:24:14', '1', '管理员', '2023-06-20 11:24:14');
INSERT INTO `sys_dict`(`dict_id`, `code`, `name`, `label`, `value`, `dict_sort`, `dict_type`, `para1`, `para2`, `para3`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('1670996008391282688', 'QL_TEST_POINTTYPE', '项点类别', '检验项', '03', 30, NULL, NULL, NULL, NULL, '1', '管理员', '2023-06-20 11:24:28', '1', '管理员', '2023-06-20 11:24:28');
INSERT INTO `sys_dict`(`dict_id`, `code`, `name`, `label`, `value`, `dict_sort`, `dict_type`, `para1`, `para2`, `para3`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('1670996155804291072', 'QC_INSPECTION_TYPE', '检验方式', '定性', '01', 10, NULL, NULL, NULL, NULL, '1', '管理员', '2023-06-20 11:25:03', '1', '管理员', '2023-06-20 11:25:03');
INSERT INTO `sys_dict`(`dict_id`, `code`, `name`, `label`, `value`, `dict_sort`, `dict_type`, `para1`, `para2`, `para3`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('1670996281528553472', 'QC_INSPECTION_TYPE', '检验方式', '定量', '02', 20, NULL, NULL, NULL, NULL, '1', '管理员', '2023-06-20 11:25:33', '1', '管理员', '2023-06-20 11:25:33');
INSERT INTO `sys_dict`(`dict_id`, `code`, `name`, `label`, `value`, `dict_sort`, `dict_type`, `para1`, `para2`, `para3`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('1671347090304929792', 'QC_INSPECTION_SCHEME_TYPE', '方案类别', '原料', '01', 10, NULL, NULL, NULL, NULL, '1', '管理员', '2023-06-21 10:39:33', '1', '管理员', '2023-06-21 10:39:33');
INSERT INTO `sys_dict`(`dict_id`, `code`, `name`, `label`, `value`, `dict_sort`, `dict_type`, `para1`, `para2`, `para3`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('1671347233536217088', 'QC_INSPECTION_SCHEME_TYPE', '方案类别', '半成品', '02', 20, NULL, NULL, NULL, NULL, '1', '管理员', '2023-06-21 10:40:07', '1', '管理员', '2023-06-21 10:40:21');
INSERT INTO `sys_dict`(`dict_id`, `code`, `name`, `label`, `value`, `dict_sort`, `dict_type`, `para1`, `para2`, `para3`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('1671347339761160192', 'QC_INSPECTION_SCHEME_TYPE', '方案类别', '成品', '03', 30, NULL, NULL, NULL, NULL, '1', '管理员', '2023-06-21 10:40:32', '1', '管理员', '2023-06-21 10:40:32');
INSERT INTO `sys_dict`(`dict_id`, `code`, `name`, `label`, `value`, `dict_sort`, `dict_type`, `para1`, `para2`, `para3`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('1672926997413761024', 'QC_BILL_STATUS', '检测单单据状态', '生成', '10', 1, NULL, NULL, NULL, NULL, '1', '管理员', '2023-06-25 19:17:32', '1', '管理员', '2023-06-25 19:17:32');
INSERT INTO `sys_dict`(`dict_id`, `code`, `name`, `label`, `value`, `dict_sort`, `dict_type`, `para1`, `para2`, `para3`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('1672927171125055488', 'QC_BILL_STATUS', '检测单单据状态', '提交', '20', 2, NULL, NULL, NULL, NULL, '1', '管理员', '2023-06-25 19:18:13', '1', '管理员', '2023-06-25 19:18:13');
INSERT INTO `sys_dict`(`dict_id`, `code`, `name`, `label`, `value`, `dict_sort`, `dict_type`, `para1`, `para2`, `para3`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('1672927218428416000', 'QC_BILL_STATUS', '检测单单据状态', '检测中', '30', 3, NULL, NULL, NULL, NULL, '1', '管理员', '2023-06-25 19:18:25', '1', '管理员', '2023-06-25 19:18:25');
INSERT INTO `sys_dict`(`dict_id`, `code`, `name`, `label`, `value`, `dict_sort`, `dict_type`, `para1`, `para2`, `para3`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('1672927268667789312', 'QC_BILL_STATUS', '检测单单据状态', '确认', '50', 4, NULL, NULL, NULL, NULL, '1', '管理员', '2023-06-25 19:18:37', '1', '管理员', '2023-06-25 19:18:37');
INSERT INTO `sys_dict`(`dict_id`, `code`, `name`, `label`, `value`, `dict_sort`, `dict_type`, `para1`, `para2`, `para3`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('1672927310661160960', 'QC_BILL_STATUS', '检测单单据状态', '完成', '99', 5, NULL, NULL, NULL, NULL, '1', '管理员', '2023-06-25 19:18:47', '1', '管理员', '2023-06-25 19:18:47');
INSERT INTO `sys_dict`(`dict_id`, `code`, `name`, `label`, `value`, `dict_sort`, `dict_type`, `para1`, `para2`, `para3`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('1672928867851046912', 'qc_result', '检测结果', '合格', '1', 1, NULL, NULL, NULL, NULL, '1', '管理员', '2023-06-25 19:24:58', '1', '管理员', '2023-06-25 19:24:58');
INSERT INTO `sys_dict`(`dict_id`, `code`, `name`, `label`, `value`, `dict_sort`, `dict_type`, `para1`, `para2`, `para3`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('1672929052471726080', 'qc_result', '检测结果', '不合格', '2', 2, NULL, NULL, NULL, NULL, '1', '管理员', '2023-06-25 19:25:42', '1', '管理员', '2023-06-25 19:25:42');
INSERT INTO `sys_dict`(`dict_id`, `code`, `name`, `label`, `value`, `dict_sort`, `dict_type`, `para1`, `para2`, `para3`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('1672929090488897536', 'qc_result', '检测结果', '紧急放行', '3', 3, NULL, NULL, NULL, NULL, '1', '管理员', '2023-06-25 19:25:51', '1', '管理员', '2023-06-25 19:25:51');
INSERT INTO `sys_dict`(`dict_id`, `code`, `name`, `label`, `value`, `dict_sort`, `dict_type`, `para1`, `para2`, `para3`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('1672939722785296384', 'qc_grade', '质检等级', '一级', '1', 1, NULL, NULL, NULL, NULL, '1', '管理员', '2023-06-25 20:08:06', '1', '管理员', '2023-06-25 20:08:31');
INSERT INTO `sys_dict`(`dict_id`, `code`, `name`, `label`, `value`, `dict_sort`, `dict_type`, `para1`, `para2`, `para3`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('1672939937948897280', 'qc_grade', '质检等级', '二级', '2', 2, NULL, NULL, NULL, NULL, '1', '管理员', '2023-06-25 20:08:57', '1', '管理员', '2023-06-25 20:08:57');
INSERT INTO `sys_dict`(`dict_id`, `code`, `name`, `label`, `value`, `dict_sort`, `dict_type`, `para1`, `para2`, `para3`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('1672939964830191616', 'qc_grade', '质检等级', '三级', '3', 3, NULL, NULL, NULL, NULL, '1', '管理员', '2023-06-25 20:09:04', '1', '管理员', '2023-06-25 20:09:04');