Merge remote-tracking branch 'origin/master'

master
Yangwl 10 months ago
commit 442fb1831f

@ -1,11 +0,0 @@
#for test only!
#Fri Feb 02 11:11:00 CST 2024
jco.destination.pool_capacity=true
jco.client.lang=zh
jco.client.ashost=192.168.0.130
jco.client.saprouter=
jco.client.user=MES
jco.client.sysnr=0
jco.destination.peak_limit=20
jco.client.passwd=123456
jco.client.client=800

@ -73,6 +73,185 @@ Caused by: java.lang.NullPointerException
... 63 more
**** Error file opened at 20240111 164451 China Standard Time Rel 3.0.8 (2011-11-28) [721.913]
Error: >Thu Jan 11 16:44:51,560< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 16:44:55,319< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 16:49:04,522< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 16:49:08,215< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 16:50:08,396< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 16:50:12,521< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 16:52:25,915< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 16:52:29,518< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 16:54:16,079< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 16:54:19,679< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 16:54:22,525< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 16:54:26,108< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 16:55:32,052< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 16:55:35,705< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 16:56:23,406< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 16:56:27,066< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 16:59:45,369< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 16:59:49,619< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 17:00:18,266< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 17:00:28,280< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 17:05:06,677< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 17:07:27,288< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 17:09:50,015< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 17:11:35,473< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 17:11:53,389< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 17:13:32,715< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 17:13:53,701< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 17:14:44,332< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 17:15:58,852< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 17:18:02,274< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 17:18:50,315< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 17:20:44,293< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 17:25:11,895< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 17:34:46,104< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 17:35:39,742< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 17:36:24,165< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 17:38:10,872< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 17:41:09,642< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 17:41:59,356< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 17:42:51,751< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 17:45:34,021< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 17:46:14,888< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 17:47:26,853< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 17:50:17,775< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 17:53:12,231< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 17:54:03,321< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 17:56:27,055< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 17:57:53,784< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 17:58:20,978< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 17:59:33,781< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 18:00:54,567< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 18:01:36,649< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 18:01:48,844< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 18:02:31,503< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 18:03:26,898< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 18:04:24,525< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 18:05:48,654< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 18:07:20,674< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Thu Jan 11 18:08:23,214< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
**** Error file opened at 20231214 151538 China Standard Time Rel 3.0.8 (2011-11-28) [721.619]
Error: >Thu Dec 14 15:15:38,905< >RfcGetException rc (7) message: Invalid value in OPTION field of value table for IN itab operator. operator.
<RfcGetException
@ -325,3 +504,54 @@ COUNTER 2
Error: >Thu Jan 25 18:04:22,996< >RfcGetException rc (7) message: ## 600 ########
<RfcGetException
**** Error file opened at 20240228 095123 China Standard Time Rel 3.0.8 (2011-11-28) [721.913]
Error: >Wed Feb 28 09:51:23,384< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
**** Error file opened at 20240228 095524 China Standard Time Rel 3.0.8 (2011-11-28) [721.913]
Error: >Wed Feb 28 09:55:24,676< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
Error: >Wed Feb 28 09:56:02,286< >RfcGetException rc (7) message: ## 800 ########
<RfcGetException
**** Error file opened at 20240311 161617 China Standard Time Rel 3.0.8 (2011-11-28) [721.913]
Error: >Mon Mar 11 16:16:17,464< >RfcGetException rc (3) message: CPIC-CALL: CMRCV on convId: 17090475
ERROR connection to partner '192.168.0.54:3300' broken
TIME Mon Mar 11 16:16:17 2024
RELEASE 721
COMPONENT NI (network interface)
VERSION 40
RC -6
MODULE nixxi.cpp
LINE 4851
DETAIL NiIRead: P=192.168.0.54:3300; L=2.0.0.1:62053
SYSTEM CALL recv
COUNTER 3
<RfcGetException
Error: [1] >Mon Mar 11 16:16:17,467< RfcException: [QAS|erpqos]
message: CPIC-CALL: CMRCV on convId: 17090475
ERROR connection to partner '192.168.0.54:3300' broken
TIME Mon Mar 11 16:16:17 2024
RELEASE 721
COMPONENT NI (network interface)
VERSION 40
RC -6
MODULE nixxi.cpp
LINE 4851
DETAIL NiIRead: P=192.168.0.54:3300; L=2.0.0.1:62053
SYSTEM CALL recv
COUNTER 3
Return code: RFC_SYS_EXCEPTION(3)
error group: 102
key: RFC_ERROR_COMMUNICATION
Exception raised by QAS|erpqos

