问题修复7

master
zhaoxiaolin 5 months ago
parent 6c629a4d84
commit e4a97da59a

@ -25,6 +25,9 @@ public interface RemoteSapService {
@PostMapping("/sap/shopOrderSync")
public R<List<SapProOrder>> shopOrderSync(@RequestBody SapShopOrderQuery sapProOrder);
@PostMapping("/sap/ZmesPurwqGet")
public R zmesPurwqGet(@RequestBody(required = false) Map<String, Object> mapList);
/**传递母订单号和母订单数量**/
@PostMapping("/sap/shopUpdateSync")
public R shopUpdateSync(@RequestBody SapShopOrderQuery sapProOrder);

@ -23,6 +23,11 @@ public class RemoteSapFallbackFactory implements FallbackFactory<RemoteSapServic
return R.fail("SAP服务获取SAP订单失败:" + throwable.getMessage());
}
@Override
public R zmesPurwqGet(Map<String, Object> mapList) {
return R.fail("SAP服务获取白坯SAP订单失败:" + throwable.getMessage());
}
@Override
public R<Boolean> sapRouterSync(SapRouterQuery sapRouterQuery) {
return R.fail("SAP服务同步工艺失败:" + throwable.getMessage());

@ -62,6 +62,9 @@ public class MesLineController extends BaseController {
@PostMapping("/export")
public void export(HttpServletResponse response, MesLine mesLine) {
List<MesLine> list = mesLineService.selectMesLineList(mesLine);
for(MesLine mline:list){
mline.setProductCode(mline.getProductCode().substring(7));
}
ExcelUtil<MesLine> util = new ExcelUtil<MesLine>(MesLine. class);
util.exportExcel(response, list, "线体管理数据");
}

@ -1,5 +1,6 @@
package com.op.plan.controller;
import com.op.common.core.domain.R;
import com.op.common.core.exception.ServiceException;
import com.op.common.core.utils.poi.ExcelUtil;
import com.op.common.core.web.controller.BaseController;
@ -8,6 +9,7 @@ import com.op.common.core.web.page.TableDataInfo;
import com.op.common.log.annotation.Log;
import com.op.common.log.enums.BusinessType;
import com.op.common.security.annotation.RequiresPermissions;
import com.op.plan.domain.ProOrder;
import com.op.plan.domain.ProOrderWorkorder;
import com.op.plan.domain.dto.SplitOrderDTO;
import com.op.plan.service.IProOrderWorkorderService;

@ -164,4 +164,10 @@ public class ProWhiteOrderController {
orderList.add(example);
util.exportExcel(response, orderList, "订单基本信息");
}
@Log(title = "同步白坯SAP订单", businessType = BusinessType.INSERT)
@PostMapping("/syncSAPbp")
public void syncSAPbp(@RequestBody ProOrder proOrder) {
proWhiteOrderService.syncSAPbp(proOrder);
}
}

@ -258,5 +258,7 @@ public interface ProOrderWorkorderMapper {
List<ProOrderWorkorder> getWorkList(String workorderCode);
List<String> getBatchList(String workorderId);
int bpAddBatch(@Param("list") List<ProOrder> orders);
}

@ -3,6 +3,7 @@ package com.op.plan.service;
import com.op.common.core.web.domain.AjaxResult;
import com.op.plan.domain.ProLine;
import com.op.plan.domain.ProOrder;
import com.op.plan.domain.ProOrderWorkorder;
import com.op.plan.domain.ProOrderWorkorderBatch;
import com.op.plan.domain.dto.SplitOrderDTO;

@ -71,4 +71,7 @@ public interface IProWhiteOrderService {
* @return
*/
AjaxResult getSplitInfo(ProOrder proOrder);
public void syncSAPbp(ProOrder proOrder);
}

@ -25,10 +25,8 @@ import com.op.system.api.RemoteSapService;
import com.op.system.api.domain.SysSapLog;
import com.op.system.api.domain.dto.MesPrepareDTO;
import com.op.system.api.domain.dto.MesPrepareDetailDTO;
import com.op.system.api.domain.sap.SapCloseOrderQuery;
import com.op.system.api.domain.sap.SapCreateOrder;
import com.op.system.api.domain.sap.SapMaterialPreparation;
import com.op.system.api.domain.sap.SapShopOrderQuery;
import com.op.system.api.domain.sap.*;
import com.op.system.api.model.SapProOrder;
import net.bytebuddy.matcher.FilterableList;
import org.apache.commons.collections4.ListUtils;
import org.apache.commons.lang.StringUtils;
@ -72,6 +70,8 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
private RemoteSapService remoteSapService;
@Autowired
private ProWetMaterialPlanMapper proWetMaterialPlanMapper;
@Autowired
private ProWhiteOrderMapper proWhiteOrderMapper;
/**
*

@ -1,8 +1,10 @@
package com.op.plan.service.impl;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.context.SecurityContextHolder;
import com.op.common.core.domain.R;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.core.web.domain.AjaxResult;
@ -11,10 +13,17 @@ import com.op.plan.domain.vo.CascaderDTO;
import com.op.plan.domain.vo.SplitProWhiteOrderVo;
import com.op.plan.mapper.*;
import com.op.plan.service.IProWhiteOrderService;
import com.op.system.api.RemoteSapService;
import com.op.system.api.domain.quality.HRInfo;
import com.op.system.api.domain.sap.SapWBDemand;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
@ -32,7 +41,7 @@ import static com.op.common.core.web.domain.AjaxResult.success;
*/
@Service
public class ProWhiteOrderServiceImpl implements IProWhiteOrderService {
protected Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private ProWhiteOrderMapper proWhiteOrderMapper;
@Autowired
@ -47,7 +56,8 @@ public class ProWhiteOrderServiceImpl implements IProWhiteOrderService {
private ProOrderWorkorderBatchMapper proOrderWorkorderBatchMapper;
@Autowired
private ProWetMaterialPlanDetailMapper proWetMaterialPlanDetailMapper;
@Autowired
private RemoteSapService remoteSapService;
/**
*
*
@ -325,6 +335,70 @@ public class ProWhiteOrderServiceImpl implements IProWhiteOrderService {
}
}
/**
* sap
*/
@Override
@DS("#header.poolName")
public void syncSAPbp(ProOrder proOrder) {
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
Map<String, Object> dataParams = new HashMap<>();
dataParams.put("werks", request.getHeader(key.substring(8)).replace("ds_",""));
//dataParams.put("werks","1000");
logger.info("白坯手动订单同步:【参数】" + JSONObject.toJSONString(dataParams));
//取>=20230923的sap数据
R rSapProOrder = remoteSapService.zmesPurwqGet(dataParams);//sap只能同步指定日期的数据
List<SapWBDemand> sapWBDemandList = JSONArray.parseArray(JSONObject.toJSONString(rSapProOrder.getData()), SapWBDemand.class);
if (CollectionUtils.isEmpty(sapWBDemandList)) {
System.out.println("无最新的白坯订单");
} else {
logger.info("白坯手动订单同步:【结果】" + JSONObject.toJSONString(sapWBDemandList));
syncSAPbpFunc(sapWBDemandList, "bpsap");
}
}
@Transactional(rollbackFor = Exception.class)
public String syncSAPbpFunc(List<SapWBDemand> newOrders,String syncUser){
List<ProOrder> orders = new ArrayList<>();
ProOrder proOrder = null;
String bpDD = "DD" + DateUtils.parseDateToStr(DateUtils.YYYYMMDD, DateUtils.getNowDate());
int m=1;
Date nowDate = DateUtils.getNowDate();
for (SapWBDemand sapProOrder:newOrders) {
if(StringUtils.isNotBlank(sapProOrder.getMatnr())&&StringUtils.isNotBlank(sapProOrder.getMaktx())){
//工单生产后整个订单就被锁定//订单存在就更新,不存在就插入
proOrder = new ProOrder();
proOrder.setPlanFactoryCode(sapProOrder.getWerks());
proOrder.setMaterialCode(sapProOrder.getMatnr());
proOrder.setMaterialName(sapProOrder.getMaktx());
double menge = sapProOrder.getMenge();
proOrder.setQuantity((long)menge);
proOrder.setUnit(sapProOrder.getMeins());
proOrder.setPlanProDate(sapProOrder.getBedat());
proOrder.setPlanComplete(sapProOrder.getBedat());
proOrder.setSyncUser(syncUser);
proOrder.setCreateBy(syncUser);
proOrder.setCreateTime(nowDate);
proOrder.setId(IdUtils.fastSimpleUUID());
proOrder.setStatus("o0");
proOrder.setOrderType("white");
proOrder.setProdType("white");
int liushuiNum = proWhiteOrderMapper.getTodayMaxNum(proOrder)+(m++);
String liushuiStr = String.format("%04d", liushuiNum);
proOrder.setOrderCode(bpDD + liushuiStr);
orders.add(proOrder);
}
}
int snum = proOrderWorkorderMapper.bpAddBatch(orders);
logger.info("成功条数:"+snum);
return "成功条数:"+snum;
}
public static void main(String args[]) {
String formatted = String.format("%04d", 7);
System.out.println(formatted);

@ -916,6 +916,24 @@
)
</foreach>
</insert>
<insert id="bpAddBatch">
INSERT INTO pro_order (
id,plan_factory_code,order_type,order_code,
prod_code,prod_desc,
quantity,unit,
plan_pro_date, plan_complete,
create_by,create_time
)VALUES
<foreach collection="list" item="d" index="index" separator=",">
(
#{d.id},#{d.planFactoryCode},#{d.orderType},#{d.orderCode},
#{d.materialCode},#{d.materialName},
#{d.quantity},#{d.unit},
#{d.planProDate},#{d.planComplete},
#{d.createBy},#{d.createTime}
)
</foreach>
</insert>
<update id="updateProOrderWorkorder" parameterType="ProOrderWorkorder">
update pro_order_workorder

@ -509,4 +509,16 @@ public class QcCheckTaskIncomeController extends BaseController {
}
return success();
}
/**应用最新检验方案,重新生成检验任务**/
@PostMapping(value = "/changeTaskDetail")
public AjaxResult changeTaskDetail(@RequestBody QcCheckTaskIncome task) {
QcCheckTaskIncome taskInfo = qcCheckTaskIncomeService.getTaskInfoByRecordId(task.getRecordId());
if(taskInfo.getCheckStatus().equals("2")){
return error("任务已经检验无法重新生成检验任务!");
}
task.setMaterialCode(taskInfo.getMaterialCode());
task.setCheckType(taskInfo.getCheckType());
return toAjax(qcCheckTaskIncomeService.changeTaskDetail(task));
}
}

@ -2,6 +2,7 @@ package com.op.quality.controller;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
@ -9,8 +10,10 @@ import com.alibaba.fastjson2.JSONObject;
import com.op.common.core.domain.R;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.StringUtils;
import com.op.quality.domain.InventoryExportDTO;
import com.op.quality.domain.OACheckTaskDTO;
import com.op.quality.domain.QcCheckTaskIncome;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.GetMapping;
@ -71,8 +74,15 @@ public class QcCheckTaskInventoryController extends BaseController {
@Log(title = "库存检验任务", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, QcCheckTaskInventory qcCheckTaskInventory) {
List<QcCheckTaskInventory> list = qcCheckTaskInventoryService.selectQcCheckTaskInventoryList(qcCheckTaskInventory);
ExcelUtil<QcCheckTaskInventory> util = new ExcelUtil<QcCheckTaskInventory>(QcCheckTaskInventory.class);
List<QcCheckTaskInventory> list0 = qcCheckTaskInventoryService.selectQcCheckTaskInventoryList(qcCheckTaskInventory);
List<InventoryExportDTO> list = new ArrayList<>();
for(QcCheckTaskInventory dto0:list0){
InventoryExportDTO dto = new InventoryExportDTO();
BeanUtils.copyProperties(dto0,dto);
list.add(dto);
}
ExcelUtil<InventoryExportDTO> util = new ExcelUtil<InventoryExportDTO>(InventoryExportDTO.class);
util.exportExcel(response, list, "库存检验任务数据");
}

@ -613,7 +613,7 @@ public class QcStaticTableController extends BaseController {
//表格结构数据
ArrayList<ExcelCol> excelCols = new ArrayList<>();
excelCols.add(new ExcelCol("时间", "timeCol", 15));
excelCols.add(new ExcelCol("抽数", "sampleQuality", 10));
excelCols.add(new ExcelCol("抽数", "sampleQuality", 10));
for (int n = 0; n < title2Cols.size(); n++) {
excelCols.add(new ExcelCol(title2Cols.get(n), "col" + (n), 15));
@ -649,7 +649,7 @@ public class QcStaticTableController extends BaseController {
List<HashMap> list = qcStaticTableService.getTableHzDataSC(qcStaticTable);
List<String> title2Cols = titledto.getColumns1();
//String titleRow1 = String.join(",", title2Cols);
String titleRow1 = "巡检分析报表";
String titleRow1 = "来料统计分析";
//表格结构数据
ArrayList<ExcelCol> excelCols = new ArrayList<>();
excelCols.add(new ExcelCol("时间", "timeCol", 15));

@ -0,0 +1,271 @@
package com.op.quality.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* qc_check_task_inventory
*
* @author Open Platform
* @date 2024-01-12
*/
public class InventoryExportDTO extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* id
*/
private String recordId;
/**
*
*/
@Excel(name = "检验任务编号")
private String checkNo;
/**
*
*/
@Excel(name = "订单号")
private String orderNo;
/**
*
*/
@Excel(name = "物料号")
private String materialCode;
/**
*
*/
@Excel(name = "物料名称")
private String materialName;
/**
*
*/
@Excel(name = "收货数量")
private BigDecimal quality;
/**
*
*/
//@Excel(name = "单位")
private String unit;
/**
*
*/
@Excel(name = "仓库编码")
private String supplierCode;
/**
*
*/
@Excel(name = "仓库名称")
private String supplierName;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "入库时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date incomeTime;
/**
* 012
*/
@Excel(name = "检测状态", readConverterExp = "0=待检测,1=检测中,2=检测完成")
private String checkStatus;
/**
*
*/
@Excel(name = "检测人工号")
private String checkManCode;
/**
*
*/
@Excel(name = "检测人姓名")
private String checkManName;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "检验时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date checkTime;
/**
* Y
*/
@Excel(name = "检验结果", readConverterExp = "Y=合格,N=不合格")
private String checkResult;
@Excel(name = "检验节点", readConverterExp = "checkTypeCC=库存检验")
private String checkType;
/**
*
*/
@Excel(name = "不合格数量")
private BigDecimal noOkQuality;
/**
*
*/
@Excel(name = "抽样数量")
private BigDecimal sampleQuality;
public String getRecordId() {
return recordId;
}
public void setRecordId(String recordId) {
this.recordId = recordId;
}
public String getCheckNo() {
return checkNo;
}
public void setCheckNo(String checkNo) {
this.checkNo = checkNo;
}
public String getOrderNo() {
return orderNo;
}
public void setOrderNo(String orderNo) {
this.orderNo = orderNo;
}
public BigDecimal getSampleQuality() {
return sampleQuality;
}
public void setSampleQuality(BigDecimal sampleQuality) {
this.sampleQuality = sampleQuality;
}
public String getMaterialCode() {
return materialCode;
}
public void setMaterialCode(String materialCode) {
this.materialCode = materialCode;
}
public String getMaterialName() {
return materialName;
}
public void setMaterialName(String materialName) {
this.materialName = materialName;
}
public BigDecimal getQuality() {
return quality;
}
public void setQuality(BigDecimal quality) {
this.quality = quality;
}
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
public String getSupplierCode() {
return supplierCode;
}
public void setSupplierCode(String supplierCode) {
this.supplierCode = supplierCode;
}
public String getSupplierName() {
return supplierName;
}
public void setSupplierName(String supplierName) {
this.supplierName = supplierName;
}
public Date getIncomeTime() {
return incomeTime;
}
public void setIncomeTime(Date incomeTime) {
this.incomeTime = incomeTime;
}
public String getCheckStatus() {
return checkStatus;
}
public void setCheckStatus(String checkStatus) {
this.checkStatus = checkStatus;
}
public String getCheckManCode() {
return checkManCode;
}
public void setCheckManCode(String checkManCode) {
this.checkManCode = checkManCode;
}
public String getCheckManName() {
return checkManName;
}
public void setCheckManName(String checkManName) {
this.checkManName = checkManName;
}
public Date getCheckTime() {
return checkTime;
}
public void setCheckTime(Date checkTime) {
this.checkTime = checkTime;
}
public String getCheckResult() {
return checkResult;
}
public void setCheckResult(String checkResult) {
this.checkResult = checkResult;
}
public String getCheckType() {
return checkType;
}
public void setCheckType(String checkType) {
this.checkType = checkType;
}
public BigDecimal getNoOkQuality() {
return noOkQuality;
}
public void setNoOkQuality(BigDecimal noOkQuality) {
this.noOkQuality = noOkQuality;
}
}

@ -39,9 +39,10 @@ public class QcCheckTaskInventory extends BaseEntity {
/**
*
*/
@Excel(name = "单号")
@Excel(name = "单号")
private String orderNo;
@Excel(name = "订单号")
private String workorderCodeSap;
/**
*
*/
@ -525,6 +526,14 @@ public class QcCheckTaskInventory extends BaseEntity {
this.serialNumber = serialNumber;
}
public String getWorkorderCodeSap() {
return workorderCodeSap;
}
public void setWorkorderCodeSap(String workorderCodeSap) {
this.workorderCodeSap = workorderCodeSap;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

@ -159,4 +159,6 @@ public interface QcCheckTaskIncomeMapper {
void deleteTaskDetail(String deleteIds);
void deleteTaskUser(String deleteIds);
QcCheckTaskIncome getTaskInfoByRecordId(String recordId);
}

@ -84,4 +84,6 @@ public interface QcCheckTypeProjectMapper {
QcMaterialGroupDetail selectExist(QcMaterialGroupDetail materialGroupDetail);
int clearTaskDetail(String recordId);
int clearTaskDefect(String recordId);
}

@ -113,4 +113,8 @@ public interface IQcCheckTaskIncomeService {
int commitCheckResultsCg(QcCheckTaskIncome qcCheckTaskIncome);
int togetherTask(QcCheckTaskIncome income);
QcCheckTaskIncome getTaskInfoByRecordId(String recordId);
int changeTaskDetail(QcCheckTaskIncome task);
}

@ -26,6 +26,7 @@ import com.op.system.api.domain.SysNoticeGroup;
import com.op.system.api.domain.SysUser;
import com.op.system.api.domain.dto.WechartDTO;
import com.op.system.api.domain.quality.QcCheckTaskIncomeDTO;
import com.op.system.api.domain.quality.QcMaterialGroupDetailDTO;
import com.op.system.api.domain.quality.QcUserMaterialDTO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -870,6 +871,85 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
return m;
}
@Override
@DS("#header.poolName")
public QcCheckTaskIncome getTaskInfoByRecordId(String recordId) {
return qcCheckTaskIncomeMapper.getTaskInfoByRecordId(recordId);
}
@Override
@DS("#header.poolName")
public int changeTaskDetail(QcCheckTaskIncome task) {
//清理检验明细项目
int dnum1 = qcCheckTypeProjectMapper.clearTaskDetail(task.getRecordId());
System.out.println("删除1"+dnum1);
int dnum2 = qcCheckTypeProjectMapper.clearTaskDefect(task.getRecordId());
System.out.println("删除2"+dnum2);
/**取检测项**/
QcCheckTypeProject qctp= new QcCheckTypeProject();
qctp.setTypeId(task.getCheckType());//检验节点
qctp.setMaterialCode(task.getMaterialCode());//特性
/**qc_check_type_project**///个性
List<QcCheckTaskDetail> items = qcCheckTypeProjectMapper.getTPByTypeMaterial(qctp);
/**qc_material_group_detail**/
QcMaterialGroupDetail group = qcMaterialGroupDetailMapper.getGroupByMaterial(task.getMaterialCode());
//共性
if(group == null){//默认
if(task.getCheckType().equals("checkTypeLL")){
group = new QcMaterialGroupDetail();
QcProjectType initGroup = qcCheckTypeProjectMapper.getProductGroup(task.getMaterialCode());
if(initGroup != null){
group.setGroupId(initGroup.getGroupId());
}else{
return 0;//没有找到检测项目
}
}else if(task.getCheckType().equals("checkTypeSCXJ")
||task.getCheckType().equals("checkTypeSC")
||task.getCheckType().equals("checkTypeCP")){
group = new QcMaterialGroupDetail();
group.setGroupId("3dc0655fea3449c59c76a01cc5b91565");//成品蚊香物料组
}else if(task.getCheckType().equals("checkTypeCC")){
group = new QcMaterialGroupDetail();
QcProjectType initGroup = qcCheckTypeProjectMapper.getProductGroup(task.getMaterialCode());
if(initGroup != null){//包材共性
group.setGroupId(initGroup.getGroupId());
}else{//成品共性
group.setGroupId("3dc0655fea3449c59c76a01cc5b91565");
}
}
}
List<QcCheckTaskDetail> itemsGG = new ArrayList<>();
if(StringUtils.isNotBlank(group.getGroupId())){
qctp.setGroupId(group.getGroupId());
itemsGG = qcCheckTypeProjectMapper.getTPByTypeGroup(qctp);
}
items.addAll(itemsGG);
/**qc_check_task_detail**/
if(CollectionUtils.isEmpty(items)){
logger.info("检验任务创建参数缺失:"+task.getMaterialCode());
return 0;//没有找到检测项目
}
/**qc_check_task_detail**/
Date nowDate = DateUtils.getNowDate();
String createBy = SecurityUtils.getUsername();
//获取当前所选工厂
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
String factoryCode = request.getHeader(key.substring(8)).replace("ds_","");
for(QcCheckTaskDetail item:items){
item.setRecordId(IdUtils.fastSimpleUUID());
item.setBelongTo(task.getRecordId());
item.setCreateTime(nowDate);
item.setCreateBy(createBy);
item.setFactoryCode(factoryCode);
item.setStatus("Y");
}
return qcCheckTaskDetailMapper.addBatch(items);
}
@Override
//@Transactional(rollbackFor = Exception.class)
public int commitCheckResults(QcCheckTaskIncome qcCheckTaskIncome) {

@ -1125,9 +1125,12 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService {
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);
colMap.put("noOkQua",sampl.getNoOkQuality());
}else{
colMap.put("sampleQuality","0");
colMap.put("noOkRate","0");
colMap.put("noOkQua","0");
}
//不良数(不折算)
Map<String,QcStaticTable> noOks = qcStaticTableMapper.getNoOkPCNum(qcStaticTable);

@ -861,6 +861,14 @@
where qct.record_id in(${ids})
order by qct.check_no desc
</select>
<select id="getTaskInfoByRecordId" resultType="com.op.quality.domain.QcCheckTaskIncome">
select
qct.check_status checkStatus,
qct.material_code materialCode,
qct.check_type checkType
from qc_check_task qct
where qct.record_id in('${ids}')
</select>
<!--批量更新原始表-->
<update id="updateIncomeBatchList">

@ -41,6 +41,8 @@
<result property="cNoOkquality" column="cNoOkquality"/>
<result property="typeCode" column="type_code"/>
<result property="orderType" column="order_type"/>
<result property="workorderCodeSap" column="workorderCodeSap"/>
</resultMap>
<sql id="selectQcCheckTaskInventoryVo">
@ -54,7 +56,8 @@
<select id="selectQcCheckTaskInventoryList" parameterType="QcCheckTaskInventory"
resultMap="QcCheckTaskInventoryResult">
select qct.record_id, qct.check_no, qct.income_batch_no,
qct.order_no, qct.material_code, qct.material_name, qct.quality, qct.unit,
case when pow.workorder_code_sap is null then qct.order_no else SUBSTRING(pow.workorder_code_sap,4,10) end order_no,
qct.material_code, qct.material_name, qct.quality, qct.unit,
qct.supplier_code, qct.supplier_name, qct.income_time, qct.check_loc, qct.check_status,
qct.check_man_code, qct.check_man_name,qct.check_time, qct.check_result, qct.status,
qct.create_by,qct.create_time, qct.update_by, qct.update_time,
@ -62,16 +65,21 @@
q.type_code
from qc_check_task qct
left join qc_check_type q on q.id = qct.check_type
left join pro_order_workorder pow on pow.workorder_code = qct.order_no and pow.del_flag = '0'
<where>
<if test="checkNo != null and checkNo != ''">and qct.check_no = #{checkNo}</if>
<if test="incomeBatchNo != null and incomeBatchNo != ''">and qct.income_batch_no = #{incomeBatchNo}</if>
<if test="orderNo != null and orderNo != ''">and qct.order_no = #{orderNo}</if>
<if test="orderNo != null and orderNo != ''">and (
qct.order_no like concat('%', #{orderNo},'%') or
pow.workorder_code_sap like concat('%',#{orderNo},'%')
)</if>
<if test="materialCode != null and materialCode != ''">
and qct.material_code like concat('%',#{materialCode}, '%')
</if>
<if test="materialName != null and materialName != ''">
and qct.material_name like concat('%',#{materialName}, '%')
</if>
<if test="supplierCode != null and supplierCode != ''">and qct.supplier_code like concat('%',#{supplierCode}, '%')</if>
<if test="supplierName != null and supplierName != ''">and qct.supplier_name like concat('%',#{supplierName}, '%')</if>
<if test="incomeTime != null ">and qct.income_time = #{incomeTime}</if>
@ -91,6 +99,7 @@
<if test="checkTimeEnd != null ">and #{checkTimeEnd} > CONVERT(varchar(30),qct.create_time, 120)</if>
<if test="checkType != null ">and qct.check_type = #{checkType}</if>
<if test="typeCode != null ">and q.type_code = #{typeCode}</if>
and qct.del_flag = '0'
</where>
order by qct.create_time desc
</select>
@ -301,7 +310,9 @@
t0.supplierName,
t0.check_Type
from (-->
select t.order_no orderNo,
select
SUBSTRING(pow.workorder_code_sap,4,10) workorderCodeSap,
t.order_no orderNo,
t.material_code materialCode,
t.material_name materialName,
t.quality quality,
@ -317,13 +328,13 @@
left join (
select order_no,material_code,max(create_time) create_time
from qc_check_task where check_type='checkTypeCC' and del_flag = '0' GROUP BY order_no,material_code
) qct on qct.order_no = t.order_no
and t.material_code = qct.material_code
where bp.warehouse_cycle is not null and t.check_type in('checkTypeLL','checkTypeCP') and t.del_flag = '0'
) qct on qct.order_no = t.order_no and t.material_code = qct.material_code
left join pro_order_workorder pow on pow.workorder_code = qct.order_no
where bp.warehouse_cycle is not null and t.check_type in('checkTypeLL','checkTypeCP') and t.del_flag = '0' and pow.del_flag = '0'
<if test="materialCode != null">and t.material_code like concat('%',#{materialCode}, '%')</if>
<if test="materialName != null">and t.material_name like concat('%',#{materialName}, '%')</if>
<if test="orderNo != null">and t.order_no like concat('%',#{orderNo}, '%')</if>
<if test="workorderCodeSap != null ">and pow.workorder_code_sap like concat('%',#{workorderCodeSap},'%')</if>
order by t.income_time desc,t.order_no,t.material_code
<!--
)t0

@ -271,6 +271,12 @@
#{id}
</foreach>
</delete>
<delete id="clearTaskDetail">
delete from qc_check_task_detail where belong_to = #{recordId}
</delete>
<delete id="clearTaskDefect">
delete from qc_check_task_defect where belong_to = #{recordId}
</delete>
<select id="getProjectInfoList" resultType="com.op.quality.domain.QcCheckProject">
select
id,

@ -205,6 +205,7 @@
left join pro_order_workorder pow on pow.workorder_code = qct.order_no
left join base_equipment be on be.equipment_code = qct.check_loc
where qct.check_type = 'checkTypeSCXJ' and qct.del_flag = '0' and pow.del_flag = '0'
<if test="workorderCodeSap != null ">and pow.workorder_code_sap like concat('%',#{workorderCodeSap},'%')</if>
<if test="orderNo != null ">and qct.check_no like concat('%',#{orderNo},'%')</if>
<if test="materialCode != null ">and (
qct.material_code like concat('%',#{materialCode},'%') or qct.material_name like concat('%',#{materialCode},'%')
@ -877,7 +878,7 @@
<if test="ymdms == 'mm'">
and CONVERT(varchar(7),qct.create_time, 120) = #{incomeTimeStr}
</if>
<if test="ymdms == 'mm'">
<if test="ymdms == 'dd'">
and CONVERT(varchar(10),qct.create_time, 120) = #{incomeTimeStr}
</if>
</select>
@ -1020,6 +1021,7 @@
left join base_equipment be on be.equipment_code = qct.check_loc
where qct.check_type = 'checkTypeSCXJ' and qct.del_flag = '0' and qct.check_status = '2' and be.del_flag = '0' and pow.del_flag = '0'
<if test="orderNo != null ">and qct.check_no like concat('%',#{orderNo},'%')</if>
<if test="workorderCodeSap != null ">and pow.workorder_code_sap like concat('%',#{workorderCodeSap},'%')</if>
<if test="materialCode != null ">and qct.material_code like concat('%',#{materialCode},'%')</if>
<if test="incomeBatchNo != null ">and qct.income_batch_no like concat('%',#{incomeBatchNo},'%')</if>
<if test="incomeTimeStr != null ">and CONVERT(varchar(10),pow.product_date, 120) = #{incomeTimeStr}</if>

@ -10,7 +10,7 @@ import com.op.common.core.utils.StringUtils;
import com.op.common.core.utils.bean.BeanValidators;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.security.utils.SecurityUtils;
import com.op.sap.domain.vo.SapWBDemand;
import com.op.system.api.domain.sap.SapWBDemand;
import com.op.system.api.domain.quality.QcCheckTaskIncomeDTO;
import com.op.system.api.domain.sap.SapBackflushMPQuery;
import com.op.sap.domain.vo.SapItemQuery;
@ -25,7 +25,6 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;
import javax.validation.Validator;
import java.math.BigDecimal;

Loading…
Cancel
Save