@ -106,6 +106,15 @@ public class SysUser extends BaseEntity {
//新增 微信账号
private String wxId;
private String userMType;
public String getUserMType() {
return userMType;
}
public void setUserMType(String userMType) {
this.userMType = userMType;
}
public String getWxId() {
return wxId;

@ -12,11 +12,11 @@ spring:
cloud:
nacos:
discovery:
# username: nacos
# password: sfnacos2023
# username: nacos
# password: sfnacos2023
# 服务注册地址
#--spring.cloud.nacos.discovery.namespace=chj --spring.cloud.nacos.config.namespace=chj
# namespace: lanju-op-test
# namespace: lanju-op-test
namespace: lanju-op-test
group: test
# 服务注册地址

@ -13,8 +13,8 @@ spring:
cloud:
nacos:
discovery:
# username: nacos
# password: sfnacos2023
# username: nacos
# password: sfnacos2023
namespace: lanju-op-test
group: test
# 服务注册地址

@ -104,13 +104,13 @@ public class EquEquipment extends BaseEntity {
* 3
*/
@Excel(name = "预留字段3")
private Long attr3;
private String attr3;
/**
* 4
*/
@Excel(name = "预留字段4")
private Long attr4;
private String attr4;
/**
*
@ -394,19 +394,19 @@ public class EquEquipment extends BaseEntity {
return attr2;
}
public void setAttr3(Long attr3) {
public void setAttr3(String attr3) {
this.attr3 = attr3;
}
public Long getAttr3() {
public String getAttr3() {
return attr3;
}
public void setAttr4(Long attr4) {
public void setAttr4(String attr4) {
this.attr4 = attr4;
}
public Long getAttr4() {
public String getAttr4() {
return attr4;
}

@ -96,13 +96,13 @@ public class Equipment extends BaseEntity {
* 3
*/
@Excel(name = "预留字段3")
private Long attr3;
private String attr3;
/**
* 4
*/
@Excel(name = "预留字段4")
private Long attr4;
private String attr4;
/**
*
@ -347,19 +347,19 @@ public class Equipment extends BaseEntity {
return attr2;
}
public void setAttr3(Long attr3) {
public void setAttr3(String attr3) {
this.attr3 = attr3;
}
public Long getAttr3() {
public String getAttr3() {
return attr3;
}
public void setAttr4(Long attr4) {
public void setAttr4(String attr4) {
this.attr4 = attr4;
}
public Long getAttr4() {
public String getAttr4() {
return attr4;
}

@ -13,11 +13,13 @@ spring:
cloud:
nacos:
discovery:
#命名空间
namespace: lanju-op-test
group: test
# 服务注册地址
server-addr: 192.168.202.20:8848
config:
#命名空间
namespace: lanju-op-test
group: test
# 服务注册地址

@ -13,11 +13,13 @@ spring:
cloud:
nacos:
discovery:
#命名空间
namespace: lanju-op-test
group: test
# 服务注册地址
server-addr: 192.168.202.20:8848
config:
#命名空间
namespace: lanju-op-test
group: test
# 服务注册地址

@ -12,13 +12,13 @@ spring:
cloud:
nacos:
discovery:
# 服务注册地址
#命名空间
namespace: lanju-op-test
group: test
# 服务注册地址
server-addr: 192.168.202.20:8848
config:
# 配置中心地址
#命名空间
namespace: lanju-op-test
group: test
# 服务注册地址

@ -13,17 +13,16 @@ spring:
cloud:
nacos:
discovery:
namespace: lanju-op-test
group: test
namespace: lanju-op
group: zxl
# 服务注册地址
server-addr: 192.168.202.20:8848
server-addr: 175.27.215.92:8848
config:
#命名空间
namespace: lanju-op-test
group: test
namespace: lanju-op
group: zxl
# 服务注册地址
# server-addr: 192.168.202.20:8848
server-addr: 192.168.202.20:8848
server-addr: 175.27.215.92:8848
# 配置文件格式
file-extension: yml
# 共享配置

@ -13,11 +13,13 @@ spring:
cloud:
nacos:
discovery:
#命名空间
namespace: lanju-op-test
group: test
# 服务注册地址
server-addr: 192.168.202.20:8848
config:
#命名空间
namespace: lanju-op-test
group: test
# 服务注册地址

@ -1,8 +1,13 @@
package com.op.mes.controller;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import com.op.common.core.domain.ExcelCol;
import com.op.common.core.utils.poi.ExcelMapUtil;
import com.op.common.core.utils.poi.ExcelUtil;
import com.op.common.core.web.controller.BaseController;
import com.op.common.core.web.domain.AjaxResult;
@ -12,6 +17,7 @@ import com.op.common.security.annotation.RequiresPermissions;
import com.op.mes.domain.BaseProductAttached;
import com.op.mes.service.IBaseProductAttachedService;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -22,6 +28,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.op.common.log.annotation.Log;
import org.springframework.web.multipart.MultipartFile;
/**
* Controller
@ -83,7 +90,12 @@ public class BaseProductAttachedController extends BaseController
@PostMapping
public AjaxResult add(@RequestBody BaseProductAttached baseProductAttached)
{
return toAjax(baseProductAttachedService.insertBaseProductAttached(baseProductAttached));
if (baseProductAttachedService.checkSpareCodeUnique(baseProductAttached)) {
return AjaxResult.error("备品备件编码已存在!");
} else {
return toAjax(baseProductAttachedService.insertBaseProductAttached(baseProductAttached));
}
}
/**
@ -109,4 +121,82 @@ public class BaseProductAttachedController extends BaseController
{
return toAjax(baseProductAttachedService.deleteBaseProductAttachedByIds(ids));
}
/**
*
*
* @param response
* @throws IOException
*/
@PostMapping("/importTemplate")
@Log(title = "生成备品备件信息模板", businessType = BusinessType.EXPORT)
public void importTemplate(HttpServletResponse response) throws IOException {
ArrayList<ExcelCol> excelCols = new ArrayList<>();
excelCols.add(new ExcelCol("产品编号", "productCode", 20));
excelCols.add(new ExcelCol("品类", "category", 20));
excelCols.add(new ExcelCol("每PC单圈", "pc", 20));
excelCols.add(new ExcelCol("标准效率", "iei", 20));
excelCols.add(new ExcelCol("标准用人", "manStandar", 20));
excelCols.add(new ExcelCol("喷药方式", "sprayWay", 20));
excelCols.add(new ExcelCol("白坯直径", "blankDiameter", 20));
excelCols.add(new ExcelCol("白坯物料号", "blankNo", 20));
excelCols.add(new ExcelCol("标准喷药量", "sprayVolume", 20));
excelCols.add(new ExcelCol("药液料号", "liquidNo", 20));
excelCols.add(new ExcelCol("标准内膜用量", "endometrialDosage", 20));
excelCols.add(new ExcelCol("标准外模用量(KG/PC)", "outerFilmDosage", 20));
excelCols.add(new ExcelCol("支架", "support", 20));
excelCols.add(new ExcelCol("支架物料号", "supportNo", 20));
excelCols.add(new ExcelCol("吸塑", "pvc", 20));
excelCols.add(new ExcelCol("支架盘", "supportPlate", 20));
excelCols.add(new ExcelCol("创建人", "createBy", 20));
excelCols.add(new ExcelCol("库检周期", "warehouseCycle", 20));
excelCols.add(new ExcelCol("托盘上箱数", "palletNum", 20));
excelCols.add(new ExcelCol("垛形", "packType", 20));
String titleName = "物料附属信息导入";
SXSSFWorkbook workbook = null;
try {
//设置响应头
response.setHeader("Content-disposition",
"attachment; filename=" + titleName);
response.setContentType("application/octet-stream;charset=UTF-8");
ServletOutputStream outputStream = response.getOutputStream();
//调用工具类
workbook = ExcelMapUtil.initWorkbook(titleName, null, excelCols, null);
workbook.write(outputStream);
} catch (Exception e) {
e.printStackTrace();
} finally {
if (workbook != null) {
workbook.dispose();
}
}
}
/**
*
*
* @param file
* @return
* @throws Exception
*/
@Log(title = "导入物料基本信息", businessType = BusinessType.IMPORT)
@PostMapping("/importFile")
@RequiresPermissions("mes:attached:import")
public AjaxResult importFile(MultipartFile file) throws Exception {
// 创建接收对象
ExcelUtil<BaseProductAttached> util = new ExcelUtil<>(BaseProductAttached.class);
// 接收表格信息
List<BaseProductAttached> orderList = util.importExcel(file.getInputStream());
return baseProductAttachedService.importFile(orderList);
}
}

@ -0,0 +1,117 @@
package com.op.mes.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.security.utils.SecurityUtils;
import com.op.system.api.domain.SysDictType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.op.common.log.annotation.Log;
import com.op.common.log.enums.BusinessType;
import com.op.common.security.annotation.RequiresPermissions;
import com.op.mes.domain.MesBox;
import com.op.mes.service.IMesBoxService;
import com.op.common.core.web.controller.BaseController;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.core.utils.poi.ExcelUtil;
import com.op.common.core.web.page.TableDataInfo;
/**
* Controller
*
* @author Open Platform
* @date 2024-08-20
*/
@RestController
@RequestMapping("/mesBox")
public class MesBoxController extends BaseController {
@Autowired
private IMesBoxService mesBoxService;
/**
*
*/
@RequiresPermissions("mes:mesBox:list")
@GetMapping("/list")
public TableDataInfo list(MesBox mesBox) {
startPage();
List<MesBox> list = mesBoxService.selectMesBoxList(mesBox);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("mes:mesBox:export")
@Log(title = "箱体类型", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, MesBox mesBox) {
List<MesBox> list = mesBoxService.selectMesBoxList(mesBox);
ExcelUtil<MesBox> util = new ExcelUtil<MesBox>(MesBox.class);
util.exportExcel(response, list, "箱体类型数据");
}
/**
*
*/
@RequiresPermissions("mes:mesBox:query")
@GetMapping(value = "/{boxId}")
public AjaxResult getInfo(@PathVariable("boxId") Long boxId) {
return success(mesBoxService.selectMesBoxByBoxId(boxId));
}
/**
*
*/
@RequiresPermissions("mes:mesBox:add")
@Log(title = "箱体类型", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MesBox mesBox) {
if (!mesBoxService.checkBoxTypeUnique(mesBox)) {
return error("新增箱型'" + mesBox.getBoxName() + "'失败,箱体类型已存在");
}
return toAjax(mesBoxService.insertMesBox(mesBox));
}
/**
*
*/
@RequiresPermissions("mes:mesBox:edit")
@Log(title = "箱体类型", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MesBox mesBox) {
if (!mesBoxService.checkBoxTypeUnique(mesBox)) {
return error("修改箱型'" + mesBox.getBoxName() + "'失败,箱体类型已存在");
}
return toAjax(mesBoxService.updateMesBox(mesBox));
}
/**
*
*/
@RequiresPermissions("mes:mesBox:remove")
@Log(title = "箱体类型", businessType = BusinessType.DELETE)
@DeleteMapping("/{boxIds}")
public AjaxResult remove(@PathVariable Long[] boxIds) {
return toAjax(mesBoxService.deleteMesBoxByBoxIds(boxIds));
}
/**
*
*/
@GetMapping("/optionSelect")
@DS("#header.poolName")
public AjaxResult optionSelect() {
List<MesBox> boxTypes = mesBoxService.selectDictTypeAll();
return success(boxTypes);
}
}

@ -0,0 +1,115 @@
package com.op.mes.controller;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.StringUtils;
import com.op.system.api.domain.SysDictData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.op.common.log.annotation.Log;
import com.op.common.log.enums.BusinessType;
import com.op.common.security.annotation.RequiresPermissions;
import com.op.mes.domain.MesBoxDetail;
import com.op.mes.service.IMesBoxDetailService;
import com.op.common.core.web.controller.BaseController;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.core.utils.poi.ExcelUtil;
import com.op.common.core.web.page.TableDataInfo;
/**
* Controller
*
* @author Open Platform
* @date 2024-08-20
*/
@RestController
@RequestMapping("/mesBoxDetail")
public class MesBoxDetailController extends BaseController {
@Autowired
private IMesBoxDetailService mesBoxDetailService;
/**
*
*/
@RequiresPermissions("mes:mesBoxDetail:list")
@GetMapping("/list")
public TableDataInfo list(MesBoxDetail mesBoxDetail) {
startPage();
List<MesBoxDetail> list = mesBoxDetailService.selectMesBoxDetailList(mesBoxDetail);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("mes:mesBoxDetail:export")
@Log(title = "箱体数据", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, MesBoxDetail mesBoxDetail) {
List<MesBoxDetail> list = mesBoxDetailService.selectMesBoxDetailList(mesBoxDetail);
ExcelUtil<MesBoxDetail> util = new ExcelUtil<MesBoxDetail>(MesBoxDetail. class);
util.exportExcel(response, list, "箱体数据数据");
}
/**
*
*/
@RequiresPermissions("mes:mesBoxDetail:query")
@GetMapping(value = "/{boxCode}")
public AjaxResult getInfo(@PathVariable("boxCode") Long boxCode) {
return success(mesBoxDetailService.selectMesBoxDetailByBoxCode(boxCode));
}
/**
*
*/
@GetMapping(value = "/type/{boxType}")
@DS("#header.poolName")
public AjaxResult dictType(@PathVariable String boxType) {
List<SysDictData> data = mesBoxDetailService.selectBoxDataByType(boxType);
if (StringUtils.isNull(data)) {
data = new ArrayList<SysDictData>();
}
return success(data);
}
/**
*
*/
@RequiresPermissions("mes:mesBoxDetail:add")
@Log(title = "箱体数据", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MesBoxDetail mesBoxDetail) {
return toAjax(mesBoxDetailService.insertMesBoxDetail(mesBoxDetail));
}
/**
*
*/
@RequiresPermissions("mes:mesBoxDetail:edit")
@Log(title = "箱体数据", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MesBoxDetail mesBoxDetail) {
return toAjax(mesBoxDetailService.updateMesBoxDetail(mesBoxDetail));
}
/**
*
*/
@RequiresPermissions("mes:mesBoxDetail:remove")
@Log(title = "箱体数据", businessType = BusinessType.DELETE)
@DeleteMapping("/{boxCodes}")
public AjaxResult remove(@PathVariable Long[] boxCodes) {
return toAjax(mesBoxDetailService.deleteMesBoxDetailByBoxCodes(boxCodes));
}
}

@ -139,6 +139,7 @@ public class MesLineController extends BaseController {
excelCols.add(new ExcelCol("标准用人", "useMan", 20));
excelCols.add(new ExcelCol("标准效率", "efficiency", 20));
excelCols.add(new ExcelCol("标准工时", "attr1", 20));
excelCols.add(new ExcelCol("标准效率(PC/H)", "hourEfficiency", 20));
String titleName = "线体产品信息导入";
SXSSFWorkbook workbook = null;
try {

@ -54,7 +54,7 @@ public class BaseProductAttached extends BaseEntity
private String blankNo;
/** 标准喷药量KG/PC */
@Excel(name = "标准喷药量", readConverterExp = "K=G/PC")
@Excel(name = "标准喷药量")
private BigDecimal sprayVolume;
/** 药液料号 */
@ -62,7 +62,7 @@ public class BaseProductAttached extends BaseEntity
private String liquidNo;
/** 标准内膜用量KG/PC */
@Excel(name = "标准内膜用量", readConverterExp = "K=G/PC")
@Excel(name = "标准内膜用量")
private BigDecimal endometrialDosage;
/** 标准外模用量(KG/PC) */
@ -89,191 +89,225 @@ public class BaseProductAttached extends BaseEntity
@Excel(name = "其它")
private String other;
public void setId(String id)
{
/** 创建人 */
@Excel(name = "创建人")
private String createBy;
/** 库检周期 */
@Excel(name = "库检周期")
private String warehouseCycle;
/** 托盘上箱数 */
@Excel(name = "托盘上箱数")
private BigDecimal palletNum;
/** 垛形 */
@Excel(name = "垛形")
private String packType;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getId()
{
return id;
public String getProductCode() {
return productCode;
}
public void setProductCode(String productCode)
{
public void setProductCode(String productCode) {
this.productCode = productCode;
}
public String getProductCode()
{
return productCode;
public String getCategory() {
return category;
}
public void setCategory(String category)
{
public void setCategory(String category) {
this.category = category;
}
public String getCategory()
{
return category;
public String getPc() {
return pc;
}
public void setPc(String pc)
{
public void setPc(String pc) {
this.pc = pc;
}
public String getPc()
{
return pc;
public BigDecimal getIei() {
return iei;
}
public void setIei(BigDecimal iei)
{
public void setIei(BigDecimal iei) {
this.iei = iei;
}
public BigDecimal getIei()
{
return iei;
public BigDecimal getManStandar() {
return manStandar;
}
public void setManStandar(BigDecimal manStandar)
{
public void setManStandar(BigDecimal manStandar) {
this.manStandar = manStandar;
}
public BigDecimal getManStandar()
{
return manStandar;
public String getSprayWay() {
return sprayWay;
}
public void setSprayWay(String sprayWay)
{
public void setSprayWay(String sprayWay) {
this.sprayWay = sprayWay;
}
public String getSprayWay()
{
return sprayWay;
public BigDecimal getBlankDiameter() {
return blankDiameter;
}
public void setBlankDiameter(BigDecimal blankDiameter)
{
public void setBlankDiameter(BigDecimal blankDiameter) {
this.blankDiameter = blankDiameter;
}
public BigDecimal getBlankDiameter()
{
return blankDiameter;
public String getBlankNo() {
return blankNo;
}
public void setBlankNo(String blankNo)
{
public void setBlankNo(String blankNo) {
this.blankNo = blankNo;
}
public String getBlankNo()
{
return blankNo;
public BigDecimal getSprayVolume() {
return sprayVolume;
}
public void setSprayVolume(BigDecimal sprayVolume)
{
public void setSprayVolume(BigDecimal sprayVolume) {
this.sprayVolume = sprayVolume;
}
public BigDecimal getSprayVolume()
{
return sprayVolume;
public String getLiquidNo() {
return liquidNo;
}
public void setLiquidNo(String liquidNo)
{
public void setLiquidNo(String liquidNo) {
this.liquidNo = liquidNo;
}
public String getLiquidNo()
{
return liquidNo;
public BigDecimal getEndometrialDosage() {
return endometrialDosage;
}
public void setEndometrialDosage(BigDecimal endometrialDosage)
{
public void setEndometrialDosage(BigDecimal endometrialDosage) {
this.endometrialDosage = endometrialDosage;
}
public BigDecimal getEndometrialDosage()
{
return endometrialDosage;
public BigDecimal getOuterFilmDosage() {
return outerFilmDosage;
}
public void setOuterFilmDosage(BigDecimal outerFilmDosage)
{
public void setOuterFilmDosage(BigDecimal outerFilmDosage) {
this.outerFilmDosage = outerFilmDosage;
}
public BigDecimal getOuterFilmDosage()
{
return outerFilmDosage;
public Long getSupport() {
return support;
}
public void setSupport(Long support)
{
public void setSupport(Long support) {
this.support = support;
}
public Long getSupport()
{
return support;
public String getSupportNo() {
return supportNo;
}
public void setSupportNo(String supportNo)
{
public void setSupportNo(String supportNo) {
this.supportNo = supportNo;
}
public String getSupportNo()
{
return supportNo;
public Long getPvc() {
return pvc;
}
public void setPvc(Long pvc)
{
public void setPvc(Long pvc) {
this.pvc = pvc;
}
public Long getPvc()
{
return pvc;
public Long getSupportPlate() {
return supportPlate;
}
public void setSupportPlate(Long supportPlate)
{
public void setSupportPlate(Long supportPlate) {
this.supportPlate = supportPlate;
}
public Long getSupportPlate()
{
return supportPlate;
public String getOther() {
return other;
}
public void setOther(String other)
{
public void setOther(String other) {
this.other = other;
}
public String getOther()
{
return other;
@Override
public String getCreateBy() {
return createBy;
}
@Override
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public String getWarehouseCycle() {
return warehouseCycle;
}
public void setWarehouseCycle(String warehouseCycle) {
this.warehouseCycle = warehouseCycle;
}
public BigDecimal getPalletNum() {
return palletNum;
}
public void setPalletNum(BigDecimal palletNum) {
this.palletNum = palletNum;
}
public String getPackType() {
return packType;
}
public void setPackType(String packType) {
this.packType = packType;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("productCode", getProductCode())
.append("category", getCategory())
.append("pc", getPc())
.append("iei", getIei())
.append("manStandar", getManStandar())
.append("sprayWay", getSprayWay())
.append("blankDiameter", getBlankDiameter())
.append("blankNo", getBlankNo())
.append("sprayVolume", getSprayVolume())
.append("liquidNo", getLiquidNo())
.append("endometrialDosage", getEndometrialDosage())
.append("outerFilmDosage", getOuterFilmDosage())
.append("support", getSupport())
.append("supportNo", getSupportNo())
.append("pvc", getPvc())
.append("supportPlate", getSupportPlate())
.append("other", getOther())
.append("createBy", getCreateBy())
.toString();
return "BaseProductAttached{" +
"id='" + id + '\'' +
", productCode='" + productCode + '\'' +
", category='" + category + '\'' +
", pc='" + pc + '\'' +
", iei=" + iei +
", manStandar=" + manStandar +
", sprayWay='" + sprayWay + '\'' +
", blankDiameter=" + blankDiameter +
", blankNo='" + blankNo + '\'' +
", sprayVolume=" + sprayVolume +
", liquidNo='" + liquidNo + '\'' +
", endometrialDosage=" + endometrialDosage +
", outerFilmDosage=" + outerFilmDosage +
", support=" + support +
", supportNo='" + supportNo + '\'' +
", pvc=" + pvc +
", supportPlate=" + supportPlate +
", other='" + other + '\'' +
", createBy='" + createBy + '\'' +
", warehouseCycle='" + warehouseCycle + '\'' +
", palletNum=" + palletNum +
", packType='" + packType + '\'' +
'}';
}
}

@ -0,0 +1,75 @@
package com.op.mes.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
/**
* mes_box
*
* @author Open Platform
* @date 2024-08-20
*/
public class MesBox extends BaseEntity {
private static final long serialVersionUID=1L;
/** 字典主键 */
private Long boxId;
/** 字典名称 */
@Excel(name = "字典名称")
private String boxName;
/** 字典类型 */
@Excel(name = "字典类型")
private String boxType;
/** 状态0正常 */
@Excel(name = "状态", readConverterExp = "状态0正常")
private String status;
public void setBoxId(Long boxId){
this.boxId = boxId;
}
public Long getBoxId(){
return boxId;
}
public void setBoxName(String boxName){
this.boxName = boxName;
}
public String getBoxName(){
return boxName;
}
public void setBoxType(String boxType){
this.boxType = boxType;
}
public String getBoxType(){
return boxType;
}
public void setStatus(String status){
this.status = status;
}
public String getStatus(){
return status;
}
@Override
public String toString(){
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("boxId",getBoxId())
.append("boxName",getBoxName())
.append("boxType",getBoxType())
.append("status",getStatus())
.append("createBy",getCreateBy())
.append("createTime",getCreateTime())
.append("updateBy",getUpdateBy())
.append("updateTime",getUpdateTime())
.append("remark",getRemark())
.toString();
}
}

@ -0,0 +1,206 @@
package com.op.mes.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
import java.math.BigDecimal;
/**
* mes_box_detail
*
* @author Open Platform
* @date 2024-08-20
*/
public class MesBoxDetail extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
*
*/
private Long boxCode;
/**
*
*/
@Excel(name = "箱型排序")
private Long boxSort;
/**
*
*/
@Excel(name = "箱型标签")
private String boxLabel;
/**
*
*/
@Excel(name = "箱型关键字")
private String boxKey;
/**
*
*/
@Excel(name = "箱型值")
private BigDecimal boxValue;
/**
*
*/
@Excel(name = "箱型类型")
private String boxType;
/**
*
*/
@Excel(name = "样式属性", readConverterExp = "其=他样式扩展")
private String cssClass;
/**
*
*/
@Excel(name = "表格回显样式")
private String listClass;
/**
* Y
*/
@Excel(name = "是否默认", readConverterExp = "是否默认Y是")
private String isDefault;
/**
* 0
*/
@Excel(name = "状态", readConverterExp = "状态0正常")
private String status;
private BigDecimal length;
private BigDecimal width;
private BigDecimal height;
public void setBoxCode(Long boxCode) {
this.boxCode = boxCode;
}
public Long getBoxCode() {
return boxCode;
}
public void setBoxSort(Long boxSort) {
this.boxSort = boxSort;
}
public Long getBoxSort() {
return boxSort;
}
public void setBoxLabel(String boxLabel) {
this.boxLabel = boxLabel;
}
public String getBoxLabel() {
return boxLabel;
}
public String getBoxKey() {
return boxKey;
}
public void setBoxKey(String boxKey) {
this.boxKey = boxKey;
}
public void setBoxValue(BigDecimal boxValue) {
this.boxValue = boxValue;
}
public BigDecimal getBoxValue() {
return boxValue;
}
public void setBoxType(String boxType) {
this.boxType = boxType;
}
public String getBoxType() {
return boxType;
}
public void setCssClass(String cssClass) {
this.cssClass = cssClass;
}
public String getCssClass() {
return cssClass;
}
public void setListClass(String listClass) {
this.listClass = listClass;
}
public String getListClass() {
return listClass;
}
public void setIsDefault(String isDefault) {
this.isDefault = isDefault;
}
public String getIsDefault() {
return isDefault;
}
public void setStatus(String status) {
this.status = status;
}
public String getStatus() {
return status;
}
public BigDecimal getLength() {
return length;
}
public void setLength(BigDecimal length) {
this.length = length;
}
public BigDecimal getWidth() {
return width;
}
public void setWidth(BigDecimal width) {
this.width = width;
}
public BigDecimal getHeight() {
return height;
}
public void setHeight(BigDecimal height) {
this.height = height;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("boxCode", getBoxCode())
.append("boxSort", getBoxSort())
.append("boxLabel", getBoxLabel())
.append("boxValue", getBoxValue())
.append("boxType", getBoxType())
.append("cssClass", getCssClass())
.append("listClass", getListClass())
.append("isDefault", getIsDefault())
.append("status", getStatus())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

@ -47,7 +47,8 @@ public class MesLine extends BaseEntity {
*/
@Excel(name = "标准效率")
private BigDecimal efficiency;
@Excel(name = "标准效率(PC/H)")
private BigDecimal hourEfficiency;
/**
*
*/
@ -83,6 +84,14 @@ public class MesLine extends BaseEntity {
private BigDecimal standarXl;//标准效率
private BigDecimal actXl;//实际效率
public BigDecimal getHourEfficiency() {
return hourEfficiency;
}
public void setHourEfficiency(BigDecimal hourEfficiency) {
this.hourEfficiency = hourEfficiency;
}
public String getProductCode() {
return productCode;
}

@ -95,10 +95,18 @@ public class MesDailyReportVo extends BaseEntity {
private String workCenter;
private String equipmentTypeCode;
private String reason;
private String machineCode;
private BigDecimal reportRate;
public String getReason() {
return reason;
}
public void setReason(String reason) {
this.reason = reason;
}
public BigDecimal getReportRate() {
return reportRate;
}

@ -59,4 +59,9 @@ public interface BaseProductAttachedMapper
* @return
*/
public int deleteBaseProductAttachedByIds(String[] ids);
BaseProductAttached selectBaseProductAttachedByProductCode(String productCode);
//检查productCode
String checkSpareCodeUnique(BaseProductAttached baseProductAttached);
}

@ -0,0 +1,61 @@
package com.op.mes.mapper;
import java.util.List;
import com.op.mes.domain.MesBoxDetail;
/**
* Mapper
*
* @author Open Platform
* @date 2024-08-20
*/
public interface MesBoxDetailMapper {
/**
*
*
* @param boxCode
* @return
*/
public MesBoxDetail selectMesBoxDetailByBoxCode(Long boxCode);
/**
*
*
* @param mesBoxDetail
* @return
*/
public List<MesBoxDetail> selectMesBoxDetailList(MesBoxDetail mesBoxDetail);
/**
*
*
* @param mesBoxDetail
* @return
*/
public int insertMesBoxDetail(MesBoxDetail mesBoxDetail);
/**
*
*
* @param mesBoxDetail
* @return
*/
public int updateMesBoxDetail(MesBoxDetail mesBoxDetail);
/**
*
*
* @param boxCode
* @return
*/
public int deleteMesBoxDetailByBoxCode(Long boxCode);
/**
*
*
* @param boxCodes
* @return
*/
public int deleteMesBoxDetailByBoxCodes(Long[] boxCodes);
}

@ -0,0 +1,67 @@
package com.op.mes.mapper;
import java.util.List;
import com.op.mes.domain.MesBox;
/**
* Mapper
*
* @author Open Platform
* @date 2024-08-20
*/
public interface MesBoxMapper {
/**
*
*
* @param boxId
* @return
*/
public MesBox selectMesBoxByBoxId(Long boxId);
/**
*
*
* @param mesBox
* @return
*/
public List<MesBox> selectMesBoxList(MesBox mesBox);
/**
*
*
* @param mesBox
* @return
*/
public int insertMesBox(MesBox mesBox);
/**
*
*
* @param mesBox
* @return
*/
public int updateMesBox(MesBox mesBox);
/**
*
*
* @param boxId
* @return
*/
public int deleteMesBoxByBoxId(Long boxId);
/**
*
*
* @param boxIds
* @return
*/
public int deleteMesBoxByBoxIds(Long[] boxIds);
List<MesBox> selectDictTypeAll();
MesBox checkBoxTypeUnique(String boxType);
int countBoxDataByType(String boxType);
}

@ -188,4 +188,8 @@ public interface MesReportWorkMapper {
//当月产线产量汇总
//当月产线品类汇总
List<Map> getmonthProductionSutCategory(MesMonthReportVo mesMonthReportVo);
String getProductReason(QuantityDto quantityDto);
String getTypeName(String productCode);
}

@ -3,6 +3,7 @@ package com.op.mes.service;
import java.util.List;
import com.op.common.core.web.domain.AjaxResult;
import com.op.mes.domain.BaseProductAttached;
@ -61,4 +62,8 @@ public interface IBaseProductAttachedService
* @return
*/
public int deleteBaseProductAttachedById(String id);
AjaxResult importFile(List<BaseProductAttached> list);
boolean checkSpareCodeUnique(BaseProductAttached baseProductAttached);
}

@ -0,0 +1,64 @@
package com.op.mes.service;
import java.util.List;
import com.op.mes.domain.MesBoxDetail;
import com.op.system.api.domain.SysDictData;
/**
* Service
*
* @author Open Platform
* @date 2024-08-20
*/
public interface IMesBoxDetailService {
/**
*
*
* @param boxCode
* @return
*/
public MesBoxDetail selectMesBoxDetailByBoxCode(Long boxCode);
/**
*
*
* @param mesBoxDetail
* @return
*/
public List<MesBoxDetail> selectMesBoxDetailList(MesBoxDetail mesBoxDetail);
/**
*
*
* @param mesBoxDetail
* @return
*/
public int insertMesBoxDetail(MesBoxDetail mesBoxDetail);
/**
*
*
* @param mesBoxDetail
* @return
*/
public int updateMesBoxDetail(MesBoxDetail mesBoxDetail);
/**
*
*
* @param boxCodes
* @return
*/
public int deleteMesBoxDetailByBoxCodes(Long[] boxCodes);
/**
*
*
* @param boxCode
* @return
*/
public int deleteMesBoxDetailByBoxCode(Long boxCode);
List<SysDictData> selectBoxDataByType(String boxType);
}

@ -0,0 +1,65 @@
package com.op.mes.service;
import java.util.List;
import com.op.mes.domain.MesBox;
/**
* Service
*
* @author Open Platform
* @date 2024-08-20
*/
public interface IMesBoxService {
/**
*
*
* @param boxId
* @return
*/
public MesBox selectMesBoxByBoxId(Long boxId);
/**
*
*
* @param mesBox
* @return
*/
public List<MesBox> selectMesBoxList(MesBox mesBox);
/**
*
*
* @param mesBox
* @return
*/
public int insertMesBox(MesBox mesBox);
/**
*
*
* @param mesBox
* @return
*/
public int updateMesBox(MesBox mesBox);
/**
*
*
* @param boxIds
* @return
*/
public int deleteMesBoxByBoxIds(Long[] boxIds);
/**
*
*
* @param boxId
* @return
*/
public int deleteMesBoxByBoxId(Long boxId);
List<MesBox> selectDictTypeAll();
boolean checkBoxTypeUnique(MesBox mesBox);
}

@ -4,12 +4,25 @@ import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.StringUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.security.utils.SecurityUtils;
import com.op.mes.domain.BaseProductAttached;
import com.op.mes.mapper.BaseProductAttachedMapper;
import com.op.mes.service.IBaseProductAttachedService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import static com.op.common.core.web.domain.AjaxResult.error;
import static com.op.common.core.web.domain.AjaxResult.success;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
@ -24,6 +37,8 @@ public class BaseProductAttachedServiceImpl implements IBaseProductAttachedServi
@Autowired
private BaseProductAttachedMapper baseProductAttachedMapper;
protected Logger logger = LoggerFactory.getLogger(getClass());
/**
*
*
@ -62,6 +77,7 @@ public class BaseProductAttachedServiceImpl implements IBaseProductAttachedServi
{
baseProductAttached.setId(IdUtils.fastSimpleUUID());
baseProductAttached.setCreateTime(DateUtils.getNowDate());
baseProductAttached.setCreateBy(SecurityUtils.getUsername());
return baseProductAttachedMapper.insertBaseProductAttached(baseProductAttached);
}
@ -104,4 +120,171 @@ public class BaseProductAttachedServiceImpl implements IBaseProductAttachedServi
{
return baseProductAttachedMapper.deleteBaseProductAttachedById(id);
}
/**
*
* @param baseProductAttached
* @return
*/
@Override
@DS("#header.poolName")
@Transactional
public AjaxResult importFile(List<BaseProductAttached> baseProductAttached) {
BaseProductAttached example=null;
for (BaseProductAttached table : baseProductAttached) {
table.setId(IdUtils.fastSimpleUUID());
table.setCreateBy(SecurityUtils.getUsername());
}
//数据校验
// 数据校验
AjaxResult checkResult = checkImportFile(baseProductAttached);
// 如果数据校验成功
if (checkResult.isSuccess()) {
String info = syncImportFunc(baseProductAttached);
return success("信息导入完成。其中导入失败的信息:" + info);
}
// 校验失败
return checkResult;
}
private String syncImportFunc(List<BaseProductAttached> baseProductAttached) {
String failEquipment = "";
for (BaseProductAttached table : baseProductAttached) {
String msg = syncFunc(table);
if (StringUtils.isNotBlank(msg)) {
failEquipment += msg + ",";
}
}
return failEquipment;
}
@Transactional(rollbackFor = Exception.class)
public String syncFunc(BaseProductAttached table) {
String failSpareParts = "";
BaseProductAttached Exist = baseProductAttachedMapper.selectBaseProductAttachedByProductCode(table.getProductCode());
//不存在就插入
if (Exist == null) {
baseProductAttachedMapper.insertBaseProductAttached(table);
logger.info("=======物料附属信息" + table.getProductCode() + "=======导入成功");
//存在,不允许插入
} else {
failSpareParts = table.getProductCode();
logger.info("=======物料附属信息" + failSpareParts + "=======导入失败");
}
return failSpareParts;
}
/**
*
*/
public AjaxResult checkImportFile(List<BaseProductAttached> baseProductAttached){
// 传入对象不能为空
if (baseProductAttached.size() == 0 || StringUtils.isNull(baseProductAttached)) {
return error(500, "导入的信息不能为空!信息导入失败!");
}
for (BaseProductAttached productAttached : baseProductAttached) {
//产品编码
if (productAttached.getProductCode().isEmpty() || productAttached.getProductCode()==null){
return error(500, "产品编号不能为空!信息导入失败!");
}
//品类
if (productAttached.getCategory().isEmpty() || productAttached.getCategory()==null){
return error(500, "品类不能为空!信息导入失败!");
}
//每PC单圈
if (productAttached.getPc().isEmpty() || productAttached.getPc()==null){
return error(500, "每PC单圈不能为空信息导入失败");
}
//标准效率
if (productAttached.getIei().toString().isEmpty() || productAttached.getIei()==null){
return error(500, "标准效率不能为空!信息导入失败!");
}
//标准用人
if (productAttached.getManStandar().toString().isEmpty() || productAttached.getManStandar()==null){
return error(500, "标准用人不能为空!信息导入失败!");
}
//喷药方式
// if (productAttached.getSprayWay().isEmpty() || productAttached.getSprayWay()==null){
// return error(500, "喷药方式不能为空!信息导入失败!");
// }
//白坯直径
if (productAttached.getBlankDiameter().toString().isEmpty() || productAttached.getBlankDiameter()==null){
return error(500, "白坯直径不能为空!信息导入失败!");
}
//白坯物料号
if (productAttached.getBlankNo().isEmpty() || productAttached.getBlankNo()==null){
return error(500, "白坯物料号不能为空!信息导入失败!");
}
//标准喷药量
if (productAttached.getSprayVolume().toString().isEmpty() || productAttached.getSprayVolume()==null){
return error(500, "标准喷药量不能为空!信息导入失败!");
}
//药液料号
if (productAttached.getLiquidNo().isEmpty() || productAttached.getLiquidNo()==null){
return error(500, "药液料号不能为空!信息导入失败!");
}
//标准内膜用量
if (productAttached.getEndometrialDosage().toString().isEmpty() || productAttached.getEndometrialDosage()==null){
return error(500, "标准内膜用量不能为空!信息导入失败!");
}
//标准外膜用量
if (productAttached.getOuterFilmDosage().toString().isEmpty() || productAttached.getOuterFilmDosage()==null){
return error(500, "标准外膜用量不能为空!信息导入失败!");
}
//支架
if (productAttached.getSupport().toString().isEmpty() || productAttached.getSupport()==null){
return error(500, "支架不能为空!信息导入失败!");
}
//支架物料号
if (productAttached.getSupportNo().isEmpty() || productAttached.getSupportNo()==null){
return error(500, "支架物料号不能为空!信息导入失败!");
}
//吸塑
if (productAttached.getPvc().toString().isEmpty() || productAttached.getPvc()==null){
return error(500, "吸塑不能为空!信息导入失败!");
}
//支架盘
if (productAttached.getSupportPlate().toString().isEmpty() || productAttached.getSupportPlate()==null){
return error(500, "支架盘不能为空!信息导入失败!");
}
//库检周期
if (productAttached.getWarehouseCycle().isEmpty() || productAttached.getSupportPlate()==null){
return error(500, "库检周期不能为空!信息导入失败!");
}
//库检周期
if (productAttached.getWarehouseCycle().isEmpty() || productAttached.getWarehouseCycle()==null){
return error(500, "库检周期不能为空!信息导入失败!");
}
//托盘上箱数
if (productAttached.getPalletNum().toString().isEmpty() || productAttached.getPalletNum()==null){
return error(500, "托盘上箱数不能为空!信息导入失败!");
}
//垛形
if (productAttached.getPackType().isEmpty() || productAttached.getPackType()==null){
return error(500, "垛形不能为空!信息导入失败!");
}
}
return success();
}
@Override
@DS("#header.poolName")
public boolean checkSpareCodeUnique(BaseProductAttached baseProductAttached) {
String spareCode = baseProductAttachedMapper.checkSpareCodeUnique(baseProductAttached);
if (spareCode == null) {
return false;
} else {
return true;
}
}
}

@ -0,0 +1,106 @@
package com.op.mes.service.impl;
import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils;
import com.op.common.security.utils.SecurityUtils;
import com.op.system.api.domain.SysDictData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.mes.mapper.MesBoxDetailMapper;
import com.op.mes.domain.MesBoxDetail;
import com.op.mes.service.IMesBoxDetailService;
/**
* Service
*
* @author Open Platform
* @date 2024-08-20
*/
@Service
public class MesBoxDetailServiceImpl implements IMesBoxDetailService {
@Autowired
private MesBoxDetailMapper mesBoxDetailMapper;
/**
*
*
* @param boxCode
* @return
*/
@Override
@DS("#header.poolName")
public MesBoxDetail selectMesBoxDetailByBoxCode(Long boxCode) {
return mesBoxDetailMapper.selectMesBoxDetailByBoxCode(boxCode);
}
/**
*
*
* @param mesBoxDetail
* @return
*/
@Override
@DS("#header.poolName")
public List<MesBoxDetail> selectMesBoxDetailList(MesBoxDetail mesBoxDetail) {
return mesBoxDetailMapper.selectMesBoxDetailList(mesBoxDetail);
}
/**
*
*
* @param mesBoxDetail
* @return
*/
@Override
@DS("#header.poolName")
public int insertMesBoxDetail(MesBoxDetail mesBoxDetail) {
mesBoxDetail.setCreateBy(SecurityUtils.getUsername());
mesBoxDetail.setCreateTime(DateUtils.getNowDate());
return mesBoxDetailMapper.insertMesBoxDetail(mesBoxDetail);
}
/**
*
*
* @param mesBoxDetail
* @return
*/
@Override
@DS("#header.poolName")
public int updateMesBoxDetail(MesBoxDetail mesBoxDetail) {
mesBoxDetail.setUpdateBy(SecurityUtils.getUsername());
mesBoxDetail.setUpdateTime(DateUtils.getNowDate());
return mesBoxDetailMapper.updateMesBoxDetail(mesBoxDetail);
}
/**
*
*
* @param boxCodes
* @return
*/
@Override
@DS("#header.poolName")
public int deleteMesBoxDetailByBoxCodes(Long[] boxCodes) {
return mesBoxDetailMapper.deleteMesBoxDetailByBoxCodes(boxCodes);
}
/**
*
*
* @param boxCode
* @return
*/
@Override
@DS("#header.poolName")
public int deleteMesBoxDetailByBoxCode(Long boxCode) {
return mesBoxDetailMapper.deleteMesBoxDetailByBoxCode(boxCode);
}
@Override
public List<SysDictData> selectBoxDataByType(String boxType) {
return null;
}
}

@ -0,0 +1,131 @@
package com.op.mes.service.impl;
import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.constant.UserConstants;
import com.op.common.core.exception.ServiceException;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.StringUtils;
import com.op.common.security.utils.DictUtils;
import com.op.common.security.utils.SecurityUtils;
import com.op.system.api.domain.SysDictType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.mes.mapper.MesBoxMapper;
import com.op.mes.domain.MesBox;
import com.op.mes.service.IMesBoxService;
/**
* Service
*
* @author Open Platform
* @date 2024-08-20
*/
@Service
public class MesBoxServiceImpl implements IMesBoxService {
@Autowired
private MesBoxMapper mesBoxMapper;
/**
*
*
* @param boxId
* @return
*/
@Override
@DS("#header.poolName")
public MesBox selectMesBoxByBoxId(Long boxId) {
return mesBoxMapper.selectMesBoxByBoxId(boxId);
}
/**
*
*
* @param mesBox
* @return
*/
@Override
@DS("#header.poolName")
public List<MesBox> selectMesBoxList(MesBox mesBox) {
return mesBoxMapper.selectMesBoxList(mesBox);
}
/**
*
*
* @param mesBox
* @return
*/
@Override
@DS("#header.poolName")
public int insertMesBox(MesBox mesBox) {
mesBox.setCreateBy(SecurityUtils.getUsername());
mesBox.setCreateTime(DateUtils.getNowDate());
return mesBoxMapper.insertMesBox(mesBox);
}
/**
*
*
* @param mesBox
* @return
*/
@Override
@DS("#header.poolName")
public int updateMesBox(MesBox mesBox) {
mesBox.setUpdateBy(SecurityUtils.getUsername());
mesBox.setUpdateTime(DateUtils.getNowDate());
return mesBoxMapper.updateMesBox(mesBox);
}
/**
*
*
* @param boxIds
* @return
*/
@Override
@DS("#header.poolName")
public int deleteMesBoxByBoxIds(Long[] boxIds) {
int n = 0;
for (Long boxId : boxIds) {
MesBox boxType = selectMesBoxByBoxId(boxId);
if (mesBoxMapper.countBoxDataByType(boxType.getBoxType()) > 0) {
throw new ServiceException(String.format("%1$s已分配,不能删除", boxType.getBoxName()));
}
n += mesBoxMapper.deleteMesBoxByBoxIds(boxIds);
}
return n;
}
/**
*
*
* @param boxId
* @return
*/
@Override
@DS("#header.poolName")
public int deleteMesBoxByBoxId(Long boxId) {
return mesBoxMapper.deleteMesBoxByBoxId(boxId);
}
@Override
@DS("#header.poolName")
public List<MesBox> selectDictTypeAll() {
return mesBoxMapper.selectDictTypeAll();
}
@Override
@DS("#header.poolName")
public boolean checkBoxTypeUnique(MesBox mesBox) {
Long boxId = StringUtils.isNull(mesBox.getBoxId()) ? -1L : mesBox.getBoxId();
MesBox boxType = mesBoxMapper.checkBoxTypeUnique(mesBox.getBoxType());
if (StringUtils.isNotNull(boxType) && boxType.getBoxId().longValue() != boxId.longValue()) {
return UserConstants.NOT_UNIQUE;
}
return UserConstants.UNIQUE;
}
}

@ -416,7 +416,13 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService {
for (MesDailyReportVo dto : dtos) {
dto.setFactoryCode(factoryCode);
dto.setProdType("蚊香");
//品类
String typeName = mesReportWorkMapper.getTypeName(dto.getProductCode().replace("0000000",""));
if(StringUtils.isNotBlank(typeName)){
dto.setProdType(typeName);
}else {
dto.setProdType("蚊香");
}
QuantityDto quantityDto = new QuantityDto();
String workorderCode = dto.getWorkorderCode();
@ -424,6 +430,12 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService {
quantityDto.setWorkorderCode(workorderCode);
quantityDto.setMachineCode(machineCode);
//影响效率原因
String reasons = mesReportWorkMapper.getProductReason(quantityDto);
if(StringUtils.isNotBlank(reasons)){
dto.setReason(reasons.replaceAll(";+", " "));
}
QuantityDto parentMesReport = mesReportWorkMapper.getRealQuantity(quantityDto);
QuantityDto sonMesReport = mesReportWorkMapper.getSumQuantity(quantityDto);
if(sonMesReport == null){//单层工单的情况
@ -854,5 +866,11 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService {
}
return map;
}
public static void main(String[] args) {
String originalString = "这是;;一个;测试;字符串;;;;用来测试替换功能";
String replacedString = originalString.replaceAll(";+", " ");
System.out.println("原始字符串: " + originalString);
System.out.println("替换后的字符串: " + replacedString);
}
}

@ -13,12 +13,13 @@ spring:
cloud:
nacos:
discovery:
#命名空间
namespace: lanju-op-test
group: test
# 服务注册地址
# server-addr: 192.168.202.20:8848
server-addr: 192.168.202.20:8848
config:
#命名空间
namespace: lanju-op-test
group: test
# 服务注册地址

@ -24,10 +24,15 @@
<result property="supportPlate" column="support_plate" />
<result property="other" column="other" />
<result property="createBy" column="create_by" />
<result property="warehouseCycle" column="warehouse_cycle" />
<result property="palletNum" column="pallet_num" />
<result property="packType" column="pack_type" />
</resultMap>
<sql id="selectBaseProductAttachedVo">
select id, product_code, category, pc, iei, man_standar, spray_way, blank_diameter, blank_no, spray_volume, liquid_no, endometrial_dosage, outer_film_dosage, support, support_no, pvc, support_plate, other, create_by from base_product_attached
select id, product_code, category, pc, iei, man_standar, spray_way, blank_diameter, blank_no, spray_volume, liquid_no, endometrial_dosage, outer_film_dosage, support, support_no, pvc,
support_plate,
other, create_by, warehouse_cycle,pallet_num,pack_type from base_product_attached
</sql>
<select id="selectBaseProductAttachedList" parameterType="BaseProductAttached" resultMap="BaseProductAttachedResult">
@ -50,6 +55,11 @@
<if test="pvc != null "> and pvc = #{pvc}</if>
<if test="supportPlate != null "> and support_plate = #{supportPlate}</if>
<if test="other != null and other != ''"> and other = #{other}</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
<if test="warehouseCycle != null and warehouseCycle != ''"> and warehouse_cycle = #{warehouseCycle}</if>
<if test="palletNum != null and palletNum != ''"> and pallet_num = #{palletNum}</if>
<if test="packType != null and packType != ''"> and pack_type = #{packType}</if>
</where>
</select>
@ -57,7 +67,18 @@
<include refid="selectBaseProductAttachedVo"/>
where id = #{id}
</select>
<select id="selectBaseProductAttachedByProductCode" parameterType="String" resultMap="BaseProductAttachedResult">
<include refid="selectBaseProductAttachedVo"/>
where product_code = #{productCode}
</select>
<select id="checkSpareCodeUnique" parameterType="BaseProductAttached" resultType="java.lang.String">
select product_code
from base_product_attached
where product_code = #{productCode}
</select>
<insert id="insertBaseProductAttached" parameterType="BaseProductAttached">
insert into base_product_attached
<trim prefix="(" suffix=")" suffixOverrides=",">
@ -80,6 +101,10 @@
<if test="supportPlate != null">support_plate,</if>
<if test="other != null">other,</if>
<if test="createBy != null">create_by,</if>
<if test="warehouseCycle != null">warehouse_cycle,</if>
<if test="palletNum != null">pallet_num,</if>
<if test="packType != null">pack_type,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
@ -101,6 +126,9 @@
<if test="supportPlate != null">#{supportPlate},</if>
<if test="other != null">#{other},</if>
<if test="createBy != null">#{createBy},</if>
<if test="warehouseCycle != null">#{warehouseCycle},</if>
<if test="palletNum != null">#{palletNum},</if>
<if test="packType != null">#{packType},</if>
</trim>
</insert>
@ -125,6 +153,11 @@
<if test="supportPlate != null">support_plate = #{supportPlate},</if>
<if test="other != null">other = #{other},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="warehouseCycle != null">warehouse_cycle = #{warehouseCycle},</if>
<if test="palletNum != null">pallet_num = #{palletNum},</if>
<if test="packType != null">pack_type = #{packType},</if>
</trim>
where id = #{id}
</update>

@ -0,0 +1,225 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.op.mes.mapper.MesBoxDetailMapper">
<resultMap type="MesBoxDetail" id="MesBoxDetailResult">
<result property="boxCode" column="box_code"/>
<result property="boxSort" column="box_sort"/>
<result property="boxLabel" column="box_label"/>
<result property="boxKey" column="box_key"/>
<result property="boxValue" column="box_value"/>
<result property="boxType" column="box_type"/>
<result property="cssClass" column="css_class"/>
<result property="listClass" column="list_class"/>
<result property="isDefault" column="is_default"/>
<result property="status" column="status"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="remark" column="remark"/>
<result property="length" column="length"/>
<result property="width" column="width"/>
<result property="height" column="height"/>
</resultMap>
<sql id="selectMesBoxDetailVo">
select box_code, box_sort, box_label, box_key,
box_value, box_type, css_class, list_class,
is_default, status, create_by, create_time,
update_by, update_time, remark,
length, width, height from mes_box_detail
</sql>
<select id="selectMesBoxDetailList" parameterType="MesBoxDetail" resultMap="MesBoxDetailResult">
<include refid="selectMesBoxDetailVo"/>
<where>
del_flag = '0'
<if test="boxSort != null ">
and box_sort = #{boxSort}
</if>
<if test="boxLabel != null and boxLabel != ''">
and box_label = #{boxLabel}
</if>
<if test="boxKey != null and boxKey != ''">
and box_key = #{boxKey}
</if>
<if test="boxValue != null and boxValue != ''">
and box_value = #{boxValue}
</if>
<if test="boxType != null and boxType != ''">
and box_type = #{boxType}
</if>
<if test="cssClass != null and cssClass != ''">
and css_class = #{cssClass}
</if>
<if test="listClass != null and listClass != ''">
and list_class = #{listClass}
</if>
<if test="isDefault != null and isDefault != ''">
and is_default = #{isDefault}
</if>
<if test="status != null and status != ''">
and status = #{status}
</if>
</where>
order by box_sort
</select>
<select id="selectMesBoxDetailByBoxCode" parameterType="Long"
resultMap="MesBoxDetailResult">
<include refid="selectMesBoxDetailVo"/>
where box_code = #{boxCode}
</select>
<insert id="insertMesBoxDetail" parameterType="MesBoxDetail">
insert into mes_box_detail
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="boxCode != null">box_code,
</if>
<if test="boxSort != null">box_sort,
</if>
<if test="boxLabel != null">box_label,
</if>
<if test="boxKey != null">box_key,
</if>
<if test="boxValue != null">box_value,
</if>
<if test="boxType != null">box_type,
</if>
<if test="cssClass != null">css_class,
</if>
<if test="listClass != null">list_class,
</if>
<if test="isDefault != null">is_default,
</if>
<if test="status != null">status,
</if>
<if test="createBy != null">create_by,
</if>
<if test="createTime != null">create_time,
</if>
<if test="updateBy != null">update_by,
</if>
<if test="updateTime != null">update_time,
</if>
<if test="remark != null">remark,
</if>
<if test="length != null">length,
</if>
<if test="width != null">width,
</if>
<if test="height != null">height,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="boxCode != null">#{boxCode},
</if>
<if test="boxSort != null">#{boxSort},
</if>
<if test="boxLabel != null">#{boxLabel},
</if>
<if test="boxKey != null">#{boxKey},
</if>
<if test="boxValue != null">#{boxValue},
</if>
<if test="boxType != null">#{boxType},
</if>
<if test="cssClass != null">#{cssClass},
</if>
<if test="listClass != null">#{listClass},
</if>
<if test="isDefault != null">#{isDefault},
</if>
<if test="status != null">#{status},
</if>
<if test="createBy != null">#{createBy},
</if>
<if test="createTime != null">#{createTime},
</if>
<if test="updateBy != null">#{updateBy},
</if>
<if test="updateTime != null">#{updateTime},
</if>
<if test="remark != null">#{remark},
</if>
<if test="length != null">#{length},
</if>
<if test="width != null">#{width},
</if>
<if test="height != null">#{height},
</if>
</trim>
</insert>
<update id="updateMesBoxDetail" parameterType="MesBoxDetail">
update mes_box_detail
<trim prefix="SET" suffixOverrides=",">
<if test="boxSort != null">box_sort =
#{boxSort},
</if>
<if test="boxLabel != null">box_label =
#{boxLabel},
</if>
<if test="boxKey != null">box_key =
#{boxKey},
</if>
<if test="boxValue != null">box_value =
#{boxValue},
</if>
<if test="boxType != null">box_type =
#{boxType},
</if>
<if test="cssClass != null">css_class =
#{cssClass},
</if>
<if test="listClass != null">list_class =
#{listClass},
</if>
<if test="isDefault != null">is_default =
#{isDefault},
</if>
<if test="status != null">status =
#{status},
</if>
<if test="createBy != null">create_by =
#{createBy},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
<if test="updateBy != null">update_by =
#{updateBy},
</if>
<if test="updateTime != null">update_time =
#{updateTime},
</if>
<if test="remark != null">remark =
#{remark},
</if>
<if test="length != null">length =
#{length},
</if>
<if test="width != null">width =
#{width},
</if>
<if test="height != null">height =
#{height},
</if>
</trim>
where box_code = #{boxCode}
</update>
<delete id="deleteMesBoxDetailByBoxCode" parameterType="Long">
update mes_box_detail set del_flag = '1' where box_code = #{boxCode}
</delete>
<delete id="deleteMesBoxDetailByBoxCodes" parameterType="String">
update mes_box_detail set del_flag = '1' where box_code in
<foreach item="boxCode" collection="array" open="(" separator="," close=")">
#{boxCode}
</foreach>
</delete>
</mapper>

@ -0,0 +1,144 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.op.mes.mapper.MesBoxMapper">
<resultMap type="MesBox" id="MesBoxResult">
<result property="boxId" column="box_id"/>
<result property="boxName" column="box_name"/>
<result property="boxType" column="box_type"/>
<result property="status" column="status"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="remark" column="remark"/>
</resultMap>
<sql id="selectMesBoxVo">
select box_id, box_name, box_type, status, create_by, create_time, update_by, update_time, remark from mes_box
</sql>
<select id="selectMesBoxList" parameterType="MesBox" resultMap="MesBoxResult">
<include refid="selectMesBoxVo"/>
<where>
del_flag = '0'
<if test="boxName != null and boxName != ''">
and box_name like concat('%', #{boxName}, '%')
</if>
<if test="boxType != null and boxType != ''">
and box_type = #{boxType}
</if>
<if test="status != null and status != ''">
and status = #{status}
</if>
</where>
</select>
<select id="selectMesBoxByBoxId" parameterType="Long"
resultMap="MesBoxResult">
<include refid="selectMesBoxVo"/>
where box_id = #{boxId} and del_flag = '0'
</select>
<insert id="insertMesBox" parameterType="MesBox">
insert into mes_box
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="boxId != null">box_id,
</if>
<if test="boxName != null">box_name,
</if>
<if test="boxType != null">box_type,
</if>
<if test="status != null">status,
</if>
<if test="createBy != null">create_by,
</if>
<if test="createTime != null">create_time,
</if>
<if test="updateBy != null">update_by,
</if>
<if test="updateTime != null">update_time,
</if>
<if test="remark != null">remark,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="boxId != null">#{boxId},
</if>
<if test="boxName != null">#{boxName},
</if>
<if test="boxType != null">#{boxType},
</if>
<if test="status != null">#{status},
</if>
<if test="createBy != null">#{createBy},
</if>
<if test="createTime != null">#{createTime},
</if>
<if test="updateBy != null">#{updateBy},
</if>
<if test="updateTime != null">#{updateTime},
</if>
<if test="remark != null">#{remark},
</if>
</trim>
</insert>
<update id="updateMesBox" parameterType="MesBox">
update mes_box
<trim prefix="SET" suffixOverrides=",">
<if test="boxName != null">box_name =
#{boxName},
</if>
<if test="boxType != null">box_type =
#{boxType},
</if>
<if test="status != null">status =
#{status},
</if>
<if test="createBy != null">create_by =
#{createBy},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
<if test="updateBy != null">update_by =
#{updateBy},
</if>
<if test="updateTime != null">update_time =
#{updateTime},
</if>
<if test="remark != null">remark =
#{remark},
</if>
</trim>
where box_id = #{boxId}
</update>
<select id="selectDictTypeAll" resultMap="MesBoxResult">
<include refid="selectMesBoxVo"/>
</select>
<select id="countBoxDataByType" resultType="Integer">
select count(1) from mes_box_detail where box_type=#{boxType}
</select>
<delete id="deleteMesBoxByBoxId" parameterType="Long">
update mes_box set del_flag = '1' where box_id = #{boxId}
</delete>
<delete id="deleteMesBoxByBoxIds" parameterType="String">
update mes_box set del_flag = '1' where box_id in
<foreach item="boxId" collection="array" open="(" separator="," close=")">
#{boxId}
</foreach>
</delete>
<select id="checkBoxTypeUnique" parameterType="String" resultMap="MesBoxResult">
select top 1 box_id, box_name, box_type, status, create_by, create_time, remark
from mes_box
where box_type = #{boxType}
</select>
</mapper>

@ -10,6 +10,7 @@
<result property="lineName" column="line_name"/>
<result property="useMan" column="use_man"/>
<result property="efficiency" column="efficiency"/>
<result property="hourEfficiency" column="hour_efficiency"/>
<result property="attr1" column="attr1"/>
<result property="attr2" column="attr2"/>
<result property="attr3" column="attr3"/>
@ -28,19 +29,19 @@
<sql id="selectMesLineVo">
select id, line_code, product_code,product_name,use_man, efficiency, attr1, attr2, attr3, attr4, create_by,
create_time, update_by, update_time, factory_code, del_flag from mes_line_product
create_time, update_by, update_time, factory_code, del_flag,hour_efficiency from mes_line_product
</sql>
<select id="selectMesLineList" parameterType="MesLine" resultMap="MesLineResult">
select mlp.id, mlp.line_code, mlp.product_code,mlp.product_name,mlp.use_man, mlp.efficiency, mlp.attr1,
mlp.attr2, mlp.attr3, mlp.attr4, mlp.create_by,
mlp.attr2, mlp.attr3, mlp.attr4, mlp.create_by,mlp.hour_efficiency,
mlp.create_time, mlp.update_by, mlp.update_time, mlp.factory_code, mlp.del_flag,
be.equipment_name line_name
from mes_line_product mlp
left join base_equipment be on be.equipment_code = mlp.line_code
<where>
<if test="lineCode != null and lineCode != ''">
and mlp.line_code like concat('%', #{lineName}, '%')
and mlp.line_code like concat('%', #{lineCode}, '%')
</if>
<if test="lineName != null and lineName != ''">
and be.equipment_name like concat('%', #{lineName}, '%')
@ -67,7 +68,7 @@
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="lineCode != null">line_code,</if>
<if test="hourEfficiency != null">hour_efficiency,</if>
<if test="useMan != null">use_man,</if>
<if test="efficiency != null">efficiency,</if>
<if test="attr1 != null">attr1,</if>
@ -84,7 +85,7 @@
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="lineCode != null">#{lineCode},</if>
<if test="hourEfficiency != null">#{hourEfficiency},</if>
<if test="useMan != null">#{useMan},</if>
<if test="efficiency != null">#{efficiency},</if>
<if test="attr1 != null">#{attr1},</if>
@ -108,6 +109,7 @@
<if test="productName != null">product_name,</if>
<if test="useMan != null">use_man,</if>
<if test="efficiency != null">efficiency,</if>
<if test="hourEfficiency != null">hour_efficiency,</if>
<if test="attr1 != null">attr1,</if>
<if test="attr2 != null">attr2,</if>
<if test="attr3 != null">attr3,</if>
@ -126,6 +128,7 @@
<if test="productName != null">#{productName},</if>
<if test="useMan != null">#{useMan},</if>
<if test="efficiency != null">#{efficiency},</if>
<if test="hourEfficiency != null">#{hourEfficiency},</if>
<if test="attr1 != null">#{attr1},</if>
<if test="attr2 != null">#{attr2},</if>
<if test="attr3 != null">#{attr3},</if>
@ -146,6 +149,7 @@
<if test="useMan != null">use_man = #{useMan},</if>
<if test="efficiency != null">efficiency = #{efficiency},</if>
<if test="hourEfficiency != null">hour_efficiency= #{hourEfficiency},</if>
<if test="attr1 != null">attr1 = #{attr1},</if>
<if test="attr2 != null">attr2 = #{attr2},</if>
<if test="attr3 != null">attr3 = #{attr3},</if>
@ -164,6 +168,7 @@
<trim prefix="SET" suffixOverrides=",">
<if test="useMan != null">use_man = #{useMan},</if>
<if test="efficiency != null">efficiency = #{efficiency},</if>
<if test="hourEfficiency != null">hour_efficiency= #{hourEfficiency},</if>
<if test="attr1 != null">attr1 = #{attr1},</if>
<if test="attr2 != null">attr2 = #{attr2},</if>
<if test="attr3 != null">attr3 = #{attr3},</if>

@ -457,7 +457,7 @@
<select id="getMesLineInfo" resultType="com.op.mes.domain.MesLine">
select
mlp.use_man standarMan,
ROUND(mlp.efficiency/bp.umrez,2) AS standarXl
ROUND(mlp.hour_efficiency/bp.umrez,2) AS standarXl
from mes_line_product mlp
left join base_product bp on bp.product_code=mlp.product_code
where mlp.line_code = #{equCode} and mlp.product_code = #{productCode}

@ -681,7 +681,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
pow.quantity_split quantitySplit,
pow.attr3 teamLeaderName,
mlp.use_man manStandard,
mlp.efficiency efficiency,
mlp.hour_efficiency efficiency,
mlp.attr1 unitWorkingHours,
pow.workorder_code workorderCode,
pow.workorder_name workorderName,
@ -953,6 +953,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getmonthProductionSutCategory" statementType="CALLABLE" resultType="java.util.Map" parameterType="MesMonthReportVo">
{CALL GeneratePivotReportCategory(#{params.beginTime, jdbcType=DATE}, #{params.endTime, jdbcType=DATE})}
</select>
<select id="getProductReason" resultType="java.lang.String">
SELECT
STRING_AGG(Reason, ';') AS Reasons
FROM
mes_report_work where workorder_code = #{workorderCode} and del_flag = '0' and Reason is not null
GROUP BY
workorder_code;
</select>
<select id="getTypeName" resultType="java.lang.String">
select top 1 category from base_product_attached where product_code = #{productCode}
</select>
<insert id="insertMesReportWork" parameterType="MesReportWork">
insert into mes_report_work

@ -13,16 +13,16 @@ spring:
cloud:
nacos:
discovery:
#命名空间
namespace: lanju-op-test
group: test
# 服务注册地址
server-addr: 192.168.202.20:8848
config:
#命名空间
namespace: lanju-op-test
group: test
#命名空间
#group: local
# 配置中心地址
# 服务注册地址
server-addr: 192.168.202.20:8848
# 配置文件格式
file-extension: yml

@ -314,4 +314,10 @@ public class ProOrderWorkorderController extends BaseController {
public List<ProOrderWorkorder> getIdCardList(@RequestBody ProOrderWorkorder proOrderWorkorder) {
return proOrderWorkorderService.getIdCardList(proOrderWorkorder);
}
//获取批次号
@GetMapping("/getBatchCode/{workorderId}")
public List<ProOrderWorkorder> getBatchCode(@PathVariable("workorderId") String workorderId) {
return proOrderWorkorderService.getBatchCode(workorderId);
}
}

@ -339,6 +339,8 @@ public class ProOrderWorkorder extends TreeEntity {
private String palletCode;
private String recordId;
private String addFlag;
public String getRecordId() {
return recordId;
}
@ -787,6 +789,13 @@ public class ProOrderWorkorder extends TreeEntity {
this.sortNo = sortNo;
}
public void setAddFlag(String addFlag) {
this.addFlag = addFlag;
}
public String getAddFlag() {
return addFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

@ -237,5 +237,12 @@ public interface ProOrderWorkorderMapper {
List<ProOrderWorkorder> getPreIdCardList(ProOrderWorkorder proOrderWorkorder);
int addBatchPallet(@Param("list")List<ProOrderWorkorder> dtos);
Integer selectPalletByUniqueBarCode(ProOrderWorkorder pw);
//void addOnePallet(ProOrderWorkorder pw);//新增一个标识卡
void updateOnePallet(ProOrderWorkorder pw);//更新一个标识卡
List<ProOrderWorkorder> getBatchCode(String workorderId);//获取批次号下拉框
}

@ -151,4 +151,6 @@ public interface IProOrderWorkorderService {
List<ProLine> getProdLineList();
List<ProOrderWorkorder> getIdCardList(ProOrderWorkorder proOrderWorkorder);
List<ProOrderWorkorder> getBatchCode(String workorderId);//获取批次号
}

@ -1371,7 +1371,7 @@ public class ProOrderServiceImpl implements IProOrderService {
if(CollectionUtils.isEmpty(proOrder.getChildren())){//1层订单
proOrder.setEndFlag(1);
}
int endCode = getEndCode(proOrder.getId());
int endCode = getEndCode(proOrder.getId())+i;
String belongWorkOrder = proOrder.getOrderCode()+"-"+endCode;
proOrder.setBelongWorkOrder(belongWorkOrder);
proOrder.setWorkerOrder(belongWorkOrder);

@ -1259,13 +1259,18 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
return proOrderWorkorderBatchMapper.getProdLineList();
}
@Override
@DS("#header.poolName")
public List<ProOrderWorkorder> getBatchCode(String workorderId) {
return proOrderWorkorderMapper.getBatchCode(workorderId);
}
@Override
@DS("#header.poolName")
public List<ProOrderWorkorder> getIdCardList(ProOrderWorkorder proOrderWorkorder) {
List<ProOrderWorkorder> dtos = new ArrayList<>();
List<ProOrderWorkorder> dtos0 = proOrderWorkorderMapper.getPreIdCardList(proOrderWorkorder);
if(!CollectionUtils.isEmpty(dtos0) && dtos0.get(0).getPalletNo() == null){//说明没生成过标识卡
if(!CollectionUtils.isEmpty(dtos0) && dtos0.get(0).getPalletNo() == null && proOrderWorkorder.getAddFlag().equals("0")){//说明没生成过标识卡 增打标志0
ProOrderWorkorder pw = null;
int i = 1;
Date nowDate = DateUtils.getNowDate();
@ -1287,9 +1292,14 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
}else{
pw.setBatchQuantity(pn);
}
pw.setUnit(pow.getUnit());
pw.setUmrez(pw.getBatchQuantity().multiply(pow.getUmrez()));//子单数量
pw.setPalletNo(i++);
pw.setPalletCode(pow.getPalletCode()+"-"+pw.getPalletNo());
pw.setPalletCode(pow.getProductCode().replace("0000000","") + "-" +pow.getWorkorderCode() + "-"
+ pow.getBatchCode() + "-" + pw.getPalletNo());//workorderCode 实际上是订单号
pw.setCreateTime(nowDate);
pw.setCreateBy(SecurityUtils.getUsername());
pw.setAddFlag("0");//增打标志
dtos.add(pw);
pall = pall.subtract(pn);
}
@ -1298,10 +1308,50 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
if(!CollectionUtils.isEmpty(dtos)){
proOrderWorkorderMapper.addBatchPallet(dtos);
}
}else{
}else if(proOrderWorkorder.getAddFlag().equals("1")){
//增打 增打过来的会有批次号、批次数量、板次 增打标志1 根据唯一二维码去判断是不是生成过标识卡 有增打标志
Integer palletNo = proOrderWorkorder.getPalletNo();//板次
proOrderWorkorder.setPalletNo(null);//板次置空 去查询 获取产品等信息
List<ProOrderWorkorder> dtos1 = proOrderWorkorderMapper.getPreIdCardList(proOrderWorkorder);
ProOrderWorkorder pow = dtos1.get(0);
proOrderWorkorder.setPalletNo(palletNo);
String uniqueBarCode = pow.getProductCode().replace("0000000","") + "-" +
pow.getWorkorderCode() + "-" + proOrderWorkorder.getBatchCode() + "-" + palletNo;//订单号+批次+板次 唯一二维码标识
ProOrderWorkorder pw = new ProOrderWorkorder();
pw.setProductName(pow.getProductName());//产品名
pw.setWorkorderCode(pow.getWorkorderCode());//工单号 实际是订单号
pw.setBatchCode(proOrderWorkorder.getBatchCode());//批次号
pw.setProductDateStr(pow.getProductDateStr());//生产日期
pw.setRecordId(IdUtils.fastSimpleUUID());//记录
pw.setBatchQuantity(proOrderWorkorder.getBatchQuantity());//批次数量
pw.setUnit(pow.getUnit());
pw.setUmrez(pw.getBatchQuantity().multiply(pow.getUmrez()));//子单数量
pw.setPalletNo(palletNo);//板次
pw.setPalletCode(uniqueBarCode);//唯一二维码
pw.setUpdateTime(DateUtils.getNowDate());
pw.setUpdateBy(SecurityUtils.getUsername());
pw.setCreateTime(DateUtils.getNowDate());
pw.setCreateBy(SecurityUtils.getUsername());
pw.setAddFlag("0");
Integer supplementMsg = proOrderWorkorderMapper.selectPalletByUniqueBarCode(pw);//补打标志
pw.setAddFlag("1");
Integer addMsg = proOrderWorkorderMapper.selectPalletByUniqueBarCode(pw);//增打标志
List<ProOrderWorkorder> dto = new ArrayList<>();
if(supplementMsg == 0 && addMsg == 0){//没有正常生成、补打过 没有增打过
dto.add(pw);
proOrderWorkorderMapper.addBatchPallet(dto);
}else if(supplementMsg == 0 && addMsg >= 1){//没有正常生成过、补打过 增打过
proOrderWorkorderMapper.updateOnePallet(pw);
}else if(supplementMsg >= 1){//补打过、正常打过 没有增打过
return dto;
}
dtos.add(pw);
}else if(!CollectionUtils.isEmpty(dtos0) && dtos0.get(0).getPalletNo() != null && proOrderWorkorder.getAddFlag().equals("0")){
dtos.addAll(dtos0);
}
return dtos;
}

@ -13,11 +13,13 @@ spring:
cloud:
nacos:
discovery:
#命名空间
namespace: lanju-op-test
group: test
# 服务注册地址
server-addr: 192.168.202.20:8848
config:
#命名空间
namespace: lanju-op-test
group: test
# 服务注册地址

@ -682,17 +682,20 @@
</select>
<select id="getPreIdCardList" resultType="com.op.plan.domain.ProOrderWorkorder">
select pow.product_name productName,
pow.product_code productCode,
pow.product_date productDateStr,
pow.workorder_code_sap workorderCode,
powb.batch_code batchCode,
case when powbp.quantity is not null then powbp.quantity
else powb.batch_quantity end batchQuantity,
else powb.batch_quantity end batchQuantity,pow.unit,
bpa.pallet_num palletNum,
concat(pow.workorder_code_sap,'-', powb.batch_code,'-',powbp.pallet_num) palletCode,
powbp.pallet_num palletNo
concat(REPLACE(pow.product_code, '0000000', ''),'-',pow.workorder_code_sap,'-', powb.batch_code,'-',powbp.pallet_num) palletCode,
powbp.pallet_num palletNo,
bp.umrez
from pro_order_workorder pow
left join pro_order_workorder_batch powb on pow.workorder_id = powb.workorder_id
left join base_product_attached bpa on concat('0000000',bpa.product_code) = pow.product_code
left join base_product bp on bp.product_code = pow.product_code
left join pro_order_workorder_batch_pallet powbp on powbp.workorder_code = pow.workorder_code_sap
and powbp.batch_code = powb.batch_code
where pow.workorder_code = #{workorderCode} and pow.del_flag = '0' and powb.del_flag = '0'
@ -819,16 +822,41 @@
)
</foreach>
</insert>
<update id="updateOnePallet" parameterType="ProOrderWorkorder">
update pro_order_workorder_batch_pallet
<trim prefix="SET" suffixOverrides=",">
<if test="batchQuantity != null and batchQuantity != ''">quantity = #{batchQuantity},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
</trim>
where pallet_code = #{palletCode}
</update>
<select id="selectPalletByUniqueBarCode" resultType="java.lang.Integer" parameterType="ProOrderWorkorder">
select count(pallet_code)
FROM pro_order_workorder_batch_pallet
WHERE pallet_code = #{palletCode}
and add_flag = #{addFlag}
and del_flag = '0'
</select>
<select id="getBatchCode" resultType="ProOrderWorkorder" parameterType="java.lang.String">
select powb.batch_code batchCode
from pro_order_workorder pow
left join pro_order_workorder_batch powb on pow.workorder_id = powb.workorder_id
where powb.del_flag = '0'
and pow.del_flag = '0'
and pow.workorder_id = #{workorderId}
</select>
<insert id="addBatchPallet">
INSERT INTO pro_order_workorder_batch_pallet (
id,workorder_code,batch_code,quantity,pallet_num,
create_time,pallet_code
id,workorder_code,batch_code,quantity,pallet_num,create_by,
create_time,pallet_code,add_flag
)VALUES
<foreach collection="list" item="d" index="index" separator=",">
(
(
#{d.recordId},#{d.workorderCode},#{d.batchCode},#{d.batchQuantity},#{d.palletNo},
#{d.createTime},#{d.palletCode}
)
#{d.createBy},#{d.createTime},#{d.palletCode},#{d.addFlag}
)
</foreach>
</insert>

@ -0,0 +1,114 @@
package com.op.quality.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.poi.ExcelUtil;
import com.op.quality.domain.QcDefectTypeClass;
import com.op.quality.service.IQcDefectTypeClassService;
import com.op.system.api.domain.SysDictData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.op.common.log.annotation.Log;
import com.op.common.log.enums.BusinessType;
import com.op.common.security.annotation.RequiresPermissions;
import com.op.common.core.web.controller.BaseController;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.core.web.page.TableDataInfo;
/**
* -Controller
*
* @author Open Platform
* @date 2024-08-20
*/
@RestController
@RequestMapping("/defectClass")
public class QcDefectTypeClassController extends BaseController {
@Autowired
private IQcDefectTypeClassService qcDefectTypeClassService;
/**
* -
*/
@RequiresPermissions("system:class:list")
@GetMapping("/list")
public TableDataInfo list(QcDefectTypeClass qcDefectTypeClass) {
startPage();
List<QcDefectTypeClass> list = qcDefectTypeClassService.selectQcDefectTypeClassList(qcDefectTypeClass);
return getDataTable(list);
}
/**
* -
*/
@RequiresPermissions("system:class:export")
@Log(title = "故障类型-缺陷描述分类", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, QcDefectTypeClass qcDefectTypeClass) {
List<QcDefectTypeClass> list = qcDefectTypeClassService.selectQcDefectTypeClassList(qcDefectTypeClass);
ExcelUtil<QcDefectTypeClass> util = new ExcelUtil<QcDefectTypeClass>(QcDefectTypeClass. class);
util.exportExcel(response, list, "故障类型-缺陷描述分类数据");
}
/**
* -
*/
@RequiresPermissions("system:class:query")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id) {
return success(qcDefectTypeClassService.selectQcDefectTypeClassById(id));
}
/**
* -
*/
@RequiresPermissions("system:class:add")
@Log(title = "故障类型-缺陷描述分类", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody QcDefectTypeClass qcDefectTypeClass) {
return toAjax(qcDefectTypeClassService.insertQcDefectTypeClass(qcDefectTypeClass));
}
/**
* -
*/
@RequiresPermissions("system:class:edit")
@Log(title = "故障类型-缺陷描述分类", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody QcDefectTypeClass qcDefectTypeClass) {
return toAjax(qcDefectTypeClassService.updateQcDefectTypeClass(qcDefectTypeClass));
}
/**
* -
*/
@RequiresPermissions("system:class:remove")
@Log(title = "故障类型-缺陷描述分类", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids) {
return toAjax(qcDefectTypeClassService.deleteQcDefectTypeClassByIds(ids));
}
@GetMapping("/getClassInfoList")
@DS("#header.poolName")
public AjaxResult getClassInfoList(QcDefectTypeClass qcDefectTypeClass) {
List<QcDefectTypeClass> list = qcDefectTypeClassService.getClassInfoList(qcDefectTypeClass);
return success(list);
}
@GetMapping("/getClassInfoListByCheckType")
@DS("#header.poolName")
public AjaxResult getClassInfoListByCheckType(QcDefectTypeClass qcDefectTypeClass) {
List<QcDefectTypeClass> list = qcDefectTypeClassService.getClassInfoListByCheckType(qcDefectTypeClass);
return success(list);
}
}

@ -8,6 +8,7 @@ import com.op.common.log.annotation.Log;
import com.op.common.log.enums.BusinessType;
import com.op.common.security.annotation.RequiresPermissions;
import com.op.quality.domain.QcCheckType;
import com.op.quality.domain.QcDefectType;
import com.op.quality.service.IQcDefectTypeService;
import org.springframework.beans.factory.annotation.Autowired;
@ -95,4 +96,10 @@ public class QcDefectTypeController extends BaseController {
List<QcDefectType> list = qcDefectTypeService.getDefectTypeListByDefectType(defectType);
return getDataTable(list);
}
@GetMapping("/getCheckTypes")
public List<QcCheckType> getCheckTypes(QcCheckType qcCheckType) {
List<QcCheckType> list = qcDefectTypeService.getCheckTypes(qcCheckType);
return list;
}
}

@ -46,7 +46,7 @@ public class QcInterfaceController {
}
/**
* --
* --
*
* @param qcInterface
* @return
@ -56,6 +56,17 @@ public class QcInterfaceController {
return qcInterfaceService.getCheckProjectsPie(qcInterface);
}
/**
* --
*
* @param qcInterface
* @return
*/
@PostMapping("/getCheckProjectsPieLL")
public List<QcInterface> getCheckProjectsPieLL(@RequestBody QcInterface qcInterface) {
return qcInterfaceService.getCheckProjectsPieLL(qcInterface);
}
/**
* --
*

@ -22,6 +22,7 @@ import com.op.system.api.domain.quality.FactoryDto;
import org.apache.commons.lang.StringUtils;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
@ -72,7 +73,28 @@ public class QcStaticTableController extends BaseController {
}
startPage();
List<QcStaticTable> list = qcStaticTableService.selectQcStaticTableList(qcStaticTable);
return getDataTable(list);
if(!CollectionUtils.isEmpty(list)){
return getDataTable(list);
}
return null;
}
@PostMapping("/getIncomeChartList")
@Log(title = "供应商质量统计图表", businessType = BusinessType.QUERY)
public List<QcStaticTable> getIncomeChartList(@RequestBody QcStaticTable qcStaticTable) {
if (StringUtils.isNotBlank(qcStaticTable.getSupplierCode())) {
List<String> codes = Arrays.asList(qcStaticTable.getSupplierCode().split(","));
qcStaticTable.setSupplierCodes(codes);
}
//默认时间范围T 00:00:00~T+1 00:00:00
if (StringUtils.isEmpty(qcStaticTable.getYearMonth())) {
LocalDate date = LocalDate.now();
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM");
String ymStr = dtf.format(date);
qcStaticTable.setYearMonth(ymStr);//end
}
List<QcStaticTable> list = qcStaticTableService.getIncomeChartList(qcStaticTable);
return list;
}
@RequiresPermissions("quality:qcTableIncome:list")
@ -506,4 +528,16 @@ public class QcStaticTableController extends BaseController {
public List<QcStaticTable> getTableHzNoOkData(@RequestBody QcStaticTable qcStaticTable) {
return qcStaticTableService.getTableHzNoOkData(qcStaticTable);
}
/**
* --
**/
@PostMapping("/getTableHzDataSC")
public List<HashMap> getTableHzDataSC(@RequestBody QcStaticTable qcStaticTable) {
return qcStaticTableService.getTableHzDataSC(qcStaticTable);
}
@PostMapping("/getTableHzNoOkDataSC")
public List<QcStaticTable> getTableHzNoOkDataSC(@RequestBody QcStaticTable qcStaticTable) {
return qcStaticTableService.getTableHzNoOkDataSC(qcStaticTable);
}
}

@ -189,6 +189,26 @@ public class QcCheckReportIncome extends BaseEntity {
private String orderType;
private String standardNo;
private String jgy;
private String pgy;
public String getJgy() {
return jgy;
}
public void setJgy(String jgy) {
this.jgy = jgy;
}
public String getPgy() {
return pgy;
}
public void setPgy(String pgy) {
this.pgy = pgy;
}
public String getStandardNo() {
return standardNo;
}

@ -93,7 +93,15 @@ public class QcCheckTaskDefect extends BaseEntity {
private String defectCodes;
private String defectNames;
private String defectQualitys;
private String classId;
public String getClassId() {
return classId;
}
public void setClassId(String classId) {
this.classId = classId;
}
public String getDefectCodes() {
return defectCodes;
}

@ -138,6 +138,7 @@ public class QcCheckTaskDetail extends BaseEntity {
private String defectCodes;
private String defectNames;
private String defectQualitys;
private String classTypeCodes;
private String itemType;
private String judgeRate;
private String samplePlan;
@ -147,6 +148,14 @@ public class QcCheckTaskDetail extends BaseEntity {
private String sampleAql;
private String checkLevel;
public String getClassTypeCodes() {
return classTypeCodes;
}
public void setClassTypeCodes(String classTypeCodes) {
this.classTypeCodes = classTypeCodes;
}
public String getCheckLevel() {
return checkLevel;
}

@ -75,9 +75,18 @@ public class QcDefectType extends BaseEntity {
// 创建日期结束
private String createTimeEnd;
private String checkType;
private String checkName;
private BigDecimal ratio;
public String getCheckName() {
return checkName;
}
public void setCheckName(String checkName) {
this.checkName = checkName;
}
public String getCheckType() {
return checkType;
}

@ -0,0 +1,152 @@
package com.op.quality.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
/**
* - qc_defect_type_class
*
* @author Open Platform
* @date 2024-08-20
*/
public class QcDefectTypeClass extends BaseEntity {
private static final long serialVersionUID=1L;
/** 主键 */
private String id;
/** 不良类型id */
@Excel(name = "不良类型id")
private String defectId;
/** 不良类型编码 */
@Excel(name = "不良类型编码")
private String defectCode;
/** 缺陷名称 */
@Excel(name = "缺陷名称")
private String className;
/** 工厂编码 */
@Excel(name = "工厂编码")
private String factoryCode;
/** 备用字段1 */
@Excel(name = "备用字段1")
private String attr1;
/** 备用字段2 */
@Excel(name = "备用字段2")
private String attr2;
/** 备用字段3 */
@Excel(name = "备用字段3")
private String attr3;
/** 删除标志 */
private String delFlag;
private String sort;
private String checkType;
public String getCheckType() {
return checkType;
}
public void setCheckType(String checkType) {
this.checkType = checkType;
}
public String getSort() {
return sort;
}
public void setSort(String sort) {
this.sort = sort;
}
public void setId(String id){
this.id = id;
}
public String getId(){
return id;
}
public void setDefectId(String defectId){
this.defectId = defectId;
}
public String getDefectId(){
return defectId;
}
public void setDefectCode(String defectCode){
this.defectCode = defectCode;
}
public String getDefectCode(){
return defectCode;
}
public void setClassName(String className){
this.className = className;
}
public String getClassName(){
return className;
}
public void setFactoryCode(String factoryCode){
this.factoryCode = factoryCode;
}
public String getFactoryCode(){
return factoryCode;
}
public void setAttr1(String attr1){
this.attr1 = attr1;
}
public String getAttr1(){
return attr1;
}
public void setAttr2(String attr2){
this.attr2 = attr2;
}
public String getAttr2(){
return attr2;
}
public void setAttr3(String attr3){
this.attr3 = attr3;
}
public String getAttr3(){
return attr3;
}
public void setDelFlag(String delFlag){
this.delFlag = delFlag;
}
public String getDelFlag(){
return delFlag;
}
@Override
public String toString(){
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id",getId())
.append("defectId",getDefectId())
.append("defectCode",getDefectCode())
.append("className",getClassName())
.append("remark",getRemark())
.append("factoryCode",getFactoryCode())
.append("attr1",getAttr1())
.append("attr2",getAttr2())
.append("attr3",getAttr3())
.append("delFlag",getDelFlag())
.append("createBy",getCreateBy())
.append("createTime",getCreateTime())
.append("updateBy",getUpdateBy())
.append("updateTime",getUpdateTime())
.toString();
}
}

@ -53,6 +53,15 @@ public class QcInterface extends BaseEntity {
private List<String> dataBarArrays;
private List<String> dataLineArrays;
private String equipmentTypeCode;
private String checkType;
public String getCheckType() {
return checkType;
}
public void setCheckType(String checkType) {
this.checkType = checkType;
}
public String getEquipmentTypeCode() {
return equipmentTypeCode;

@ -41,6 +41,7 @@ public class QcStaticTable extends BaseEntity {
private String typeCode;
private String checkResult;
private String noOkBatchRate;
private Double noOkBatchRateVal;
private String shiftId;
private String ymArrayStart;
private String ymArrayEnd;
@ -114,6 +115,14 @@ public class QcStaticTable extends BaseEntity {
private List<String> columns1;
private List<String> columns2;
public Double getNoOkBatchRateVal() {
return noOkBatchRateVal;
}
public void setNoOkBatchRateVal(Double noOkBatchRateVal) {
this.noOkBatchRateVal = noOkBatchRateVal;
}
public String getYmdUntype() {
return ymdUntype;
}

@ -0,0 +1,66 @@
package com.op.quality.mapper;
import com.op.quality.domain.QcDefectTypeClass;
import java.util.List;
/**
* -Mapper
*
* @author Open Platform
* @date 2024-08-20
*/
public interface QcDefectTypeClassMapper {
/**
* -
*
* @param id -
* @return -
*/
public QcDefectTypeClass selectQcDefectTypeClassById(String id);
/**
* -
*
* @param qcDefectTypeClass -
* @return -
*/
public List<QcDefectTypeClass> selectQcDefectTypeClassList(QcDefectTypeClass qcDefectTypeClass);
/**
* -
*
* @param qcDefectTypeClass -
* @return
*/
public int insertQcDefectTypeClass(QcDefectTypeClass qcDefectTypeClass);
/**
* -
*
* @param qcDefectTypeClass -
* @return
*/
public int updateQcDefectTypeClass(QcDefectTypeClass qcDefectTypeClass);
/**
* -
*
* @param id -
* @return
*/
public int deleteQcDefectTypeClassById(String id);
/**
* -
*
* @param ids
* @return
*/
public int deleteQcDefectTypeClassByIds(String[] ids);
List<QcDefectTypeClass> getClassInfoList(QcDefectTypeClass qcDefectTypeClass);
List<QcDefectTypeClass> getClassInfoListByCheckType(QcDefectTypeClass qcDefectTypeClass);
}

@ -1,5 +1,6 @@
package com.op.quality.mapper;
import com.op.quality.domain.QcCheckType;
import com.op.quality.domain.QcDefectType;
import org.apache.ibatis.annotations.Mapper;
@ -70,4 +71,5 @@ public interface QcDefectTypeMapper {
public List<QcDefectType> getDefectTypeListByDefectType(String defectType);
List<QcCheckType> getCheckTypes(QcCheckType qcCheckType);
}

@ -51,4 +51,6 @@ public interface QcInterfaceMapper {
Map<String, QcInterface> getLineChartsDatas(QcInterface qcInterface);
QcInterface getProduceHz1(QcInterface qcInterface);
List<QcInterface> getCheckProjectsPieLL(QcInterface qcInterface);
}

@ -91,4 +91,12 @@ public interface QcStaticTableMapper {
Map<String, QcStaticTable> getNoOkNum(QcStaticTable qcStaticTable);
List<QcStaticTable> getTableHzNoOkData(QcStaticTable qcStaticTable);
@MapKey("ymdms")
Map<String, QcStaticTable> getNoOkRatioNum(QcStaticTable qcStaticTable);
@MapKey("ymdms")
Map<String, QcStaticTable> getSamplesPCNum(QcStaticTable qcStaticTable);
@MapKey("ymdUntype")
Map<String, QcStaticTable> getNoOkPCNum(QcStaticTable qcStaticTable);
List<QcStaticTable> getTableHzNoOkDataSC(QcStaticTable qcStaticTable);
}

@ -0,0 +1,67 @@
package com.op.quality.service;
import com.op.quality.domain.QcDefectTypeClass;
import java.util.List;
/**
* -Service
*
* @author Open Platform
* @date 2024-08-20
*/
public interface IQcDefectTypeClassService {
/**
* -
*
* @param id -
* @return -
*/
public QcDefectTypeClass selectQcDefectTypeClassById(String id);
/**
* -
*
* @param qcDefectTypeClass -
* @return -
*/
public List<QcDefectTypeClass> selectQcDefectTypeClassList(QcDefectTypeClass qcDefectTypeClass);
/**
* -
*
* @param qcDefectTypeClass -
* @return
*/
public int insertQcDefectTypeClass(QcDefectTypeClass qcDefectTypeClass);
/**
* -
*
* @param qcDefectTypeClass -
* @return
*/
public int updateQcDefectTypeClass(QcDefectTypeClass qcDefectTypeClass);
/**
* -
*
* @param ids -
* @return
*/
public int deleteQcDefectTypeClassByIds(String[] ids);
/**
* -
*
* @param id -
* @return
*/
public int deleteQcDefectTypeClassById(String id);
List<QcDefectTypeClass> getClassInfoList(QcDefectTypeClass qcDefectTypeClass);
List<QcDefectTypeClass> getClassInfoListByCheckType(QcDefectTypeClass qcDefectTypeClass);
}

@ -1,6 +1,7 @@
package com.op.quality.service;
import com.op.common.core.web.domain.AjaxResult;
import com.op.quality.domain.QcCheckType;
import com.op.quality.domain.QcDefectType;
import java.util.List;
@ -61,4 +62,6 @@ public interface IQcDefectTypeService {
public int deleteQcDefectTypeByDefectId(String defectId);
public List<QcDefectType> getDefectTypeListByDefectType(String defectType);
List<QcCheckType> getCheckTypes(QcCheckType qcCheckType);
}

@ -38,4 +38,5 @@ public interface IQcInterfaceService {
QcLineChartDto getLineQcData(QcInterface qcInterface);
List<QcInterface> getCheckProjectsPieLL(QcInterface qcInterface);
}

@ -56,4 +56,10 @@ public interface IQcStaticTableService {
List<HashMap> getTableHzData(QcStaticTable qcStaticTable);
List<QcStaticTable> getTableHzNoOkData(QcStaticTable qcStaticTable);
List<HashMap> getTableHzDataSC(QcStaticTable qcStaticTable);
List<QcStaticTable> getTableHzNoOkDataSC(QcStaticTable qcStaticTable);
List<QcStaticTable> getIncomeChartList(QcStaticTable qcStaticTable);
}

@ -750,20 +750,17 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
}
}
if(qcCheckTaskIncome.getSampleQuality()!=null && qcCheckTaskIncome.getSampleQuality().equals(BigDecimal.ZERO)){
qcCheckTask.setSampleQuality(sampleQuality);
}else{
qcCheckTask.setSampleQuality(qcCheckTaskIncome.getSampleQuality());
}
/**qc_check_task_cg**/
List<QcCheckTaskIncome> valiData = qcCheckTaskIncomeMapper.selectQcCheckTaskCgByRecordId(belongId);
// 判断表中是否存在此条数据
if (valiData != null && valiData.size() > 0) {
n = qcCheckTaskIncomeMapper.updateQcCheckTaskCg(qcCheckTask);//updateQcCheckTaskCG
}else {
if(qcCheckTaskIncome.getSampleQuality().equals(BigDecimal.ZERO)){
qcCheckTask.setSampleQuality(sampleQuality);
}else{
qcCheckTask.setSampleQuality(qcCheckTaskIncome.getSampleQuality());
}
qcCheckTask.setCheckNo(qcCheckTaskIncome.getCheckNo());
qcCheckTask.setOrderNo(qcCheckTaskIncome.getOrderNo());
qcCheckTask.setMaterialCode(qcCheckTaskIncome.getMaterialCode());
@ -798,10 +795,16 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
String[] defectCodes = detail.getDefectCodes().split(",");
String[] defectNames = detail.getDefectNames().split(",");
String[] defectQualitys = detail.getDefectQualitys().split(",");
String[] classIds = detail.getClassTypeCodes().split(",");
for(int d=0;d<defectCodes.length;d++){
defect = new QcCheckTaskDefect();
defect.setDefectCode(defectCodes[d]);
defect.setDefectSubclass(defectNames[d].split(":")[0]);
if(d < classIds.length){
defect.setClassId(classIds[d]);
}else{
defect.setClassId("");
}
defect.setNoOkQuality(new BigDecimal(defectQualitys[d]));
defect.setRecordId(IdUtils.fastSimpleUUID());
defect.setCreateTime(nowTime);
@ -899,7 +902,7 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
}
}
if(qcCheckTaskIncome.getSampleQuality().equals(BigDecimal.ZERO)){
if(qcCheckTaskIncome.getSampleQuality()!=null && qcCheckTaskIncome.getSampleQuality().equals(BigDecimal.ZERO)){
qcCheckTask.setSampleQuality(sampleQuality);
}else{
qcCheckTask.setSampleQuality(qcCheckTaskIncome.getSampleQuality());
@ -923,11 +926,17 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
String[] defectCodes = detail.getDefectCodes().split(",");
String[] defectNames = detail.getDefectNames().split(",");
String[] defectQualitys = detail.getDefectQualitys().split(",");
String[] classIds = detail.getClassTypeCodes().split(",");
for(int d=0;d<defectCodes.length;d++){
defect = new QcCheckTaskDefect();
defect.setDefectCode(defectCodes[d]);
defect.setDefectSubclass(defectNames[d].split(":")[0]);
defect.setNoOkQuality(new BigDecimal(defectQualitys[d]));
if(d < classIds.length){
defect.setClassId(classIds[d]);
}else{
defect.setClassId("");
}
defect.setRecordId(IdUtils.fastSimpleUUID());
defect.setCreateTime(nowTime);
defect.setCreateBy(updateBy);
@ -1210,7 +1219,10 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
}
public static void main(String args[]){
QcCheckTaskIncomeServiceImpl impl = new QcCheckTaskIncomeServiceImpl();
System.out.println(impl.getConvertUnit("ST"));
String str = "11,,22,";
System.out.println(str.split(",")[0]);
System.out.println(str.split(",")[1]);
System.out.println(str.split(",")[2]);
}
}

@ -0,0 +1,114 @@
package com.op.quality.service.impl;
import java.security.Security;
import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.security.utils.SecurityUtils;
import com.op.quality.domain.QcDefectTypeClass;
import com.op.quality.mapper.QcDefectTypeClassMapper;
import com.op.quality.service.IQcDefectTypeClassService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* -Service
*
* @author Open Platform
* @date 2024-08-20
*/
@Service
public class QcDefectTypeClassServiceImpl implements IQcDefectTypeClassService {
@Autowired
private QcDefectTypeClassMapper qcDefectTypeClassMapper;
/**
* -
*
* @param id -
* @return -
*/
@Override
@DS("#header.poolName")
public QcDefectTypeClass selectQcDefectTypeClassById(String id) {
return qcDefectTypeClassMapper.selectQcDefectTypeClassById(id);
}
/**
* -
*
* @param qcDefectTypeClass -
* @return -
*/
@Override
@DS("#header.poolName")
public List<QcDefectTypeClass> selectQcDefectTypeClassList(QcDefectTypeClass qcDefectTypeClass) {
return qcDefectTypeClassMapper.selectQcDefectTypeClassList(qcDefectTypeClass);
}
/**
* -
*
* @param qcDefectTypeClass -
* @return
*/
@Override
@DS("#header.poolName")
public int insertQcDefectTypeClass(QcDefectTypeClass qcDefectTypeClass) {
qcDefectTypeClass.setCreateTime(DateUtils.getNowDate());
qcDefectTypeClass.setId(IdUtils.fastSimpleUUID());
qcDefectTypeClass.setCreateBy(SecurityUtils.getUsername());
return qcDefectTypeClassMapper.insertQcDefectTypeClass(qcDefectTypeClass);
}
/**
* -
*
* @param qcDefectTypeClass -
* @return
*/
@Override
@DS("#header.poolName")
public int updateQcDefectTypeClass(QcDefectTypeClass qcDefectTypeClass) {
qcDefectTypeClass.setUpdateTime(DateUtils.getNowDate());
qcDefectTypeClass.setUpdateBy(SecurityUtils.getUsername());
return qcDefectTypeClassMapper.updateQcDefectTypeClass(qcDefectTypeClass);
}
/**
* -
*
* @param ids -
* @return
*/
@Override
@DS("#header.poolName")
public int deleteQcDefectTypeClassByIds(String[] ids) {
return qcDefectTypeClassMapper.deleteQcDefectTypeClassByIds(ids);
}
/**
* -
*
* @param id -
* @return
*/
@Override
@DS("#header.poolName")
public int deleteQcDefectTypeClassById(String id) {
return qcDefectTypeClassMapper.deleteQcDefectTypeClassById(id);
}
@Override
public List<QcDefectTypeClass> getClassInfoList(QcDefectTypeClass qcDefectTypeClass) {
return qcDefectTypeClassMapper.getClassInfoList(qcDefectTypeClass);
}
@Override
public List<QcDefectTypeClass> getClassInfoListByCheckType(QcDefectTypeClass qcDefectTypeClass) {
return qcDefectTypeClassMapper.getClassInfoListByCheckType(qcDefectTypeClass);
}
}

@ -5,6 +5,7 @@ import com.op.common.core.context.SecurityContextHolder;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.core.web.domain.AjaxResult;
import com.op.quality.domain.QcCheckType;
import com.op.quality.domain.QcDefectType;
import com.op.quality.mapper.QcDefectTypeMapper;
import com.op.quality.service.IQcDefectTypeService;
@ -172,4 +173,11 @@ public class QcDefectTypeServiceImpl implements IQcDefectTypeService {
public List<QcDefectType> getDefectTypeListByDefectType(String defectType) {
return qcDefectTypeMapper.getDefectTypeListByDefectType(defectType);
}
@Override
@DS("#header.poolName")
public List<QcCheckType> getCheckTypes(QcCheckType qcCheckType) {
return qcDefectTypeMapper.getCheckTypes(qcCheckType);
}
}

@ -3,10 +3,11 @@ package com.op.quality.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.StringUtils;
import com.op.quality.domain.*;
import com.op.quality.mapper.QcInterfaceMapper;
import com.op.quality.mapper.QcStaticTableMapper;
import com.op.quality.service.IQcInterfaceService;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
@ -29,6 +30,8 @@ import java.util.*;
public class QcInterfaceServiceImpl implements IQcInterfaceService {
@Autowired
private QcInterfaceMapper qcInterfaceMapper;
@Autowired
private QcStaticTableMapper qcStaticTableMapper;
@Override
public List<QcInterface> getDictData(QcInterface qcInterface) {
@ -42,37 +45,47 @@ public class QcInterfaceServiceImpl implements IQcInterfaceService {
String nowYMD = DateUtils.getDate();
qcInterface.setYmd(nowYMD);
//发布会
// List<QcInterface> dtos = qcInterfaceMapper.getOverallInfo(qcInterface);
// if (!CollectionUtils.isEmpty(dtos) && dtos.size() == 2) {
// QcInterface qif = new QcInterface();
// qif.setYmdTypeName("okRate");
// if (dtos.get(1).getQuality().equals("0")) {
// qif.setQuality("100%");
// } else {
// BigDecimal okRate = (new BigDecimal(dtos.get(0).getQuality())
// .subtract(new BigDecimal(dtos.get(1).getQuality())))
// .multiply(new BigDecimal("100"))
// .divide(new BigDecimal(dtos.get(0).getQuality()), 2, RoundingMode.HALF_UP);
// qif.setQuality(okRate.toString() + "%");
// }
// dtos.add(qif);
// }
/**质量看板测试开始**/
List<QcInterface> dtos = new ArrayList<>();
QcInterface qi0 = new QcInterface();
qi0.setYmdTypeName("all");
qi0.setQuality("33");
dtos.add(qi0);
QcInterface qi1 = new QcInterface();
qi1.setYmdTypeName("unOk");
qi1.setQuality("0");
dtos.add(qi1);
QcInterface qi2 = new QcInterface();
qi2.setYmdTypeName("okRate");
qi2.setQuality("100%");
dtos.add(qi2);
/**质量看板测试结束**/
qcInterface.setTypeCode("checkTypeLL");
List<QcInterface> dtos = qcInterfaceMapper.getOverallInfo(qcInterface);
if (!CollectionUtils.isEmpty(dtos)) {
QcInterface qi0 = new QcInterface();
qi0.setYmdTypeName("all");
qi0.setQuality(dtos.get(0).getQuality());
dtos.add(qi0);
QcInterface qi1 = new QcInterface();
qi1.setYmdTypeName("unOk");
qi1.setQuality(dtos.get(0).getNoOkQuality());
dtos.add(qi1);
QcInterface qif = new QcInterface();
qif.setYmdTypeName("okRate");
if (dtos.get(0).getNoOkQuality().equals("0.00")) {
qif.setQuality("100%");
} else {
BigDecimal okRate = (new BigDecimal(dtos.get(0).getQuality())
.subtract(new BigDecimal(dtos.get(0).getNoOkQuality())))
.multiply(new BigDecimal("100"))
.divide(new BigDecimal(dtos.get(0).getQuality()), 2, RoundingMode.HALF_UP);
qif.setQuality(okRate.toString() + "%");
}
dtos.add(qif);
dtos.remove(0);
}else{
}
// /**质量看板测试开始**/
// QcInterface qi0 = new QcInterface();
// qi0.setYmdTypeName("all");
// qi0.setQuality("0");
// dtos.add(qi0);
// QcInterface qi1 = new QcInterface();
// qi1.setYmdTypeName("unOk");
// qi1.setQuality("0");
// dtos.add(qi1);
// QcInterface qi2 = new QcInterface();
// qi2.setYmdTypeName("okRate");
// qi2.setQuality("0.00%");
// dtos.add(qi2);
// /**质量看板测试结束**/
return dtos;
}
@ -86,12 +99,24 @@ public class QcInterfaceServiceImpl implements IQcInterfaceService {
return dtos;
}
@Override
public List<QcInterface> getCheckProjectsPieLL(QcInterface qcInterface) {
DynamicDataSourceContextHolder.push(qcInterface.getFactoryCode());
String nowYMD = DateUtils.getDate();
qcInterface.setYmd(nowYMD);
qcInterface.setCheckType("checkTypeLL");
List<QcInterface> dtos = qcInterfaceMapper.getCheckProjectsPieLL(qcInterface);
return dtos;
}
@Override
public List<QcInterface> getSupplierBadTOP5(QcInterface qcInterface) {
DynamicDataSourceContextHolder.push(qcInterface.getFactoryCode());
String nowYMD = DateUtils.getDate();
qcInterface.setYmd(nowYMD);
qcInterface.setCheckType("checkTypeLL");
List<QcInterface> dtos = qcInterfaceMapper.getSupplierBadTOP5(qcInterface);
return dtos;
}
@ -138,68 +163,6 @@ public class QcInterfaceServiceImpl implements IQcInterfaceService {
dto.setCheckStatus("0".equals(dto.getCheckStatus()) ? "待检测" : "检测完成");
dto.setCheckResult("Y".equals(dto.getCheckResult()) ? "合格" : "不合格");
}
// /**质量看板测试开始**/
// QcInterface q0 = new QcInterface();
// q0.setCheckNo("20240305001");
// q0.setIncomeBatchNo("20270122LJ20240123BBBA0G");
// q0.setOrderNo("000800000083-1");
// q0.setMaterialName("10小时无烟型黑蚊香(繁体)纸盒");
// q0.setQuality("19000");
// q0.setUnit("个");
// q0.setSupplierName("中山市粤华包装有限公司");
// q0.setIncomeTime("2024-03-05 00:00:00");
// q0.setCheckTime("2024-03-05 11:32:00");
// q0.setCheckResult("合格");
// q0.setCheckManName("马娥章");
// q0.setCheckName("来料检验");
// dtos.add(q0);
//
// QcInterface q1 = new QcInterface();
// q1.setCheckNo("20240306002");
// q1.setIncomeBatchNo("20270122LJ20240123BCCA0F");
// q1.setOrderNo("0008000001093-1");
// q1.setMaterialName("依素猫狗(黄色)气雾盖");
// q1.setQuality("5000");
// q1.setUnit("个");
// q1.setSupplierName("广州盛盈环保科技有限公司");
// q1.setIncomeTime("2024-03-05 00:00:00");
// q1.setCheckTime("2024-03-05 13:32:00");
// q1.setCheckResult("合格");
// q1.setCheckManName("马娥章");
// q1.setCheckName("来料检验");
// dtos.add(q1);
//
// QcInterface q2 = new QcInterface();
// q2.setCheckNo("20240307002");
// q2.setIncomeBatchNo("20270122LJ20240456BCCA0D");
// q2.setOrderNo("0008000001193-1");
// q2.setMaterialName("King Brand蚊片(450装)纸箱");
// q2.setQuality("5800");
// q2.setUnit("个");
// q2.setSupplierName("广州市网能产品设计有限公司");
// q2.setIncomeTime("2024-08-06 00:00:00");
// q2.setCheckTime("2024-08-06 13:42:00");
// q2.setCheckResult("合格");
// q2.setCheckManName("马娥章");
// q2.setCheckName("来料检验");
// dtos.add(q2);
//
// QcInterface q3 = new QcInterface();
// q3.setCheckNo("20240308001");
// q3.setIncomeBatchNo("20270122LJ20240456BCBB0D");
// q3.setOrderNo("0008000001203-1");
// q3.setMaterialName("榄菊牌清香型蚊液(空白)纸箱");
// q3.setQuality("7800");
// q3.setUnit("个");
// q3.setSupplierName("广州市网能产品设计有限公司");
// q3.setCheckTime("2024-03-05 13:50:00");
// q3.setIncomeTime("2024-08-06 00:00:00");
// q3.setCheckResult("合格");
// q3.setCheckManName("马娥章");
// q3.setCheckName("来料检验");
// dtos.add(q3);
//
// /**质量看板测试结束**/
return dtos;
}
@ -398,7 +361,7 @@ public class QcInterfaceServiceImpl implements IQcInterfaceService {
List<String> dataLine0 = new ArrayList<>();//不合格率
for (String day0 : daystr0) {
QcInterface last = noOkNum.get(day0);
if (last != null) {
if (last != null&& !"0.00".equals(last.getQuality())) {
dataBar0.add(last.getNoOkQuality());
BigDecimal norate0 = new BigDecimal(last.getNoOkQuality()).multiply(new BigDecimal(100))
.divide(new BigDecimal(last.getQuality()), 2, RoundingMode.HALF_UP);
@ -413,7 +376,7 @@ public class QcInterfaceServiceImpl implements IQcInterfaceService {
List<String> dataLine1 = new ArrayList<>();//不合格率
for (String day1 : daystr1) {
QcInterface now = noOkNum.get(day1);
if (now != null) {
if (now != null && !"0.00".equals(now.getQuality())) {
dataBar1.add(now.getNoOkQuality());
BigDecimal norate0 = new BigDecimal(now.getNoOkQuality()).multiply(new BigDecimal(100))
.divide(new BigDecimal(now.getQuality()), 2, RoundingMode.HALF_UP);

@ -166,6 +166,7 @@ public class QcProCheckServiceImpl implements QcProCheckService {
qcd.setDefectCodes(defectInfo.getDefectCodes());
qcd.setDefectNames(defectInfo.getDefectNames());
qcd.setDefectQualitys(defectInfo.getDefectQualitys());
qcd.setClassTypeCodes(defectInfo.getClassId());
}
}
@ -205,6 +206,7 @@ public class QcProCheckServiceImpl implements QcProCheckService {
qcd.setDefectCodes(defectInfo.getDefectCodes());
qcd.setDefectNames(defectInfo.getDefectNames());
qcd.setDefectQualitys(defectInfo.getDefectQualitys());
qcd.setClassTypeCodes(defectInfo.getClassId());
}
}

@ -118,9 +118,65 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService {
}
}
return tabledtos;
// return tabledtos.stream()
// .filter(obj -> obj.getBatchs() != 0)
// .collect(Collectors.toList());
}
@Override
@DS("#header.poolName")
public List<QcStaticTable> getIncomeChartList(QcStaticTable qcStaticTable) {
qcStaticTable.setTypeCode("material");
/**base_supplier**供应商**/
List<QcStaticTable> tabledtos = qcStaticTableMapper.selectQcStaticTableList(qcStaticTable);
if (CollectionUtils.isEmpty(tabledtos)) {
return null;
}
/**qc_check_task**总批数**/
Map<String, QcStaticTable> pcMap = qcStaticTableMapper.selectPcMap(qcStaticTable, tabledtos);
if (pcMap == null) {
return null;
}
/**qc_check_task**不合格批次数**/
qcStaticTable.setCheckResult("N");
Map<String, QcStaticTable> noOkPcMap = qcStaticTableMapper.selectPcMap(qcStaticTable, tabledtos);
for (QcStaticTable tabledto : tabledtos) {
QcStaticTable pcdto = pcMap.get(tabledto.getSupplierCode());
QcStaticTable numdto = noOkPcMap.get(tabledto.getSupplierCode());
if (pcdto != null) {
//总批次
tabledto.setBatchs(pcdto.getBatchs());
//总数量
tabledto.setNums(pcdto.getNums());
} else {
tabledto.setBatchs(0);
tabledto.setNums(0);
}
if (numdto != null) {
//不合格批次
tabledto.setNoOkBatchs(numdto.getBatchs());
} else {
tabledto.setNoOkBatchs(0);
}
//合格批次
int okBatchs = tabledto.getBatchs() - tabledto.getNoOkBatchs();
tabledto.setOkBatchs(okBatchs);
//批次不良率
if (tabledto.getBatchs() != 0) {
BigDecimal noOkBatchRate = new BigDecimal(tabledto.getNoOkBatchs()).multiply(new BigDecimal("100.00"))
.divide(new BigDecimal(tabledto.getBatchs()), BigDecimal.ROUND_CEILING)
.setScale(2, BigDecimal.ROUND_HALF_UP);
tabledto.setNoOkBatchRate(noOkBatchRate.toString() + "%");
tabledto.setNoOkBatchRateVal(noOkBatchRate.doubleValue());
} else {
tabledto.setNoOkBatchRate("0.00%");
tabledto.setNoOkBatchRateVal(0.00);
}
}
tabledtos = tabledtos.stream()
.filter(pieData -> !pieData.getNoOkBatchRate().equals("0.00%"))
.sorted(Comparator.comparingDouble(QcStaticTable::getNoOkBatchRateVal).reversed())
.collect(java.util.stream.Collectors.toList());
return tabledtos;
}
/**
@ -792,18 +848,13 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService {
@DS("#header.poolName")
public QcStaticTable getTableHzTitle(QcStaticTable qcStaticTable) {
QcStaticTable dto = new QcStaticTable();
qcStaticTable.setDataType("unqualified_remark");
//qcStaticTable.setDataType("unqualified_remark");
qcStaticTable.setRemark(qcStaticTable.getCheckType());
List<String> cols1 = qcStaticTableMapper.getTableHzTitle(qcStaticTable);
if(CollectionUtils.isEmpty(cols1)){
return dto;
}
dto.setColumns1(cols1);
// List<String> cols2 = qcStaticTableMapper.getTableHzTitle2(qcStaticTable);
//
// dto.setColumns2(cols2);
return dto;
}
@ -882,22 +933,24 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService {
}
return days;
}
/**巡检**/
@Override
@DS("#header.poolName")
public List<HashMap> getTableHzData(QcStaticTable qcStaticTable) {
List<HashMap> dtos = new ArrayList<>();
qcStaticTable.setDataType("unqualified_remark");
//qcStaticTable.setDataType("unqualified_remark");
qcStaticTable.setRemark(qcStaticTable.getCheckType());
List<String> noOkTyps = qcStaticTableMapper.getTableHzTitle(qcStaticTable);
//第一列日期
List<String> days = this.getHzDays(qcStaticTable.getIncomeTimeStr(),qcStaticTable.getYmdms());
//抽样数、不良数、不良率
//抽样数
Map<String,QcStaticTable> samples = qcStaticTableMapper.getSamplesNum(qcStaticTable);
if(samples.isEmpty()){
return dtos;
}
//不良数
//不良数(折算后)、不良率
Map<String,QcStaticTable> noOkNumRs = qcStaticTableMapper.getNoOkRatioNum(qcStaticTable);
//不良数(不折算)
Map<String,QcStaticTable> noOks = qcStaticTableMapper.getNoOkNum(qcStaticTable);
HashMap colMap = null;
for(String col:days){
@ -905,9 +958,10 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService {
colMap.put("timeCol",col);
String samKey = col;
QcStaticTable sampl = samples.get(samKey);
if(sampl!=null&&!sampl.getSampleQuality().equals("0.00")){
QcStaticTable noOkNumR = noOkNumRs.get(samKey);
if(sampl!=null&&!sampl.getSampleQuality().equals("0.00")&&noOkNumR!=null && !noOkNumR.getNoOkQuality().equals("0.00")){
colMap.put("sampleQuality",sampl.getSampleQuality().replaceAll("\\..*", ""));
BigDecimal noOkRate = new BigDecimal(sampl.getNoOkQuality()).multiply(new BigDecimal("100.00"))
BigDecimal noOkRate = new BigDecimal(noOkNumR.getNoOkQuality()).multiply(new BigDecimal("100.00"))
.divide(new BigDecimal(sampl.getSampleQuality()),2, BigDecimal.ROUND_HALF_UP);
colMap.put("noOkRate",noOkRate);
}else{
@ -932,7 +986,6 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService {
return dtos;
}
@Override
@DS("#header.poolName")
public List<QcStaticTable> getTableHzNoOkData(QcStaticTable qcStaticTable) {
@ -953,7 +1006,75 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService {
}
return dtos;
}
/**首检**/
@Override
@DS("#header.poolName")
public List<HashMap> getTableHzDataSC(QcStaticTable qcStaticTable) {
List<HashMap> dtos = new ArrayList<>();
qcStaticTable.setRemark(qcStaticTable.getCheckType());
List<String> noOkTyps = qcStaticTableMapper.getTableHzTitle(qcStaticTable);
//第一列日期
List<String> days = this.getHzDays(qcStaticTable.getIncomeTimeStr(),qcStaticTable.getYmdms());
//抽样批次数、不合格数
Map<String,QcStaticTable> samples = qcStaticTableMapper.getSamplesPCNum(qcStaticTable);
if(samples.isEmpty()){
return dtos;
}
HashMap colMap = null;
for(String col:days){
colMap = new HashMap();
colMap.put("timeCol",col);
String samKey = col;
QcStaticTable sampl = samples.get(samKey);
if(sampl!=null&&!sampl.getSampleQuality().equals("0.00")){
colMap.put("sampleQuality",sampl.getSampleQuality().replaceAll("\\..*", ""));
BigDecimal noOkRate = new BigDecimal(sampl.getNoOkQuality()).multiply(new BigDecimal("100.00"))
.divide(new BigDecimal(sampl.getSampleQuality()),2, BigDecimal.ROUND_HALF_UP);
colMap.put("noOkRate",noOkRate);
}else{
colMap.put("sampleQuality","0");
colMap.put("noOkRate","0");
}
//不良数(不折算)
Map<String,QcStaticTable> noOks = qcStaticTableMapper.getNoOkPCNum(qcStaticTable);
//缺陷不良
for(int i=0;i< noOkTyps.size();i++){
String noOkTyp = noOkTyps.get(i);
String noOkTypeKey = col+noOkTyp;
QcStaticTable noOk = noOks.get(noOkTypeKey);
if(noOk!=null&&noOk.getNoOkQuality()!=null) {
colMap.put("col"+i, noOk.getNoOkQuality().replaceAll("\\..*", ""));
}else{
colMap.put("col"+i, "0");
}
}
dtos.add(colMap);
}
return dtos;
}
@Override
@DS("#header.poolName")
public List<QcStaticTable> getTableHzNoOkDataSC(QcStaticTable qcStaticTable) {
//不良数
List<QcStaticTable> dtos = qcStaticTableMapper.getTableHzNoOkDataSC(qcStaticTable);
BigDecimal totalNoOkQuality = BigDecimal.ZERO;
//求不良数和
for (QcStaticTable dto : dtos) {
totalNoOkQuality = totalNoOkQuality.add(new BigDecimal(dto.getNoOkQuality()));
}
//求占比
for (QcStaticTable dto : dtos) {
BigDecimal noOkratio = new BigDecimal(dto.getNoOkQuality())
.divide(totalNoOkQuality,2, BigDecimal.ROUND_HALF_UP);
dto.setNoOkNumRate(noOkratio.toString());
dto.setNoOkQuality(dto.getNoOkQuality().replaceAll("\\..*", ""));
}
return dtos;
}
/****/
public List<String> getHzDays(String timeStr,String ymd) {
// 返回的日期集合

@ -13,13 +13,15 @@ spring:
cloud:
nacos:
discovery:
namespace: lanju-op
group: chj
#命名空间
namespace: lanju-op-test
group: test
# 服务注册地址
server-addr: 192.168.202.20:8848
config:
namespace: lanju-op
group: chj
#命名空间
namespace: lanju-op-test
group: test
# 服务注册地址
server-addr: 192.168.202.20:8848
# 配置文件格式

@ -97,7 +97,7 @@
qct.check_status, qct.check_man_code, qct.check_man_name,
qct.check_time, qct.check_result, qct.status, qct.check_type, qct.attr1, qct.attr2, qct.attr3, qct.attr4,
qct.create_by, qct.create_time, qct.update_by, qct.update_time,
qct.factory_code, qct.del_flag,qct.reason,qct.product_type,qct.order_type,
qct.factory_code, qct.del_flag,qct.reason,qct.product_type,qct.order_type,qct.jgy,qct.pgy,
bp.mvgr5 standardNo
from qc_check_task qct
left join base_product bp on bp.product_code = qct.material_code

@ -158,7 +158,14 @@
WHERE belong_to_detail = qctd.belong_to_detail and belong_to = qctd.belong_to
FOR xml path('')
),1,1,''
) defectQualitys
) defectQualitys,
STUFF(
(SELECT ',' + CAST(class_id AS VARCHAR(40))
FROM qc_check_task_defect
WHERE belong_to_detail = qctd.belong_to_detail and belong_to = qctd.belong_to
FOR xml path('')
),1,1,''
) classId
FROM qc_check_task_defect qctd where qctd.del_flag = '0' and belong_to= #{belongTo}
and belong_to_detail is not null
GROUP by qctd.belong_to,qctd.belong_to_detail

@ -570,13 +570,19 @@
order by qctd.defect_code
</select>
<select id="getDefectType" resultType="com.op.quality.domain.QcCheckTaskDefect">
select
<!--select
defect_code defectCode,
defect_subclass defectSubclass
from qc_defect_type qdt
left join qc_check_type qct on qdt.defect_type = qct.type_code
where qct.order_code = #{checkType} and qdt.del_flag = '0'
order by qdt.defect_code
order by qdt.defect_code-->
select
defect_code defectCode,
defect_subclass defectSubclass
from qc_defect_type qdt
where qdt.defect_type = #{checkType} and qdt.del_flag = '0'
order by qdt.defect_code
</select>
<select id="getTaskInfo" resultType="com.op.quality.domain.QcCheckTaskIncome">
@ -686,14 +692,14 @@
insert into qc_check_task_defect(
record_id,belong_to,belong_to_detail,
defect_code,defect_subclass,
noOk_quality,
noOk_quality,class_id,
create_by,create_time,factory_code
) values
<foreach item="item" index="index" collection="list" separator=",">
(
#{item.recordId},#{item.belongTo},#{item.belongToDetail},
#{item.defectCode},#{item.defectSubclass},
#{item.noOkQuality},
#{item.noOkQuality},#{item.classId},
#{item.createBy},#{item.createTime},#{item.factoryCode}
)
</foreach>

@ -141,12 +141,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
order by wpp.create_time desc
</select>
<select id="getDefectListPDA" resultType="com.op.quality.domain.QcDefectType">
select qdt.defect_code defectCode,
<!--select qdt.defect_code defectCode,
qdt.defect_subclass defectSubclass
from qc_defect_type qdt
left join qc_check_type qct on qdt.defect_type = qct.type_code
where qct.order_code = #{checkType} and qdt.del_flag='0'
order by qdt.create_time
order by qdt.create_time-->
select
defect_code defectCode,
defect_subclass defectSubclass
from qc_defect_type qdt
where qdt.defect_type = #{checkType} and qdt.del_flag = '0'
order by qdt.defect_code
</select>
<insert id="insertQcCheckUnqualified" parameterType="QcCheckUnqualified">

@ -0,0 +1,202 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.op.quality.mapper.QcDefectTypeClassMapper">
<resultMap type="QcDefectTypeClass" id="QcDefectTypeClassResult">
<result property="id" column="id"/>
<result property="defectId" column="defect_id"/>
<result property="defectCode" column="defect_code"/>
<result property="className" column="class_name"/>
<result property="remark" column="remark"/>
<result property="factoryCode" column="factory_code"/>
<result property="attr1" column="attr1"/>
<result property="attr2" column="attr2"/>
<result property="attr3" column="attr3"/>
<result property="delFlag" column="del_flag"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="sort" column="sort"/>
</resultMap>
<sql id="selectQcDefectTypeClassVo">
select id, defect_id, defect_code, class_name, remark, factory_code, attr1,
attr2, attr3, del_flag, create_by, create_time, update_by, update_time ,sort
from qc_defect_type_class
</sql>
<select id="selectQcDefectTypeClassList" parameterType="QcDefectTypeClass" resultMap="QcDefectTypeClassResult">
<include refid="selectQcDefectTypeClassVo"/>
<where>
<if test="defectId != null and defectId != ''">
and defect_id = #{defectId}
</if>
<if test="defectCode != null and defectCode != ''">
and defect_code = #{defectCode}
</if>
<if test="className != null and className != ''">
and class_name like concat('%', #{className}, '%')
</if>
<if test="factoryCode != null and factoryCode != ''">
and factory_code = #{factoryCode}
</if>
<if test="attr1 != null and attr1 != ''">
and attr1 = #{attr1}
</if>
<if test="attr2 != null and attr2 != ''">
and attr2 = #{attr2}
</if>
<if test="attr3 != null and attr3 != ''">
and attr3 = #{attr3}
</if>
</where>
</select>
<select id="selectQcDefectTypeClassById" parameterType="String"
resultMap="QcDefectTypeClassResult">
<include refid="selectQcDefectTypeClassVo"/>
where id = #{id}
</select>
<select id="getClassInfoList" resultType="com.op.quality.domain.QcDefectTypeClass">
select id,
class_name className
from qc_defect_type_class
where defect_code = #{defectCode}
and del_flag = '0'
order by sort
</select>
<select id="getClassInfoListByCheckType" resultType="com.op.quality.domain.QcDefectTypeClass">
select id,
class_name className
from qc_defect_type_class
where defect_code in(select defect_code from qc_defect_type where del_flag='0' and defect_type = #{checkType})
and del_flag = '0'
order by sort
</select>
<insert id="insertQcDefectTypeClass" parameterType="QcDefectTypeClass">
insert into qc_defect_type_class
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,
</if>
<if test="defectId != null and defectId != ''">defect_id,
</if>
<if test="defectCode != null and defectCode != ''">defect_code,
</if>
<if test="className != null">class_name,
</if>
<if test="remark != null">remark,
</if>
<if test="factoryCode != null and factoryCode != ''">factory_code,
</if>
<if test="attr1 != null">attr1,
</if>
<if test="attr2 != null">attr2,
</if>
<if test="attr3 != null">attr3,
</if>
<if test="delFlag != null and delFlag != ''">del_flag,
</if>
<if test="createBy != null and createBy != ''">create_by,
</if>
<if test="createTime != null">create_time,
</if>
<if test="updateBy != null and updateBy != ''">update_by,
</if>
<if test="updateTime != null">update_time,
</if>
<if test="sort != null">sort,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},
</if>
<if test="defectId != null and defectId != ''">#{defectId},
</if>
<if test="defectCode != null and defectCode != ''">#{defectCode},
</if>
<if test="className != null">#{className},
</if>
<if test="remark != null">#{remark},
</if>
<if test="factoryCode != null and factoryCode != ''">#{factoryCode},
</if>
<if test="attr1 != null">#{attr1},
</if>
<if test="attr2 != null">#{attr2},
</if>
<if test="attr3 != null">#{attr3},
</if>
<if test="delFlag != null and delFlag != ''">#{delFlag},
</if>
<if test="createBy != null and createBy != ''">#{createBy},
</if>
<if test="createTime != null">#{createTime},
</if>
<if test="updateBy != null and updateBy != ''">#{updateBy},
</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="sort != null">#{sort},</if>
</trim>
</insert>
<update id="updateQcDefectTypeClass" parameterType="QcDefectTypeClass">
update qc_defect_type_class
<trim prefix="SET" suffixOverrides=",">
<if test="defectId != null and defectId != ''">defect_id =
#{defectId},
</if>
<if test="defectCode != null and defectCode != ''">defect_code =
#{defectCode},
</if>
<if test="className != null">class_name =
#{className},
</if>
<if test="remark != null">remark =
#{remark},
</if>
<if test="factoryCode != null and factoryCode != ''">factory_code =
#{factoryCode},
</if>
<if test="attr1 != null">attr1 =
#{attr1},
</if>
<if test="attr2 != null">attr2 =
#{attr2},
</if>
<if test="attr3 != null">attr3 =
#{attr3},
</if>
<if test="delFlag != null and delFlag != ''">del_flag =
#{delFlag},
</if>
<if test="createBy != null and createBy != ''">create_by =
#{createBy},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
<if test="updateBy != null and updateBy != ''">update_by =
#{updateBy},
</if>
<if test="updateTime != null">update_time =
#{updateTime},
</if>
<if test="sort != null">sort = #{sort},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteQcDefectTypeClassById" parameterType="String">
delete from qc_defect_type_class where id = #{id}
</delete>
<delete id="deleteQcDefectTypeClassByIds" parameterType="String">
delete from qc_defect_type_class where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

@ -20,6 +20,8 @@
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="ratio" column="ratio" />
<result property="checkName" column="check_name"/>
</resultMap>
<sql id="selectQcDefectTypeVo">
@ -30,30 +32,29 @@
</sql>
<select id="selectQcDefectTypeList" parameterType="QcDefectType" resultMap="QcDefectTypeResult">
<include refid="selectQcDefectTypeVo"/>
select qdt.defect_id, qdt.defect_code, qdt.defect_type, qdt.defect_subclass, qdt.defect_remark,
qdt.factory_code, qdt.attr1, qdt.attr2, qdt.attr3,
qdt.create_by, qdt.create_time, qdt.update_by, qdt.update_time,qdt.ratio,qct.check_name
from qc_defect_type qdt
left join qc_check_type qct on qdt.defect_type = qct.id
<where>
<if test="defectCode != null and defectCode != ''">and defect_code like concat('%', #{defectCode}, '%')
<if test="defectCode != null and defectCode != ''">and qdt.defect_code like concat('%', #{defectCode}, '%')
</if>
<if test="defectType != null and defectType != ''">and defect_type like concat('%', #{defectType}, '%')
<if test="defectType != null and defectType != ''">and qdt.defect_type = #{defectType}
</if>
<if test="defectSubclass != null and defectSubclass != ''">and defect_subclass like concat('%',
<if test="defectSubclass != null and defectSubclass != ''">and qdt.defect_subclass like concat('%',
#{defectSubclass}, '%')
</if>
<if test="defectRemark != null and defectRemark != ''">and defect_remark = #{defectRemark}</if>
<if test="factoryCode != null and factoryCode != ''">and factory_code = #{factoryCode}</if>
<if test="attr1 != null and attr1 != ''">and attr1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''">and attr2 = #{attr2}</if>
<if test="attr3 != null and attr3 != ''">and attr3 = #{attr3}</if>
<if test="delFlag != null and delFlag != ''">and del_flag = #{delFlag}</if>
<if test="createTimeStart != null ">and CONVERT(date,create_time) >= #{createTimeStart}</if>
<if test="createTimeEnd != null ">and #{createTimeEnd} >= CONVERT(date,create_time)</if>
<if test="createBy != null and createBy != ''">and create_by like concat('%', #{createBy}, '%')</if>
<if test="updateTimeStart != null ">and CONVERT(date,update_time) >= #{updateTimeStart}</if>
<if test="updateTimeEnd != null ">and #{updateTimeEnd} >= CONVERT(date,update_time)</if>
<if test="updateBy != null and updateBy != ''">and update_by like concat('%', #{updateBy}, '%')</if>
and del_flag = '0'
<if test="defectRemark != null and defectRemark != ''">and qdt.defect_remark = #{defectRemark}</if>
<if test="createTimeStart != null ">and CONVERT(date,qdt.create_time) >= #{createTimeStart}</if>
<if test="createTimeEnd != null ">and #{createTimeEnd} >= CONVERT(date,qdt.create_time)</if>
<if test="createBy != null and createBy != ''">and qdt.create_by like concat('%', #{createBy}, '%')</if>
<if test="updateTimeStart != null ">and CONVERT(date,qdt.update_time) >= #{updateTimeStart}</if>
<if test="updateTimeEnd != null ">and #{updateTimeEnd} >= CONVERT(date,qdt.update_time)</if>
<if test="updateBy != null and updateBy != ''">and qdt.update_by like concat('%', #{updateBy}, '%')</if>
and qdt.del_flag = '0' and qct.del_flag = '0'
</where>
ORDER BY create_time DESC
ORDER BY qct.check_name DESC
</select>
<select id="selectQcDefectTypeByDefectId" parameterType="String" resultMap="QcDefectTypeResult">
@ -142,4 +143,7 @@
where defect_type = #{defectType}
order by defect_code
</select>
<select id="getCheckTypes" resultType="com.op.quality.domain.QcCheckType">
select id,check_name checkName from qc_check_type where del_flag = '0' order by type_code
</select>
</mapper>

@ -12,35 +12,43 @@
where dict_type = #{dictType} and status = '0'
</select>
<select id="getOverallInfo" resultType="com.op.quality.domain.QcInterface">
select count(0) quality,'all' ymdTypeName
from wms_raw_order_in
where active_flag = '1'
<if test='ymdType=="yyyy"'>
and CONVERT(varchar(4),receipt_time, 120) = SUBSTRING(#{ymd},0,5)
<if test="ymdType == 'yyyy'">
select SUM(CASE WHEN check_result = 'N' THEN 1 ELSE 0 END) noOkQuality,
count(0) quality
FROM(
select check_result
from qc_check_task qct
where check_type = #{typeCode} and check_status = '2'
and CONVERT(varchar(4),qct.create_time, 120) = SUBSTRING(#{ymd},0,5)
and del_flag = '0'
) t
</if>
<if test='ymdType=="mm"'>
and CONVERT(varchar(7),receipt_time, 120) =SUBSTRING(#{ymd},0,8)
<if test="ymdType == 'mm'">
select SUM(CASE WHEN check_result = 'N' THEN 1 ELSE 0 END) noOkQuality,
count(0) quality
FROM(
select check_result
from qc_check_task qct
where check_type = #{typeCode} and check_status = '2'
and CONVERT(varchar(7),qct.create_time, 120) = SUBSTRING(#{ymd},0,8)
and del_flag = '0'
) t
</if>
<if test='ymdType=="dd"'>
and CONVERT(varchar(10),receipt_time, 120) = SUBSTRING(#{ymd},0,11)
</if>
union ALL
select count(0),'unOk'
from qc_check_unqualified qcu
left join qc_check_type qct on qcu.type = qct.order_code
where qct.type_code = #{typeCode} and qcu.del_flag = '0'
<if test='ymdType=="yyyy"'>
and CONVERT(varchar(4),qcu.create_time, 120) = SUBSTRING(#{ymd},0,5)
</if>
<if test='ymdType=="mm"'>
and CONVERT(varchar(7),qcu.create_time, 120) = SUBSTRING(#{ymd},0,8)
</if>
<if test='ymdType=="dd"'>
and CONVERT(varchar(10),qcu.create_time, 120) = SUBSTRING(#{ymd},0,11)
<if test="ymdType == 'dd'">
select SUM(CASE WHEN check_result = 'N' THEN 1 ELSE 0 END) noOkQuality,
count(0) quality
FROM(
select check_result
from qc_check_task qct
where check_type = #{typeCode} and check_status = '2'
and CONVERT(varchar(10),qct.create_time, 120) = SUBSTRING(#{ymd},0,11)
and del_flag = '0'
) t
</if>
</select>
<select id="getCheckProjectsPie" resultType="com.op.quality.domain.QcInterface">
<!--
<!--
select count(0) quality,
qctd.project_no,
qctd.rule_name projectName
@ -57,61 +65,80 @@
and CONVERT(varchar(10),qcu.update_time, 120) = SUBSTRING(#{ymd},0,11)
</if>
group by qctd.project_no,qctd.rule_name-->
select qct.remark projectName,
count(0) quality
from qc_check_task qct
where qct.type_code = 'produce' and qct.check_result = 'N' and qct.remark is not null
<if test='ymdType=="yyyy"'>
and CONVERT(varchar(4),qct.check_time, 120) = SUBSTRING(#{ymd},0,5)
<if test="ymdType == 'yyyy'">
select sum(noOk_quality) quality,
class_name projectName
FROM(
select
qctd.noOk_quality,
qdtc.class_name
from qc_check_task qct
left join qc_check_task_defect qctd on qctd.belong_to = qct.record_id
left join qc_defect_type_class qdtc on qctd.class_id = qdtc.id
where qct.check_type = 'checkTypeSCXJ' and qct.check_status = '2'
and CONVERT(varchar(4),qct.create_time, 120) = SUBSTRING(#{ymd},0,5)
and qdtc.del_flag = '0' and qctd.del_flag = '0'
) t
group by class_name
</if>
<if test='ymdType=="mm"'>
and CONVERT(varchar(7),qct.check_time, 120) = SUBSTRING(#{ymd},0,8)
<if test="ymdType == 'mm'">
select sum(noOk_quality) quality,
class_name projectName
FROM(
select
qctd.noOk_quality,
qdtc.class_name
from qc_check_task qct
left join qc_check_task_defect qctd on qctd.belong_to = qct.record_id
left join qc_defect_type_class qdtc on qctd.class_id = qdtc.id
where qct.check_type = 'checkTypeSCXJ' and qct.check_status = '2'
and CONVERT(varchar(7),qct.create_time, 120) = SUBSTRING(#{ymd},0,8)
and qdtc.del_flag = '0' and qctd.del_flag = '0'
) t
group by class_name
</if>
<if test='ymdType=="dd"'>
and CONVERT(varchar(10),qct.check_time, 120) = SUBSTRING(#{ymd},0,11)
<if test="ymdType == 'dd'">
select sum(noOk_quality) quality,
class_name projectName
FROM(
select
qctd.noOk_quality,
qdtc.class_name
from qc_check_task qct
left join qc_check_task_defect qctd on qctd.belong_to = qct.record_id
left join qc_defect_type_class qdtc on qctd.class_id = qdtc.id
where qct.check_type = 'checkTypeSCXJ' and qct.check_status = '2'
and CONVERT(varchar(10),qct.create_time, 120) = SUBSTRING(#{ymd},0,11)
and qdtc.del_flag = '0' and qctd.del_flag = '0'
) t
group by class_name
</if>
group by qct.remark
</select>
<select id="getSupplierBadTOP5" resultType="com.op.quality.domain.QcInterface">
select top 5 * from(
select
concat(t1.supplier_name,'-',t1.material_name) supplierName,
ROUND(t2.noOkNum*100.00/t1.allNum, 2) quality
from (
select count(0) allNum,
qct.supplier_code,qct.supplier_name,qct.material_code,qct.material_name
from qc_check_task qct
where qct.type_code = #{typeCode}
<if test='ymdType=="yyyy"'>
and CONVERT(varchar(4),qct.income_time, 120) = SUBSTRING(#{ymd},0,5)
</if>
<if test='ymdType=="mm"'>
and CONVERT(varchar(7),qct.income_time, 120) = SUBSTRING(#{ymd},0,8)
</if>
<if test='ymdType=="dd"'>
and CONVERT(varchar(10),qct.income_time, 120) = SUBSTRING(#{ymd},0,11)
</if>
group by
qct.supplier_code,qct.supplier_name,qct.material_code,qct.material_name
) t1
left join (
select
count(0) noOkNum,qct.supplier_code,qct.supplier_name,qct.material_code,qct.material_name
from qc_check_task qct
where qct.type_code = #{typeCode} and qct.check_result = 'N'
<if test='ymdType=="yyyy"'>
and CONVERT(varchar(4),qct.income_time, 120) = SUBSTRING(#{ymd},0,5)
</if>
<if test='ymdType=="mm"'>
and CONVERT(varchar(7),qct.income_time, 120) = SUBSTRING(#{ymd},0,8)
</if>
<if test='ymdType=="dd"'>
and CONVERT(varchar(10),qct.income_time, 120) = SUBSTRING(#{ymd},0,11)
</if>
group by
qct.supplier_code,qct.supplier_name,qct.material_code,qct.material_name
) t2 on t1.supplier_code = t2.supplier_code and t1.material_code = t2.material_code
) t order by t.quality desc
select top 5 t.* from (
select t0.noOkQuality*100/t0.batchs quality,t0.supplierName from(
SELECT
qct.supplier_code supplierCode,qct.supplier_name supplierName,
count(0) batchs,
SUM(CASE WHEN qct.check_result = 'N' THEN 1 ELSE 0 END) noOkQuality
from qc_check_task qct
where qct.check_type = #{checkType}
and qct.del_flag = '0'
<if test='ymdType=="yyyy"'>
and CONVERT(varchar(4),qct.income_time, 120) = SUBSTRING(#{ymd},0,5)
</if>
<if test='ymdType=="mm"'>
and CONVERT(varchar(7),qct.income_time, 120) = SUBSTRING(#{ymd},0,8)
</if>
<if test='ymdType=="dd"'>
and CONVERT(varchar(10),qct.income_time, 120) = SUBSTRING(#{ymd},0,11)
</if>
and qct.check_status = '2'
group by qct.supplier_code,qct.supplier_name
) t0
where t0.noOkQuality != 0
) t order by t.quality desc
</select>
<select id="getSupplierTaskList" resultType="com.op.quality.domain.QcInterface">
select
@ -250,10 +277,10 @@
sum(t.noOk_quality) noOkQuality
from(
select CONVERT(varchar(7),qct.income_time, 120) ymd,
qct.quality,
qct.sample_quality quality,
qct.noOk_quality
from qc_check_task qct
where qct.type_code = #{typeCode}
where qct.check_type = 'checkTypeSCXJ'
and qct.del_flag='0'
and CONVERT(varchar(4),qct.income_time, 120) in (${ymd})
) t
@ -296,4 +323,50 @@
and CONVERT(varchar(10),mrw.create_time, 120) = CONVERT(varchar(10),GETDATE(), 120)
</if>
</select>
<select id="getCheckProjectsPieLL" resultType="com.op.quality.domain.QcInterface">
<if test="ymdType == 'yyyy'">
select count(0) quality,
class_name projectName
FROM(
select
qct.remark_code,
qdtc.class_name
from qc_check_task qct
left join qc_defect_type_class qdtc on qct.remark_code = qdtc.id
where qct.check_type = #{checkType} and qct.check_status = '2'
and CONVERT(varchar(4),qct.create_time, 120) = SUBSTRING(#{ymd},0,5)
and qdtc.del_flag = '0' and qct.del_flag = '0'
) t
group by class_name
</if>
<if test="ymdType == 'mm'">
select count(0) quality,
class_name projectName
FROM(
select
qct.remark_code,
qdtc.class_name
from qc_check_task qct
left join qc_defect_type_class qdtc on qct.remark_code = qdtc.id
where qct.check_type = #{checkType} and qct.check_status = '2'
and CONVERT(varchar(7),qct.create_time, 120) = SUBSTRING(#{ymd},0,8)
and qdtc.del_flag = '0' and qct.del_flag = '0'
) t
group by class_name
</if>
<if test="ymdType == 'dd'">
select count(0) quality,
class_name projectName
FROM(
select qct.remark_code,
qdtc.class_name
from qc_check_task qct
left join qc_defect_type_class qdtc on qct.remark_code = qdtc.id
where qct.check_type = #{checkType} and qct.check_status = '2'
and CONVERT(varchar(10),qct.create_time, 120) = SUBSTRING(#{ymd},0,11)
and qdtc.del_flag = '0' and qct.del_flag = '0'
) t
group by class_name
</if>
</select>
</mapper>

@ -491,9 +491,16 @@
GROUP by qctd.belong_to,qctd.belong_to_detail
</select>
<select id="getTableHzTitle" resultType="java.lang.String">
select dict_label from base_dict_data
where dict_type = #{dataType}
and remark = #{remark} order by dict_sort
<!--select dtc.class_name
from qc_defect_type dt
left join qc_defect_type_class dtc on dt.defect_code = dtc.defect_code
where dt.defect_type in (select type_code from qc_check_type where order_code = #{remark} and del_flag = '0')
and dtc.del_flag = '0' order by dtc.sort-->
select dtc.class_name
from qc_defect_type dt
left join qc_defect_type_class dtc on dt.defect_code = dtc.defect_code
where dt.defect_type = #{remark}
and dtc.del_flag = '0' order by dtc.sort
</select>
<select id="getTableHzTitle2" resultType="java.lang.String">
select defect_subclass from qc_defect_type where defect_type = #{typeCode} and del_flag = '0'
@ -501,10 +508,9 @@
<select id="getSamplesNum" resultType="com.op.quality.domain.QcStaticTable">
<if test="ymdms == 'yyyy'">
select sum(sample_quality) sampleQuality,
sum(noOk_quality) noOkQuality,
ymdms
FROM(
select CONVERT(varchar(7),qct.create_time, 120) AS ymdms, qct.sample_quality, qct.noOk_quality
select CONVERT(varchar(7),qct.create_time, 120) AS ymdms, qct.sample_quality
from qc_check_task qct
where check_type = #{checkType}
and CONVERT(varchar(4),qct.create_time, 120) = #{incomeTimeStr}
@ -514,10 +520,9 @@
</if>
<if test="ymdms == 'mm'">
select sum(sample_quality) sampleQuality,
sum(noOk_quality) noOkQuality,
ymdms
FROM(
select CONVERT(varchar(10),qct.create_time, 120) AS ymdms, qct.sample_quality, qct.noOk_quality
select CONVERT(varchar(10),qct.create_time, 120) AS ymdms, qct.sample_quality
from qc_check_task qct
where check_type = #{checkType}
and CONVERT(varchar(7),qct.create_time, 120) = #{incomeTimeStr}
@ -527,10 +532,9 @@
</if>
<if test="ymdms == 'dd'">
select sum(sample_quality) sampleQuality,
sum(noOk_quality) noOkQuality,
RIGHT('00' + CAST(ymdms AS VARCHAR(2)), 2) ymdms
FROM(
select DATEPART(HOUR, qct.create_time) AS ymdms, qct.sample_quality, qct.noOk_quality
select DATEPART(HOUR, qct.create_time) AS ymdms, qct.sample_quality
from qc_check_task qct
where check_type = #{checkType}
and CONVERT(varchar(10),qct.create_time, 120) = #{incomeTimeStr}
@ -539,55 +543,112 @@
group by ymdms
</if>
</select>
<select id="getNoOkRatioNum" resultType="com.op.quality.domain.QcStaticTable">
<if test="ymdms == 'yyyy'">
select sum(noOkQuality) noOkQuality,
ymdms
FROM(
select
CONVERT(varchar(7),qct.create_time, 120) AS ymdms,
qctd.class_id,
qctd.noOk_quality*qdt.ratio noOkQuality
from qc_check_task qct
left join qc_check_task_defect qctd on qctd.belong_to = qct.record_id
left join qc_defect_type_class qdtc on qctd.class_id = qdtc.id
left join qc_defect_type qdt on qdt.defect_code = qdtc.defect_code
where qct.check_type = #{checkType} and qct.check_status = '2'
and CONVERT(varchar(4),qct.create_time, 120) = #{incomeTimeStr}
and qdt.del_flag = '0' and qdtc.del_flag = '0' and qctd.del_flag = '0' and qct.del_flag='0'
) t
group by ymdms
</if>
<if test="ymdms == 'mm'">
select sum(noOkQuality) noOkQuality,
ymdms
FROM(
select
CONVERT(varchar(10),qct.create_time, 120) AS ymdms,
qctd.class_id,
qctd.noOk_quality*qdt.ratio noOkQuality
from qc_check_task qct
left join qc_check_task_defect qctd on qctd.belong_to = qct.record_id
left join qc_defect_type_class qdtc on qctd.class_id = qdtc.id
left join qc_defect_type qdt on qdt.defect_code = qdtc.defect_code
where qct.check_type = #{checkType} and qdt.del_flag = '0' and qdtc.del_flag = '0' and qctd.del_flag = '0'
and CONVERT(varchar(7),qct.create_time, 120) = #{incomeTimeStr} and qct.del_flag='0' and qct.check_status = '2'
) t
group by ymdms
</if>
<if test="ymdms == 'dd'">
select sum(noOkQuality) noOkQuality,
RIGHT('00' + CAST(ymdms AS VARCHAR(2)), 2) ymdms
FROM(
select
DATEPART(HOUR, qct.create_time) AS ymdms,
qctd.class_id,
qctd.noOk_quality*qdt.ratio noOkQuality
from qc_check_task qct
left join qc_check_task_defect qctd on qctd.belong_to = qct.record_id
left join qc_defect_type_class qdtc on qctd.class_id = qdtc.id
left join qc_defect_type qdt on qdt.defect_code = qdtc.defect_code
where qct.check_type = #{checkType} and qdt.del_flag = '0' and qdtc.del_flag = '0' and qctd.del_flag = '0'
and CONVERT(varchar(10),qct.create_time, 120) = #{incomeTimeStr} and qct.del_flag='0' and qct.check_status = '2'
) t
group by ymdms
</if>
</select>
<select id="getNoOkNum" resultType="com.op.quality.domain.QcStaticTable">
<if test="ymdms == 'yyyy'">
select sum(noOk_quality) noOkQuality,
concat(hourName,dict_label) ymdUntype
concat(hourName,class_name) ymdUntype
FROM(
select CONVERT(varchar(7),qct.create_time, 120) AS hourName,
qct.noOk_quality,
bdd.dict_label
qctd.noOk_quality,
qdtc.class_name
from qc_check_task qct
left join base_dict_data bdd on bdd.dict_type = 'unqualified_remark' and qct.remark_code = dict_value
left join qc_check_task_defect qctd on qctd.belong_to = qct.record_id
left join qc_defect_type_class qdtc on qctd.class_id = qdtc.id
where qct.check_type = #{checkType} and qct.check_status = '2'
and CONVERT(varchar(4),qct.create_time, 120) = #{incomeTimeStr}
and del_flag = '0' and bdd.dict_label is not null
and qdtc.del_flag = '0' and qctd.del_flag = '0'
) t
group by hourName,dict_label
group by hourName,class_name
</if>
<if test="ymdms == 'mm'">
select sum(noOk_quality) noOkQuality,
concat(hourName,dict_label) ymdUntype
concat(hourName,class_name) ymdUntype
FROM(
select CONVERT(varchar(10),qct.create_time, 120) AS hourName,
qct.noOk_quality,
bdd.dict_label
qctd.noOk_quality,
qdtc.class_name
from qc_check_task qct
left join base_dict_data bdd on bdd.dict_type = 'unqualified_remark' and qct.remark_code = dict_value
left join qc_check_task_defect qctd on qctd.belong_to = qct.record_id
left join qc_defect_type_class qdtc on qctd.class_id = qdtc.id
where qct.check_type = #{checkType} and qct.check_status = '2'
and CONVERT(varchar(7),qct.create_time, 120) = #{incomeTimeStr}
and del_flag = '0' and bdd.dict_label is not null
and qdtc.del_flag = '0' and qctd.del_flag = '0'
) t
group by hourName,dict_label
group by hourName,class_name
</if>
<if test="ymdms == 'dd'">
select sum(noOk_quality) noOkQuality,
concat(hourName,dict_label) ymdUntype
concat(hourName,class_name) ymdUntype
FROM(
select RIGHT('00' + CAST(DATEPART(HOUR, qct.create_time) AS VARCHAR(2)), 2) AS hourName,
qct.noOk_quality,
bdd.dict_label
qctd.noOk_quality,
qdtc.class_name
from qc_check_task qct
left join base_dict_data bdd on bdd.dict_type = 'unqualified_remark' and qct.remark_code = dict_value
left join qc_check_task_defect qctd on qctd.belong_to = qct.record_id
left join qc_defect_type_class qdtc on qctd.class_id = qdtc.id
where qct.check_type = #{checkType} and qct.check_status = '2'
and CONVERT(varchar(10),qct.create_time, 120) = #{incomeTimeStr}
and del_flag = '0' and bdd.dict_label is not null
and qdtc.del_flag = '0' and qctd.del_flag = '0'
) t
group by hourName,dict_label
group by hourName,class_name
</if>
</select>
<select id="getTableHzNoOkData" resultType="com.op.quality.domain.QcStaticTable">
select * from (
<!--select * from (
select sum(t.noOk_quality) noOkQuality,
t.dict_label dataType
FROM(
@ -608,6 +669,132 @@
and del_flag = '0' and qct.remark_code is not null
) t
group by t.dict_label
) t0 order by noOkQuality desc-->
select * from (
select sum(t.noOk_quality) noOkQuality,
t.class_name dataType
FROM(
select
qctd.noOk_quality,
qdtc.class_name
from qc_check_task qct
left join qc_check_task_defect qctd on qctd.belong_to = qct.record_id
left join qc_defect_type_class qdtc on qctd.class_id = qdtc.id
where qct.check_type = #{checkType} and qct.check_status = '2'
<if test="ymdms == 'yyyy'">and CONVERT(varchar(4),qct.create_time, 120) = #{incomeTimeStr}</if>
<if test="ymdms == 'mm'">and CONVERT(varchar(7),qct.create_time, 120) = #{incomeTimeStr}</if>
<if test="ymdms == 'dd'"> and CONVERT(varchar(10),qct.create_time, 120) = #{incomeTimeStr}</if>
and qct.del_flag = '0' and qdtc.del_flag = '0' and qctd.del_flag = '0'
) t
group by t.class_name
) t0 order by noOkQuality desc
</select>
<select id="getSamplesPCNum" resultType="com.op.quality.domain.QcStaticTable">
<if test="ymdms == 'yyyy'">
select SUM(CASE WHEN check_result = 'N' THEN 1 ELSE 0 END) noOkQuality,
count(0) sampleQuality,
ymdms
FROM(
select CONVERT(varchar(7),qct.create_time, 120) AS ymdms, qct.sample_quality
from qc_check_task qct
where check_type = #{checkType} and check_status = 2
and CONVERT(varchar(4),qct.create_time, 120) = #{incomeTimeStr}
and del_flag = '0'
) t
group by ymdms
</if>
<if test="ymdms == 'mm'">
select SUM(CASE WHEN check_result = 'N' THEN 1 ELSE 0 END) noOkQuality,
count(0) sampleQuality,
ymdms
FROM(
select CONVERT(varchar(10),qct.create_time, 120) AS ymdms, check_result
from qc_check_task qct
where check_type = #{checkType} and check_status = 2
and CONVERT(varchar(7),qct.create_time, 120) = #{incomeTimeStr}
and del_flag = '0'
) t
group by ymdms
</if>
<if test="ymdms == 'dd'">
select SUM(CASE WHEN check_result = 'N' THEN 1 ELSE 0 END) noOkQuality,
count(0) sampleQuality,
RIGHT('00' + CAST(ymdms AS VARCHAR(2)), 2) ymdms
FROM(
select DATEPART(HOUR, qct.create_time) AS ymdms,check_result
from qc_check_task qct
where check_type = #{checkType} and check_status = 2
and CONVERT(varchar(10),qct.create_time, 120) = #{incomeTimeStr}
and del_flag = '0'
) t
group by ymdms
</if>
</select>
<select id="getNoOkPCNum" resultType="com.op.quality.domain.QcStaticTable">
<if test="ymdms == 'yyyy'">
select count(0) noOkQuality,
concat(hourName,class_name) ymdUntype
FROM(
select CONVERT(varchar(7),qct.create_time, 120) AS hourName,
qct.remark_code,
qdtc.class_name
from qc_check_task qct
left join qc_defect_type_class qdtc on qct.remark_code = qdtc.id
where qct.check_type = #{checkType} and qct.check_status = '2'
and CONVERT(varchar(4),qct.create_time, 120) = #{incomeTimeStr}
and qdtc.del_flag = '0' and qct.del_flag = '0'
) t
group by hourName,class_name
</if>
<if test="ymdms == 'mm'">
select count(0) noOkQuality,
concat(hourName,class_name) ymdUntype
FROM(
select CONVERT(varchar(10),qct.create_time, 120) AS hourName,
qct.remark_code,
qdtc.class_name
from qc_check_task qct
left join qc_defect_type_class qdtc on qct.remark_code = qdtc.id
where qct.check_type = #{checkType} and qct.check_status = '2'
and CONVERT(varchar(7),qct.create_time, 120) = #{incomeTimeStr}
and qdtc.del_flag = '0' and qct.del_flag = '0'
) t
group by hourName,class_name
</if>
<if test="ymdms == 'dd'">
select count(0) noOkQuality,
concat(hourName,class_name) ymdUntype
FROM(
select RIGHT('00' + CAST(DATEPART(HOUR, qct.create_time) AS VARCHAR(2)), 2) AS hourName,
qct.remark_code,
qdtc.class_name
from qc_check_task qct
left join qc_defect_type_class qdtc on qct.remark_code = qdtc.id
where qct.check_type = #{checkType} and qct.check_status = '2'
and CONVERT(varchar(10),qct.create_time, 120) = #{incomeTimeStr}
and qdtc.del_flag = '0' and qct.del_flag = '0'
) t
group by hourName,class_name
</if>
</select>
<select id="getTableHzNoOkDataSC" resultType="com.op.quality.domain.QcStaticTable">
select * from (
select count(t.remark_code) noOkQuality,
t.class_name dataType
FROM(
select
qct.remark_code,
qdtc.class_name
from qc_check_task qct
left join qc_defect_type_class qdtc on qct.remark_code = qdtc.id
where qct.check_type = #{checkType} and qct.check_status = '2'
<if test="ymdms == 'yyyy'">and CONVERT(varchar(4),qct.create_time, 120) = #{incomeTimeStr}</if>
<if test="ymdms == 'mm'">and CONVERT(varchar(7),qct.create_time, 120) = #{incomeTimeStr}</if>
<if test="ymdms == 'dd'"> and CONVERT(varchar(10),qct.create_time, 120) = #{incomeTimeStr}</if>
and qct.del_flag = '0' and qdtc.del_flag = '0'
) t
group by t.class_name
) t0 order by noOkQuality desc
</select>
</mapper>

@ -13,11 +13,13 @@ spring:
cloud:
nacos:
discovery:
#命名空间
namespace: lanju-op-test
group: test
# 服务注册地址
server-addr: 192.168.202.20:8848
config:
#命名空间
namespace: lanju-op-test
group: test
# 服务注册地址

@ -13,15 +13,17 @@ spring:
cloud:
nacos:
discovery:
namespace: lanju-op
group: zxl
#命名空间
namespace: lanju-op-test
group: test
# 服务注册地址
server-addr: 175.27.215.92:8848
server-addr: 192.168.202.20:8848
config:
namespace: lanju-op
group: zxl
#命名空间
namespace: lanju-op-test
group: test
# 服务注册地址
server-addr: 175.27.215.92:8848
server-addr: 192.168.202.20:8848
# 配置文件格式
file-extension: yml
# 共享配置

@ -13,17 +13,16 @@ spring:
cloud:
nacos:
discovery:
# namespace: lanju-op-test
#命名空间
namespace: lanju-op-test
group: test
# 服务注册地址
# server-addr: 192.168.202.20:8848
server-addr: 192.168.202.20:8848
config:
#命名空间
namespace: lanju-op-test
group: test
# 服务注册地址
# server-addr: 192.168.202.20:8848
server-addr: 192.168.202.20:8848
# 配置文件格式
file-extension: yml

@ -24,6 +24,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="wxId" column="wx_id"/>
<result property="userMType" column="user_m_type"/>
<association property="dept" column="dept_id" javaType="SysDept" resultMap="deptResult" />
<collection property="roles" javaType="java.util.List" resultMap="RoleResult" />
@ -51,7 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectUserVo">
select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password,
u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, u.wx_id,
d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,u.user_m_type,
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
from sys_user u
left join sys_dept d on u.dept_id = d.dept_id
@ -168,6 +170,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="wxId != null and wxId != ''">wx_id,</if>
<if test="userMType != null and userMType != ''">user_m_type,</if>
create_time
)values(
<if test="userId != null and userId != ''">#{userId},</if>
@ -183,6 +186,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="wxId != null and wxId != ''">#{wxId},</if>
<if test="userMType != null and userMType != ''">#{userMType},</if>
GETDATE()
)
</insert>
@ -217,6 +221,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="wxId != null">wx_id = #{wxId},</if>
<if test="userMType != null">user_m_type = #{userMType},</if>
update_time = GETDATE()
</set>
where user_id = #{userId}

@ -13,11 +13,13 @@ spring:
cloud:
nacos:
discovery:
#命名空间
namespace: lanju-op-test
group: test
# 服务注册地址
server-addr: 192.168.202.20:8848
config:
#命名空间
namespace: lanju-op-test
group: test
# 服务注册地址

@ -51,8 +51,13 @@ public class OdsProcureOrderController extends BaseController {
}
/**获取标识卡**/
@PostMapping("/getIdCardList")
public List<ProOrderWorkorder> getIdCardList(@RequestBody OdsProcureOrder odsProcureOrder) {
return odsProcureOrderService.getIdCardList(odsProcureOrder);
public AjaxResult getIdCardList(@RequestBody OdsProcureOrder odsProcureOrder) {
return success(odsProcureOrderService.getIdCardList(odsProcureOrder));
}
/**获补打标识卡**/
@PostMapping("/getIdCardListDA")
public AjaxResult getIdCardListDA(@RequestBody OdsProcureOrder odsProcureOrder) {
return success(odsProcureOrderService.getIdCardListDA(odsProcureOrder));
}
/**
*

@ -306,11 +306,15 @@ public class WmsToWCSmissionController {
*/
@PostMapping("/WmsProductPutByWorkOrderqueryBS")
public AjaxResult WmsProductPutByWorkOrderqueryBS(@RequestBody WmsProductPut wmsProductPut) {
WmsProductPut wmsProductPut1= wmsProductPutService.WmsProductPutByWorkOrderqueryBS(wmsProductPut);
if (wmsProductPut1==null) {
return AjaxResult.error("标识卡未绑定");
try {
// 调用服务层方法获取 WmsProductPut 对象
WmsProductPut wmsProductPut1 = wmsProductPutService.WmsProductPutByWorkOrderqueryBS(wmsProductPut);
// 返回成功结果
return AjaxResult.success(wmsProductPut1);
} catch (Exception e) {
// 捕捉到异常时,返回错误提示
return AjaxResult.error("扫描标识卡异常,检查标识卡是否有问题:" + e.getMessage());
}
return AjaxResult.success(wmsProductPut1);
}
@ -756,7 +760,11 @@ public class WmsToWCSmissionController {
}
return iWmsToWCSmissionService.liftTakeOrPutCompleted(wcsdto);
}
// /**获取标识卡**/
// @PostMapping("/getIdCardList")
// public AjaxResult getIdCardList(@RequestBody OdsProcureOrder odsProcureOrder) {
// return success(odsProcureOrderService.getIdCardList(odsProcureOrder));
// }
/**
*
*/

@ -63,10 +63,10 @@ public class BaseEquipment extends BaseEntity {
private String attr2;
@Excel(name = "预留字段3")
private Long attr3;
private String attr3;
@Excel(name = "预留字段4")
private Long attr4;
private String attr4;
@Excel(name = "单台能力工时")
private String unitWorkingHours;
@ -677,19 +677,19 @@ public class BaseEquipment extends BaseEntity {
return attr2;
}
public void setAttr3(Long attr3) {
public void setAttr3(String attr3) {
this.attr3 = attr3;
}
public Long getAttr3() {
public String getAttr3() {
return attr3;
}
public void setAttr4(Long attr4) {
public void setAttr4(String attr4) {
this.attr4 = attr4;
}
public Long getAttr4() {
public String getAttr4() {
return attr4;
}

@ -355,6 +355,15 @@ public class BaseProduct extends BaseEntity {
private String mvgr5;
private String palletNum;
private String warehouseCycle;
private String packType;
public String getPackType() {
return packType;
}
public void setPackType(String packType) {
this.packType = packType;
}
public String getMvgr5() {
return mvgr5;

@ -124,6 +124,15 @@ public class BaseProductAttached extends BaseEntity {
private String other;
private String warehouseCycle;
private String palletNum;
private String packType;
public String getPackType() {
return packType;
}
public void setPackType(String packType) {
this.packType = packType;
}
public String getPalletNum() {
return palletNum;

@ -71,6 +71,8 @@ public class OdsProcureOrder extends BaseEntity {
*/
@Excel(name = "工厂编码")
private String siteCode;
private String cardNum;
/**
*
*/
@ -183,6 +185,16 @@ public class OdsProcureOrder extends BaseEntity {
@Excel(name = "计划数量")
private BigDecimal planNumber;
private BigDecimal buNumber;
public BigDecimal getBuNumber() {
return buNumber;
}
public void setBuNumber(BigDecimal buNumber) {
this.buNumber = buNumber;
}
/**
*
*/
@ -283,6 +295,14 @@ public class OdsProcureOrder extends BaseEntity {
this.Remark = Remark;
}
public String getCardNum() {
return cardNum;
}
public void setCardNum(String cardNum) {
this.cardNum = cardNum;
}
/**
*
*/

@ -3,6 +3,7 @@ package com.op.wms.mapper;
import java.util.List;
import com.op.wms.domain.OdsProcureOrder;
import org.apache.ibatis.annotations.Param;
/**
* Mapper
@ -72,4 +73,6 @@ public interface OdsProcureOrderMapper {
void updateOdsProcureOrderByProcureCode(OdsProcureOrder odsProcureOrder);
List<OdsProcureOrder> getIdCardList(OdsProcureOrder odsProcureOrder);
void addBatchPallet(@Param("list")List<OdsProcureOrder> dtos);
}

@ -4,6 +4,7 @@ import java.util.List;
import com.op.system.api.domain.wms.wmsReportWork;
import com.op.wms.domain.ProOrderWorkorder;
import com.op.wms.domain.WmsProductPut;
import org.apache.ibatis.annotations.Param;
@ -81,6 +82,10 @@ public interface WmsProductPutMapper {
WmsProductPut selectProOrderWorkorderBatchPallet(WmsProductPut wmsProductPut);
WmsProductPut selectProOrderWorkorderBatchPalletcode(WmsProductPut wmsProductPut);
WmsProductPut selectProOrderWorkorderBatchPalletAtter(ProOrderWorkorder proOrderWorkorder);
// String selectWmsProductPutNum(wmsReportWork wmsReportWork);
}

@ -112,5 +112,7 @@ public interface IOdsProcureOrderService {
void OutboundPostingSAPfc(List<OdsProcureOutOrder> orderList);
List<ProOrderWorkorder> getIdCardList(OdsProcureOrder odsProcureOrder);
String getIdCardList(OdsProcureOrder odsProcureOrder);
String getIdCardListDA(OdsProcureOrder odsProcureOrder);
}

@ -15,6 +15,7 @@ import java.util.*;
import com.op.common.core.domain.R;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.security.utils.SecurityUtils;
import com.op.system.api.RemoteOpenService;
@ -39,8 +40,10 @@ import com.op.common.core.utils.uuid.IdUtils;
import com.op.wms.domain.*;
import com.op.wms.mapper.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import com.op.wms.service.IOdsProcureOrderService;
import org.springframework.util.CollectionUtils;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
@ -77,6 +80,10 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService {
private WmsRawOrderInMapper wmsRawOrderInMapper;
@Autowired
private RemoteOpenService remoteOpenService;
@Autowired
private BaseProductAttachedMapper baseProductAttachedMapper;
@Value("${dayin.url1}")
private String dayinUrl1;
/**
*
*
@ -98,7 +105,13 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService {
@Override
@DS("#header.poolName")
public List<OdsProcureOrder> selectOdsProcureOrderList(OdsProcureOrder odsProcureOrder) {
return odsProcureOrderMapper.selectOdsProcureOrderList(odsProcureOrder);
List<OdsProcureOrder> orderList= odsProcureOrderMapper.selectOdsProcureOrderList(odsProcureOrder);
for (OdsProcureOrder order:
orderList) {
String name = odsProcureOrderMapper.selectBaseSupplier(order);
order.setSupplierName(name);
}
return orderList;
}
/**
@ -167,7 +180,7 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService {
WmsRawOrderInSn wmsRawOrderInSn = new WmsRawOrderInSn();
wmsRawOrderInSn.setRawOrderInSnId(IdUtils.fastSimpleUUID());
wmsRawOrderInSn.setUserDefined1("1");//1是收货,2是入库
wmsRawOrderInSn.setUserDefined2(odsProcureOrder.getIncomeBatchNo());//批次
wmsRawOrderInSn.setUserDefined2(order.getUserDefined7());//批次
wmsRawOrderInSn.setWhCode(odsProcureOrder.getWhCode());//厂库编号
wmsRawOrderInSn.setWaCode(odsProcureOrder.getWaCode());
wmsRawOrderInSn.setWlCode("00001-1-01");//先都设置为同一个库位
@ -672,6 +685,10 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService {
if (orderList.size() > 0) {
continue;
}
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
Date date = new Date();
String formattedDate = dateFormat.format(date);
order.setUserDefined7(formattedDate+order.getUserDefined3());
order.setPlanNumber(new BigDecimal(sapPurchaseOrderQuery1.get("menge")));
order.setUnit(sapPurchaseOrderQuery1.get("meins"));
order.setSupplierCode(sapPurchaseOrderQuery1.get("lifnr"));
@ -725,11 +742,12 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService {
public String PurchaseOrderdeliPdaConfirm(OdsProcureOrder odsProcureOrder) {
DynamicDataSourceContextHolder.push("ds_" + odsProcureOrder.getFactoryCode());
String result="操作成功";
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
Date date = new Date();
String formattedDate = dateFormat.format(date);
WmsRawOrderInSn wmsRawOrderInSn1=new WmsRawOrderInSn();
// SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
// Date date = new Date();
// String formattedDate = dateFormat.format(date);
// WmsRawOrderInSn wmsRawOrderInSn1=new WmsRawOrderInSn();
OdsProcureOrder order = odsProcureOrderMapper.selectOdsProcureOrderByID(odsProcureOrder.getID());
String formattedDate=order.getUserDefined7();
List<WmsRawOrderInSn> wmsRawOrderInSns = wmsRawOrderInSnMapper.selecPurchaseOrderdeliPdaList(odsProcureOrder);
WmsRawOrderInSn wmsRawOrderInSnTEM = wmsRawOrderInSnMapper.selecPurchaseOrderdeliPdaById(odsProcureOrder);
if(wmsRawOrderInSns.size()>0){
@ -762,11 +780,15 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService {
R result2 = remoteSapService.temporarilyCollected(mapList);
int code = result2.getCode();
if (code == 200){//成功
Map map = new HashMap();
map = (Map) result2.getData();
String MATERIALDOCUMENT = (String) map.get("MATERIALDOCUMENT");
String MATDOCUMENTYEAR = (String) map.get("MATDOCUMENTYEAR");
order.setSapTempInfor(result2.getMsg());
WmsRawOrderIn wmsRawOrderIn=new WmsRawOrderIn();
wmsRawOrderIn.setRawOrderInId(IdUtils.fastSimpleUUID());
wmsRawOrderIn.setFactoryCode(odsProcureOrder.getFactoryCode());
wmsRawOrderIn.setDnNo(order.getReceiptNoCode());
wmsRawOrderIn.setDnNo(odsProcureOrder.getReceiptNoCode());
wmsRawOrderIn.setPoNo(order.getProcureCode());
wmsRawOrderIn.setPoLine(order.getUserDefined3());
wmsRawOrderIn.setMaterialCode(order.getMaterialCode());
@ -777,7 +799,12 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService {
wmsRawOrderIn.setOrderStatus("0");//暂收
wmsRawOrderIn.setActiveFlag("1");
wmsRawOrderIn.setSupplyCode(order.getSupplierCode());
wmsRawOrderIn.setUserDefined1(result2.getMsg());
//wmsRawOrderIn.setUserDefined1();
wmsRawOrderIn.setAccountingStatus("0");//0是暂收
wmsRawOrderIn.setUserDefined1(MATERIALDOCUMENT);//物料凭证编号
wmsRawOrderIn.setUserDefined2(MATDOCUMENTYEAR);//年凭证号
wmsRawOrderIn.setUserDefined3(result2.getMsg());//暂收信息
//wmsRawOrderIn.setAccountingMessage(result2.getMsg());
wmsRawOrderIn.setSapFactoryCode(odsProcureOrder.getFactoryCode());
wmsRawOrderIn.setCreateBy(odsProcureOrder.getCreateBy());
wmsRawOrderInMapper.insertWmsRawOrderIn(wmsRawOrderIn);
@ -924,7 +951,7 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService {
}
order.setProcureCode(sapPurchaseOrderQuery1.get("orderNum"));
order.setSiteCode(sapPurchaseOrderQuery1.get("werks"));
order.setUserDefined3(sapPurchaseOrderQuery1.get("ebelp"));//批次
order.setUserDefined3(sapPurchaseOrderQuery1.get("ebelp"));//行项目
if (order.getUserDefined3()!=null){
order.setUserDefined3("000"+order.getUserDefined3());
}
@ -940,6 +967,10 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService {
//这个地方判断下是不是采购单已经被插入了,如果是的话,并且是走的送货单的路径,那就把送货单给她附上
continue;
}
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
Date date = new Date();
String formattedDate = dateFormat.format(date);
order.setUserDefined7(formattedDate+order.getUserDefined3());
order.setUserDefined11(sapPurchaseOrderQuery1.get("realDate"));
order.setPlanNumber(new BigDecimal(sapPurchaseOrderQuery1.get("thisDeliNum")));
order.setUnit(sapPurchaseOrderQuery1.get("unit"));
@ -1075,12 +1106,171 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService {
@Override
public List<ProOrderWorkorder> getIdCardList(OdsProcureOrder odsProcureOrder) {
List<OdsProcureOrder> orderList= odsProcureOrderMapper.getIdCardList(odsProcureOrder);
@DS("#header.poolName")
public String getIdCardList(OdsProcureOrder odsProcureOrder) {
// DynamicDataSourceContextHolder.push("ds_" + odsProcureOrder.getFactoryCode());
List<OdsProcureOrder> dtos = new ArrayList<>();
OdsProcureOrder order=odsProcureOrderMapper.selectOdsProcureOrderByID(odsProcureOrder.getID());
//根据采购单获取一托盘要装多少
BaseProductAttached baseProductAttached=new BaseProductAttached();
String trimmedMaterialCode = order.getMaterialCode().substring(7);
baseProductAttached.setProductCode(trimmedMaterialCode);
List<BaseProductAttached> baseProductAttacheds= baseProductAttachedMapper.selectBaseProductAttachedList(baseProductAttached);
if (baseProductAttacheds.size()==0){
//没有配置附属信息
return "没有配置附属信息";
}
String name = odsProcureOrderMapper.selectBaseSupplier(order);
order.setSupplierName(name);
List<OdsProcureOrder> dtos0= odsProcureOrderMapper.getIdCardList(order);
if(dtos0.size()==0){
//说明没生成过标识卡
OdsProcureOrder pw = new OdsProcureOrder();
int i = 1;
String palletNum = baseProductAttacheds.get(0).getPalletNum();
Date nowDate = DateUtils.getNowDate();
if(palletNum!=null){
BigDecimal pall = order.getPlanNumber();
BigDecimal pn = new BigDecimal(palletNum);
while(pall.compareTo(BigDecimal.ZERO)>0){
pw = new OdsProcureOrder();
pw.setSiteCode(order.getSiteCode());
pw.setProcureCode(order.getProcureCode());
pw.setUserDefined3(order.getUserDefined3());//行项目
pw.setMaterialCode(order.getMaterialCode());
pw.setMaterialDesc(order.getMaterialDesc());
pw.setPlanNumber(pn);
pw.setSupplierCode(order.getSupplierCode());
pw.setSupplierName(order.getSupplierName());
pw.setUserDefined8(order.getUserDefined8());
pw.setUserDefined7(order.getUserDefined7());
pw.setUserDefined11(order.getUserDefined11());
pw.setUnit(order.getUnit());
if(pall.compareTo(pn)<0) {//最后一托盘
pw.setPlanNumber(pall);
}else{
pw.setPlanNumber(pn);
}
pw.setCardNum(String.valueOf(i++));
String dateString = pw.getUserDefined11().replace("-", "");
pw.setUserDefined1(pw.getProcureCode()+"-"+pw.getUserDefined3()+"-"+pw.getUserDefined8()+"-"+dateString+"-"+pw.getCardNum());//采购单+行项目+类型+日期+板次
pw.setCreateTime(nowDate);
pw.setActive("1");
dtos.add(pw);
pall = pall.subtract(pn);
}
}
if(!CollectionUtils.isEmpty(dtos)){
odsProcureOrderMapper.addBatchPallet(dtos);
}
}else{
dtos.addAll(dtos0);
}
String msg= dayin(dtos);
return msg;
}
@Override
public String getIdCardListDA(OdsProcureOrder odsProcureOrder) {
//会有个id和补打的数量
OdsProcureOrder order=odsProcureOrderMapper.selectOdsProcureOrderByID(odsProcureOrder.getID());
List<OdsProcureOrder> dtos0= odsProcureOrderMapper.getIdCardList(order);
int tme= dtos0.size();
OdsProcureOrder order1=dtos0.get(tme-1);
order1.setPlanNumber(odsProcureOrder.getBuNumber());
// 获取当前的卡号数量,假设它是一个字符串类型
String cardNumStr = order1.getCardNum();
// 将字符串转换为整数
int cardNum = Integer.parseInt(cardNumStr);
// 进行加法运算
cardNum += 1; // 在这里进行值相加
order1.setCardNum(String.valueOf(cardNum));
List<OdsProcureOrder> dtos = new ArrayList<>();
return null;
}
public String dayin( List<OdsProcureOrder> orderList) {
// 定义请求的URL地址
String url = dayinUrl1;
// 创建OkHttpClient实例用于发送HTTP请求
OkHttpClient client = new OkHttpClient();
// 定义请求体的媒体类型为json
MediaType mediaType = MediaType.parse("application/json");
// 创建一个JSONArray用于存储多个订单的信息
JSONArray jsonArray = new JSONArray();
try {
// 创建JSON对象payload并设置请求参数
// 遍历传入的订单列表
for (OdsProcureOrder order : orderList) {
JSONObject payload = new JSONObject();
payload.put("supplier", order.getSupplierName());
payload.put("itemName", order.getMaterialDesc());
payload.put("itemCode", order.getMaterialCode());
payload.put("warehousingDate", order.getUserDefined11());
payload.put("batch", order.getUserDefined7());
payload.put("number", order.getPlanNumber());
payload.put("qrcode", order.getUserDefined1());
// 将当前订单的JSON对象添加到JSONArray中
jsonArray.add(payload);
}
// 创建请求体将JSONArray转换为字符串
RequestBody body = RequestBody.create(mediaType, jsonArray.toString());
// 创建POST请求
Request request = new Request.Builder()
.url(url)
.post(body)
.build();
// 执行请求并获取响应
Response response = client.newCall(request).execute();
// 获取响应数据并转换为JSON对象
String responseData = response.body().string();
JSONObject result = JSONObject.parseObject(responseData);
// 获取返回结果结果JSON对象请求编码、状态码和消息
Map map = new HashMap();
map = result;
String message = (String) map.get("msg");
response.close();
return message;
} catch (IOException e) {
// 捕获IOException并处理异常
e.printStackTrace(); // 在控制台打印异常信息,建议记录到日志文件
return "请求失败,异常信息:" + e.getMessage(); // 返回异常信息
} finally {
// 关闭OkHttpClient
client.dispatcher().executorService().shutdown();
}
}
public String DesignatedPalletOutboundWCS(WMSDesignatedPalle wmsDesignatedPalle) {
// 定义请求的URL地址
String url = "http://192.168.202.37:9001/api/v1/ReceiveMesMsg/packingMaterialsOutBoundByPallet";
@ -1109,15 +1299,26 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService {
.build();
// 执行请求并获取响应
Response response = client.newCall(request).execute();
// 获取响应数据并转换为JSON对象
String responseData = response.body().string();
JSONObject result = JSONObject.parseObject(responseData);
// 获取返回结果结果JSON对象请求编码、状态码和消息
result.get("reqCode");
result.get("code");
String message = (String) result.get("message");
response.close();
return message;
// 确保响应体不为空
if (response.body() != null) {
// 获取响应数据并转换为字符串
String responseData = response.body().string();
// 将响应数据解析为JSON对象
JSONObject result = JSONObject.parseObject(responseData);
// 获取返回结果中的状态码
int code = result.getIntValue("code");
// 获取返回结果中的消息字段
String message = result.getString("msg");
// 判断状态码是否为0表示成功
if (code == 0) {
return message; // 返回成功消息
} else {
return "打印失败,状态码:" + code; // 返回失败消息及状态码
}
} else {
return "响应体为空"; // 响应体为空的处理
}
} catch (IOException e) {
// 捕获IOException并处理异常
e.printStackTrace(); // 这里最好记录异常到日志文件或者进行其他处理

@ -1032,11 +1032,11 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
public WmsProductPut WmsProductPutByWorkOrderqueryBS(WmsProductPut wmsProductPut) {
// 使用 split 方法根据 '-' 分割字符串,结果是一个字符串数组
DynamicDataSourceContextHolder.push("ds_" + wmsProductPut.getFactoryCode());
String[] attributes = wmsProductPut.getPallet().split("-");
// 通过索引访问分割后的数组,获取所需的三个属性
String attribute1 = attributes[0]; // 获取第一个属性
String attribute2 = attributes[1]; // 获取第二个属性
String attribute3 = attributes[2]; // 获取第三个属性
// String[] attributes = wmsProductPut.getPallet().split("-");
WmsProductPut wmsProductPutTEM= wmsProductPutMapper.selectProOrderWorkorderBatchPalletcode(wmsProductPut);
String attribute1 = wmsProductPutTEM.getAttribute1(); // 获取第一个属性
String attribute2 = wmsProductPutTEM.getAttribute2(); // 获取第二个属性
String attribute3 = wmsProductPutTEM.getAttribute3(); // 获取第三个属性
wmsProductPut.setAttribute1(attribute1);
wmsProductPut.setAttribute2(attribute2);
wmsProductPut.setAttribute3(attribute3);
@ -1091,11 +1091,12 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
@Override
public ProOrderWorkorder finishedProductProductionRecordscar(ProOrderWorkorder proOrderWorkorder) {
DynamicDataSourceContextHolder.push("ds_" + proOrderWorkorder.getFactoryCode());
String[] attributes = proOrderWorkorder.getAttr1().split("-");
//String[] attributes = proOrderWorkorder.getAttr1().split("-");
// 通过索引访问分割后的数组,获取所需的三个属性
String attribute1 = attributes[0]; // 获取第一个属性
String attribute2 = attributes[1]; // 获取第二个属性
String attribute3 = attributes[2]; // 获取第三个属性
WmsProductPut wmsProductPutTEM= wmsProductPutMapper.selectProOrderWorkorderBatchPalletAtter(proOrderWorkorder);
String attribute1 = wmsProductPutTEM.getAttribute1(); // 获取第一个属性
String attribute2 = wmsProductPutTEM.getAttribute2(); // 获取第二个属性
String attribute3 = wmsProductPutTEM.getAttribute3(); // 获取第三个属性
proOrderWorkorder.setWorkorderCodeSap(attribute1);
proOrderWorkorder.setBatchCode(attribute2);
WmsProductPut wmsProductPut =new WmsProductPut();
@ -1158,6 +1159,13 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
wmsProductPutk.setStatus("2");
wmsProductPutk.setSapStatus("0");
wmsProductPutk.setAttr3(formattedDate);//
if (wmsProductPutk.getBatchNumber().length()==24){
//String batch = mesReportWork.getBatch().substring(12);
String batch = InterceptionRules(wmsProductPutk.getBatchNumber());
wmsProductPutk.setAttr4(batch);
}else {
wmsProductPutk.setAttr4(wmsProductPutk.getBatchNumber());
}
wmsProductPutk.setCreateBy(wmsProductPut.getCreateBy());
wmsProductPutk.setCreateTime(new Date());
wmsProductPutk.setPutQuantity(new BigDecimal(wmsProductPut1.getNumber()));

@ -13,11 +13,13 @@ spring:
cloud:
nacos:
discovery:
#命名空间
namespace: lanju-op-test
group: test
# 服务注册地址
server-addr: 192.168.202.20:8848
config:
#命名空间
namespace: lanju-op-test
group: test
# 服务注册地址

@ -23,10 +23,11 @@
<result property="pvc" column="pvc"/>
<result property="supportPlate" column="support_plate"/>
<result property="other" column="other"/>
<result property="palletNum" column="pallet_num"/>
</resultMap>
<sql id="selectBaseProductAttachedVo">
select id, product_code, category, pc, iei, man_standar, spray_way, blank_diameter, blank_no, spray_volume, liquid_no, endometrial_dosage, outer_film_dosage, support, support_no, pvc, support_plate, other from base_product_attached
select id, product_code, category, pc, iei, man_standar, spray_way, blank_diameter, blank_no, spray_volume, liquid_no, endometrial_dosage, outer_film_dosage, support, support_no, pvc, support_plate, pallet_num, other from base_product_attached
</sql>
<select id="selectBaseProductAttachedList" parameterType="BaseProductAttached"
@ -88,6 +89,7 @@
man_standar,
warehouse_cycle,
pallet_num,
<if test="packType != null">pack_type,</if>
<if test="sprayWay != null">spray_way,</if>
<if test="blankDiameter != null">blank_diameter,</if>
<if test="blankNo != null">blank_no,</if>
@ -110,6 +112,7 @@
#{manStandar},
#{warehouseCycle},
#{palletNum},
<if test="packType != null">#{packType},</if>
<if test="sprayWay != null">#{sprayWay},</if>
<if test="blankDiameter != null">#{blankDiameter},</if>
<if test="blankNo != null">#{blankNo},</if>
@ -155,7 +158,8 @@
iei = #{iei},
man_standar = #{manStandar},
warehouse_cycle = #{warehouseCycle},
pallet_num = #{palletNum}
pallet_num = #{palletNum},
pack_type = #{packType}
where id = #{id}
</update>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save