Merge remote-tracking branch 'origin/master'

master
Yangwl 3 months ago
commit 7475c667e9

@ -2,7 +2,7 @@ package com.op.common.core.constant;
/**
*
*
*
* @author OP
*/
public class HttpStatus {
@ -91,3 +91,5 @@ public class HttpStatus {
*/
public static final int WARN = 601;
}

@ -190,9 +190,9 @@ public class RyTask {
remoteQualityService.createCPBatchTask();
}
//质量检验任务没有检查的,一小时后重新发送微信提醒,三分钟一次
//质量检验任务没有检查的,2小时后重新发送微信提醒一次(除成品检验外)
public void resendWXTask(){
logger.info("++质量管理系统+检验任务一小时后重新发送微信提醒+开始++resendWXTask+++++");
logger.info("++质量管理系统+检验任务2小时后重新发送微信提醒一次(成品检验除外)+开始++resendWXTask+++++");
remoteQualityService.resendWXTask();
}

@ -0,0 +1,105 @@
package com.op.mes.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.op.common.security.annotation.RequiresPermissions;
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.core.web.controller.BaseController;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.log.enums.BusinessType;
import com.op.mes.domain.MesCxjProducted;
import com.op.mes.service.IMesCxjProductedService;
import com.op.common.core.utils.poi.ExcelUtil;
import com.op.common.core.web.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2025-03-20
*/
@RestController
@RequestMapping("/producted")
public class MesCxjProductedController extends BaseController
{
@Autowired
private IMesCxjProductedService mesCxjProductedService;
/**
*
*/
// @RequiresPermissions("@ss.hasPermi('system:producted:list')")
@GetMapping("/list")
public TableDataInfo list(MesCxjProducted mesCxjProducted)
{
startPage();
List<MesCxjProducted> list = mesCxjProductedService.selectMesCxjProductedList(mesCxjProducted);
return getDataTable(list);
}
/**
*
*/
// @PreAuthorize("@ss.hasPermi('system:producted:export')")
@Log(title = "成型机产量", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, MesCxjProducted mesCxjProducted)
{
List<MesCxjProducted> list = mesCxjProductedService.selectMesCxjProductedList(mesCxjProducted);
ExcelUtil<MesCxjProducted> util = new ExcelUtil<MesCxjProducted>(MesCxjProducted.class);
util.exportExcel(response, list, "成型机产量数据");
}
/**
*
*/
// @PreAuthorize("@ss.hasPermi('system:producted:query')")
@GetMapping(value = "/{workorderCode}")
public AjaxResult getInfo(@PathVariable("workorderCode") String workorderCode)
{
return success(mesCxjProductedService.selectMesCxjProductedByWorkorderCode(workorderCode));
}
/**
*
*/
// @PreAuthorize("@ss.hasPermi('system:producted:add')")
@Log(title = "成型机产量", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MesCxjProducted mesCxjProducted)
{
return toAjax(mesCxjProductedService.insertMesCxjProducted(mesCxjProducted));
}
/**
*
*/
// @PreAuthorize("@ss.hasPermi('system:producted:edit')")
@Log(title = "成型机产量", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MesCxjProducted mesCxjProducted)
{
return toAjax(mesCxjProductedService.updateMesCxjProducted(mesCxjProducted));
}
/**
*
*/
// @PreAuthorize("@ss.hasPermi('system:producted:remove')")
@Log(title = "成型机产量", businessType = BusinessType.DELETE)
@DeleteMapping("/{workorderCodes}")
public AjaxResult remove(@PathVariable String[] workorderCodes)
{
return toAjax(mesCxjProductedService.deleteMesCxjProductedByWorkorderCodes(workorderCodes));
}
}

@ -0,0 +1,136 @@
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 org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
/**
* mes_cxj_producted
*
* @author chj
* @date 2025-03-20
*/
public class MesCxjProducted extends BaseEntity
{
private static final long serialVersionUID = 1L;
/**
*
*/
private String productCode;
/*
*/
private String productName;
/**
*
*/
private String ShiftId;
/** 工单号 */
@Excel(name = "工单号")
private String workorderCode;
/** 机台编码 */
@Excel(name = "机台编码")
private String workorderName;
/**
*
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime beginTime;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime endTime;
public LocalDateTime getBeginTime() {
return beginTime;
}
public void setBeginTime(LocalDateTime beginTime) {
this.beginTime = beginTime;
}
public LocalDateTime getEndTime() {
return endTime;
}
public void setEndTime(LocalDateTime endTime) {
this.endTime = endTime;
}
/** 备用1 */
@Excel(name = "备用1")
private String attr1;
/** 备用2 */
@Excel(name = "备用2")
private String attr2;
/** 备用2 */
@Excel(name = "备用2")
private String attr3;
public String getProductCode() {
return productCode;
}
public void setProductCode(String productCode) {
this.productCode = productCode;
}
public String getProductName() {
return productName;
}
public void setProductName(String productName) {
this.productName = productName;
}
public String getShiftId() {
return ShiftId;
}
public void setShiftId(String shiftId) {
ShiftId = shiftId;
}
public String getWorkorderCode() {
return workorderCode;
}
public void setWorkorderCode(String workorderCode) {
this.workorderCode = workorderCode;
}
public String getWorkorderName() {
return workorderName;
}
public void setWorkorderName(String workorderName) {
this.workorderName = workorderName;
}
@Override
public String toString() {
return "MesCxjProducted{" +
"productCode='" + productCode + '\'' +
", productName='" + productName + '\'' +
", ShiftId='" + ShiftId + '\'' +
", workorderCode='" + workorderCode + '\'' +
", workorderName='" + workorderName + '\'' +
", beginTime='" + beginTime + '\'' +
", endTime='" + endTime + '\'' +
", attr1='" + attr1 + '\'' +
", attr2='" + attr2 + '\'' +
", attr3='" + attr3 + '\'' +
'}';
}
}

@ -0,0 +1,61 @@
package com.op.mes.mapper;
import java.util.List;
import com.op.mes.domain.MesCxjProducted;
/**
* Mapper
*
* @author ruoyi
* @date 2025-03-20
*/
public interface MesCxjProductedMapper
{
/**
*
*
* @param workorderCode
* @return
*/
public MesCxjProducted selectMesCxjProductedByWorkorderCode(String workorderCode);
/**
*
*
* @param mesCxjProducted
* @return
*/
public List<MesCxjProducted> selectMesCxjProductedList(MesCxjProducted mesCxjProducted);
/**
*
*
* @param mesCxjProducted
* @return
*/
public int insertMesCxjProducted(MesCxjProducted mesCxjProducted);
/**
*
*
* @param mesCxjProducted
* @return
*/
public int updateMesCxjProducted(MesCxjProducted mesCxjProducted);
/**
*
*
* @param workorderCode
* @return
*/
public int deleteMesCxjProductedByWorkorderCode(String workorderCode);
/**
*
*
* @param workorderCodes
* @return
*/
public int deleteMesCxjProductedByWorkorderCodes(String[] workorderCodes);
}

@ -0,0 +1,61 @@
package com.op.mes.service;
import java.util.List;
import com.op.mes.domain.MesCxjProducted;
/**
* Service
*
* @author ruoyi
* @date 2025-03-20
*/
public interface IMesCxjProductedService
{
/**
*
*
* @param workorderCode
* @return
*/
public MesCxjProducted selectMesCxjProductedByWorkorderCode(String workorderCode);
/**
*
*
* @param mesCxjProducted
* @return
*/
public List<MesCxjProducted> selectMesCxjProductedList(MesCxjProducted mesCxjProducted);
/**
*
*
* @param mesCxjProducted
* @return
*/
public int insertMesCxjProducted(MesCxjProducted mesCxjProducted);
/**
*
*
* @param mesCxjProducted
* @return
*/
public int updateMesCxjProducted(MesCxjProducted mesCxjProducted);
/**
*
*
* @param workorderCodes
* @return
*/
public int deleteMesCxjProductedByWorkorderCodes(String[] workorderCodes);
/**
*
*
* @param workorderCode
* @return
*/
public int deleteMesCxjProductedByWorkorderCode(String workorderCode);
}

@ -0,0 +1,103 @@
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 org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.mes.mapper.MesCxjProductedMapper;
import com.op.mes.domain.MesCxjProducted;
import com.op.mes.service.IMesCxjProductedService;
/**
* Service
*
* @author ruoyi
* @date 2025-03-20
*/
@Service
public class MesCxjProductedServiceImpl implements IMesCxjProductedService
{
@Autowired
private MesCxjProductedMapper mesCxjProductedMapper;
/**
*
*
* @param workorderCode
* @return
*/
@Override
@DS("#header.poolName")
public MesCxjProducted selectMesCxjProductedByWorkorderCode(String workorderCode)
{
return mesCxjProductedMapper.selectMesCxjProductedByWorkorderCode(workorderCode);
}
/**
*
*
* @param mesCxjProducted
* @return
*/
@Override
@DS("#header.poolName")
public List<MesCxjProducted> selectMesCxjProductedList(MesCxjProducted mesCxjProducted)
{
return mesCxjProductedMapper.selectMesCxjProductedList(mesCxjProducted);
}
/**
*
*
* @param mesCxjProducted
* @return
*/
@Override
@DS("#header.poolName")
public int insertMesCxjProducted(MesCxjProducted mesCxjProducted)
{
mesCxjProducted.setCreateTime(DateUtils.getNowDate());
return mesCxjProductedMapper.insertMesCxjProducted(mesCxjProducted);
}
/**
*
*
* @param mesCxjProducted
* @return
*/
@Override
@DS("#header.poolName")
public int updateMesCxjProducted(MesCxjProducted mesCxjProducted)
{
return mesCxjProductedMapper.updateMesCxjProducted(mesCxjProducted);
}
/**
*
*
* @param workorderCodes
* @return
*/
@Override
@DS("#header.poolName")
public int deleteMesCxjProductedByWorkorderCodes(String[] workorderCodes)
{
return mesCxjProductedMapper.deleteMesCxjProductedByWorkorderCodes(workorderCodes);
}
/**
*
*
* @param workorderCode
* @return
*/
@Override
@DS("#header.poolName")
public int deleteMesCxjProductedByWorkorderCode(String workorderCode)
{
return mesCxjProductedMapper.deleteMesCxjProductedByWorkorderCode(workorderCode);
}
}

@ -162,49 +162,61 @@ public class MesLineAssistantQtyServiceImpl implements IMesLineAssistantQtyServi
MesLineAssistantQty manQty = assistMaps.get(mesLineAssistant.getProductDateStr());
if(manQty!=null){
//班长用人=当日人数*工时占比
assistdto.setMonitorQty(new BigDecimal(manQty.getMonitorQty())
assistdto.setMonitorQty(new BigDecimal(manQty.getMonitorQty()==null?0L:manQty.getMonitorQty())
.multiply(new BigDecimal(assistdto.getHourRatio().replace("%","")))
.multiply(new BigDecimal("0.01"))
.toString()
);
//班长工时=当日考勤小时数*工时占比
assistdto.setMonitorHour(
monitorHour.multiply(
new BigDecimal(assistdto.getHourRatio().replace("%",""))).toString());
monitorHour.multiply(new BigDecimal(assistdto.getHourRatio().replace("%","")))
.multiply(new BigDecimal("0.01"))
.toString());
//组长用人=当日人数*工时占比
assistdto.setGroupleaderQty(new BigDecimal(manQty.getGroupleaderQty())
assistdto.setGroupleaderQty(new BigDecimal(manQty.getGroupleaderQty()==null?0L:manQty.getGroupleaderQty())
.multiply(new BigDecimal(assistdto.getHourRatio().replace("%","")))
.multiply(new BigDecimal("0.01"))
.toString()
);
//组长工时=当日考勤小时数*工时占比
assistdto.setGroupLeaderHour(
groupleadeHour.multiply(
new BigDecimal(assistdto.getHourRatio().replace("%",""))).toString());
groupleadeHour.multiply(new BigDecimal(assistdto.getHourRatio().replace("%","")))
.multiply(new BigDecimal("0.01"))
.toString()
);
//物料员用人=当日人数*工时占比
assistdto.setMaterialQty(new BigDecimal(manQty.getMaterialQty())
assistdto.setMaterialQty(new BigDecimal(manQty.getMaterialQty()==null?0L:manQty.getMaterialQty())
.multiply(new BigDecimal(assistdto.getHourRatio().replace("%","")))
.multiply(new BigDecimal("0.01"))
.toString()
);
//物料员工时=当日考勤小时数*工时占比
assistdto.setMaterialHour(
materialHour.multiply(
new BigDecimal(assistdto.getHourRatio().replace("%",""))).toString());
materialHour.multiply(new BigDecimal(assistdto.getHourRatio().replace("%","")))
.multiply(new BigDecimal("0.01"))
.toString());
//药管员用人=当日人数*工时占比
assistdto.setPillMgrQty(new BigDecimal(manQty.getPillMgrQty())
assistdto.setPillMgrQty(new BigDecimal(manQty.getPillMgrQty()==null?0L:manQty.getPillMgrQty())
.multiply(new BigDecimal(assistdto.getHourRatio().replace("%","")))
.multiply(new BigDecimal("0.01"))
.toString()
);
//药管员工时=当日考勤小时数*工时占比
assistdto.setPillMgrHour(
pillMgrHour.multiply(new BigDecimal(assistdto.getHourRatio().replace("%",""))).toString());
pillMgrHour.multiply(new BigDecimal(assistdto.getHourRatio().replace("%","")))
.multiply(new BigDecimal("0.01"))
.toString());
//配药员用人=当日人数*工时占比
assistdto.setPillDisQty(new BigDecimal(manQty.getPillDisQty())
assistdto.setPillDisQty(new BigDecimal(manQty.getPillDisQty()==null?0L:manQty.getPillDisQty())
.multiply(new BigDecimal(assistdto.getHourRatio().replace("%","")))
.multiply(new BigDecimal("0.01"))
.toString()
);
//配药员工时=当日考勤小时数/线体数
//配药员工时=当日考勤小时数*工时占比
assistdto.setPillDisHour(
pillDisHour.multiply(
new BigDecimal(assistdto.getHourRatio().replace("%",""))).toString());
pillDisHour.multiply(new BigDecimal(assistdto.getHourRatio().replace("%","")))
.multiply(new BigDecimal("0.01"))
.toString());
}
}
}
@ -225,7 +237,7 @@ public class MesLineAssistantQtyServiceImpl implements IMesLineAssistantQtyServi
.toString()
);
}
//最后一行
MesLineAssistantQtyVo assistdto0 = new MesLineAssistantQtyVo();
//assistdto0.setProductDate(dtos.get(0).getProductDate());
//assistdto0.setFactoryCode(dtos.get(0).getFactoryCode());
@ -238,16 +250,16 @@ public class MesLineAssistantQtyServiceImpl implements IMesLineAssistantQtyServi
monitorHour.add(groupleadeHour).add(materialHour).add(pillMgrHour).add(pillDisHour).toString()
);
MesLineAssistantQty manQty = assistMaps.get(mesLineAssistant.getProductDateStr());
assistdto0.setMonitorQty(manQty.getMonitorQty().toString());
assistdto0.setMonitorHour(monitorHour.toString());
assistdto0.setGroupleaderQty(manQty.getGroupleaderQty().toString());
assistdto0.setGroupLeaderHour(groupleadeHour.toString());
assistdto0.setMaterialQty(manQty.getMaterialQty().toString());
assistdto0.setMaterialHour(materialHour.toString());
assistdto0.setPillMgrQty(manQty.getPillMgrQty().toString());
assistdto0.setPillMgrHour(pillMgrHour.toString());
assistdto0.setPillDisQty(manQty.getPillDisQty().toString());
assistdto0.setPillDisHour(pillDisHour.toString());
assistdto0.setMonitorQty(manQty.getMonitorQty()==null?"0":manQty.getMonitorQty().toString());
assistdto0.setMonitorHour(monitorHour==null?"0":monitorHour.toString());
assistdto0.setGroupleaderQty(manQty.getGroupleaderQty()==null?"0":manQty.getGroupleaderQty().toString());
assistdto0.setGroupLeaderHour(groupleadeHour==null?"0":groupleadeHour.toString());
assistdto0.setMaterialQty(manQty.getMaterialQty()==null?"0":manQty.getMaterialQty().toString());
assistdto0.setMaterialHour(materialHour==null?"0":materialHour.toString());
assistdto0.setPillMgrQty(manQty.getPillMgrQty()==null?"0":manQty.getPillMgrQty().toString());
assistdto0.setPillMgrHour(pillMgrHour==null?"0":pillMgrHour.toString());
assistdto0.setPillDisQty(manQty.getPillDisQty()==null?"0":manQty.getPillDisQty().toString());
assistdto0.setPillDisHour(pillDisHour==null?"0":pillDisHour.toString());
dtos.add(assistdto0);
if(StringUtils.isNotBlank(mesLineAssistant.getLineCode())){
dtos = dtos.stream().filter(dto ->(dto.getLineCode().equals(mesLineAssistant.getLineCode())))

@ -0,0 +1,98 @@
<?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.MesCxjProductedMapper">
<resultMap type="MesCxjProducted" id="MesCxjProductedResult">
<result property="workorderCode" column="workorder_code" />
<result property="workorderName" column="workorder_name" />
<result property="productCode" column="product_code" />
<result property="productName" column="product_name" />
<result property="createTime" column="create_time" />
<result property="shiftId" column="shift_id" />
<result property="attr1" column="attr1" />
<result property="attr2" column="attr2" />
<result property="attr3" column="attr3" />
</resultMap>
<!-- <sql id="selectMesCxjProductedVo">-->
<!-- select workorder_code, workorder_name, create_time, attr1, attr2, attr3 from mes_cxj_producted-->
<!-- </sql>-->
<sql id="selectMesCxjProductedVo">
SELECT
pro_order_workorder.workorder_code,
pro_order_workorder.product_code,
pro_order_workorder.product_name,
mes_cxj_producted.workorder_name,
mes_cxj_producted.create_time,
pro_order_workorder.shift_id
FROM
mes_cxj_producted LEFT JOIN
pro_order_workorder on mes_cxj_producted.workorder_code = pro_order_workorder.workorder_id
</sql>
<select id="selectMesCxjProductedList" parameterType="MesCxjProducted" resultMap="MesCxjProductedResult">
<include refid="selectMesCxjProductedVo"/>
<where>
<if test="workorderCode != null and workorderCode != ''"> and workorder_code = #{workorderCode}</if>
<if test="workorderName != null and workorderName != ''"> and mes_cxj_producted.workorder_name like concat('%', #{workorderName}, '%')</if>
<if test="beginTime != null">
AND mes_cxj_producted.create_time >= #{beginTime}
</if>
<if test="endTime != null">
AND mes_cxj_producted.create_time &lt;= #{endTime}
</if>
</where>
ORDER BY mes_cxj_producted.create_time DESC
</select>
<select id="selectMesCxjProductedByWorkorderCode" parameterType="String" resultMap="MesCxjProductedResult">
<include refid="selectMesCxjProductedVo"/>
where workorder_code = #{workorderCode}
</select>
<insert id="insertMesCxjProducted" parameterType="MesCxjProducted">
insert into mes_cxj_producted
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="workorderCode != null">workorder_code,</if>
<if test="workorderName != null">workorder_name,</if>
<if test="createTime != null">create_time,</if>
<if test="attr1 != null">attr1,</if>
<if test="attr2 != null">attr2,</if>
<if test="attr3 != null">attr3,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="workorderCode != null">#{workorderCode},</if>
<if test="workorderName != null">#{workorderName},</if>
<if test="createTime != null">#{createTime},</if>
<if test="attr1 != null">#{attr1},</if>
<if test="attr2 != null">#{attr2},</if>
<if test="attr3 != null">#{attr3},</if>
</trim>
</insert>
<update id="updateMesCxjProducted" parameterType="MesCxjProducted">
update mes_cxj_producted
<trim prefix="SET" suffixOverrides=",">
<if test="workorderName != null">workorder_name = #{workorderName},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="attr1 != null">attr1 = #{attr1},</if>
<if test="attr2 != null">attr2 = #{attr2},</if>
<if test="attr3 != null">attr3 = #{attr3},</if>
</trim>
where workorder_code = #{workorderCode}
</update>
<delete id="deleteMesCxjProductedByWorkorderCode" parameterType="String">
delete from mes_cxj_producted where workorder_code = #{workorderCode}
</delete>
<delete id="deleteMesCxjProductedByWorkorderCodes" parameterType="String">
delete from mes_cxj_producted where workorder_code in
<foreach item="workorderCode" collection="array" open="(" separator="," close=")">
#{workorderCode}
</foreach>
</delete>
</mapper>

@ -5,6 +5,7 @@ import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.YearMonth;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
@ -864,4 +865,34 @@ public class QcStaticTableController extends BaseController {
}
}
}
@Log(title = "白坯不良率报表--表头", businessType = BusinessType.QUERY)
@GetMapping("/getMonthOfDateTitle")
public List<String> getMonthOfDateTitle(QcStaticTable qcStaticTable) {
return qcStaticTableService.getDaysOfMonth(qcStaticTable);
}
@Log(title = "白坯不良率报表--数表", businessType = BusinessType.QUERY)
@GetMapping("/getMonthOfData")
public List<Map<String, String>> getMonthOfData(QcStaticTable qcStaticTable) {
return qcStaticTableService.getMonthOfData(qcStaticTable);
}
@Log(title = "白坯不良率报表--图表", businessType = BusinessType.QUERY)
@GetMapping("/getMonthOfLine")
public List<QcStaticTable> getMonthOfLine(QcStaticTable qcStaticTable) {
return qcStaticTableService.getMonthOfLine(qcStaticTable);
}
@Log(title = "白坯返工率报表--数表", businessType = BusinessType.QUERY)
@GetMapping("/getMonthOfDataRework")
public List<Map<String, String>> getMonthOfDataRework(QcStaticTable qcStaticTable) {
return qcStaticTableService.getMonthOfDataRework(qcStaticTable);
}
@Log(title = "白坯返工率报表--图表", businessType = BusinessType.QUERY)
@GetMapping("/getMonthOfLineRework")
public List<QcStaticTable> getMonthOfLineRework(QcStaticTable qcStaticTable) {
return qcStaticTableService.getMonthOfLineRework(qcStaticTable);
}
@Log(title = "白坯缺陷排列报表--数表", businessType = BusinessType.QUERY)
@GetMapping("/getMonthOfDataDefect")
public List<Map<String, String>> getMonthOfDataDefect(QcStaticTable qcStaticTable) {
return qcStaticTableService.getMonthOfDataDefect(qcStaticTable);
}
}

@ -86,9 +86,26 @@ public class QcProCheck extends BaseEntity {
private String passRate;
private String chartType;
private String quality;
private String okQuality;
private String shiftId;
private String quality;
private int qualityNook;
public String getQuality() {
return quality;
}
public void setQuality(String quality) {
this.quality = quality;
}
public int getQualityNook() {
return qualityNook;
}
public void setQualityNook(int qualityNook) {
this.qualityNook = qualityNook;
}
public String getShiftId() {
return shiftId;
@ -106,14 +123,6 @@ public class QcProCheck extends BaseEntity {
this.okQuality = okQuality;
}
public String getQuality() {
return quality;
}
public void setQuality(String quality) {
this.quality = quality;
}
public String getChartType() {
return chartType;
}

@ -121,6 +121,24 @@ public class QcStaticTable extends BaseEntity {
private String lineCode;
private String lineName;
private String checkTypeName;
private String sampleQty;
private String noOkQty;
public String getSampleQty() {
return sampleQty;
}
public void setSampleQty(String sampleQty) {
this.sampleQty = sampleQty;
}
public String getNoOkQty() {
return noOkQty;
}
public void setNoOkQty(String noOkQty) {
this.noOkQty = noOkQty;
}
public String getCheckTypeName() {
return checkTypeName;

@ -119,4 +119,20 @@ public interface QcStaticTableMapper {
Map<String,QcStaticTable> getDLDataDay(QcCPKInfo qcCPKInfo);
List<CheckTypeXJDetail> getXJCheckTableDetailList(QcStaticTable qcStaticTable);
List<QcStaticTable> getBPpMaterials(QcStaticTable qcStaticTable);
@MapKey("ymdms")
Map<String, QcStaticTable> getBPNoOkMap(QcStaticTable qcStaticTable);
@MapKey("ymdms")
Map<String, QcStaticTable> getBPSumNoOkMap(QcStaticTable qcStaticTable);
@MapKey("ymdms")
Map<String, QcStaticTable> getBPReworkMap(QcStaticTable qcStaticTable);
@MapKey("ymdms")
Map<String, QcStaticTable> getBPSumReworkMap(QcStaticTable qcStaticTable);
List<String> getBpDefects(QcStaticTable qcStaticTable);
@MapKey("ymdms")
Map<String, QcStaticTable> getBPDefectMap(QcStaticTable qcStaticTable);
@MapKey("ymdms")
Map<String, QcStaticTable> getSampMap(QcStaticTable qcStaticTable);
}

@ -77,4 +77,13 @@ public interface IQcStaticTableService {
List<ProLineDTO> getProdLineList();
List<CheckTypeXJDetail> getXJCheckTableDetailList(QcStaticTable qcStaticTable);
List<String> getDaysOfMonth(QcStaticTable qcStaticTable);
List<Map<String, String>> getMonthOfData(QcStaticTable qcStaticTable);
List<QcStaticTable> getMonthOfLine(QcStaticTable qcStaticTable);
List<Map<String, String>> getMonthOfDataRework(QcStaticTable qcStaticTable);
List<QcStaticTable> getMonthOfLineRework(QcStaticTable qcStaticTable);
List<Map<String, String>> getMonthOfDataDefect(QcStaticTable qcStaticTable);
}

@ -138,7 +138,7 @@ public class QcCheckTaskDetailServiceImpl implements IQcCheckTaskDetailService {
return qcCheckTaskDetailMapper.deleteQcCheckTaskDetailByRecordId(recordId);
}
/**质量检验任务提醒,一小时后微信二次发送**/
/**质量检验任务提醒,2小时后微信再发送一次提醒未检验(成品检验除外)**/
@Override
public AjaxResult resendWXTask() {
@ -154,7 +154,7 @@ public class QcCheckTaskDetailServiceImpl implements IQcCheckTaskDetailService {
new LinkedBlockingQueue<Runnable>());
try {
dateSources.forEach(dateSource -> {
logger.info("++++++++++++" + dateSource.get("poolName") + "++++质量检验任务提醒,一小时后微信二次发送开始++++++++++");
logger.info("++++++++++++" + dateSource.get("poolName") + "++++质量检验任务二次提醒,2小时后微信二次发送开始++++++++++");
Runnable run = () -> resendWXFunc(dateSource.get("poolName"));
executorService.execute(run);
});
@ -173,8 +173,8 @@ public class QcCheckTaskDetailServiceImpl implements IQcCheckTaskDetailService {
//发企业微信--------------------开始
SysNoticeGroup noticeQo = new SysNoticeGroup();
//筛选成品检验 id 7
List<QcCheckReportIncome> noCheckListCP = noCheckList.stream().filter(condition -> condition.getCheckType().equals("checkTypeCP")).collect(Collectors.toList());
String CP = StringUtils.join(noCheckListCP.stream().map(QcCheckReportIncome::getCheckNo).collect(Collectors.toList()).toArray(),",");
// List<QcCheckReportIncome> noCheckListCP = noCheckList.stream().filter(condition -> condition.getCheckType().equals("checkTypeCP")).collect(Collectors.toList());
// String CP = StringUtils.join(noCheckListCP.stream().map(QcCheckReportIncome::getCheckNo).collect(Collectors.toList()).toArray(),",");
//批次成品检验 id 12
List<QcCheckReportIncome> noCheckListCPPC = noCheckList.stream().filter(condition -> condition.getCheckType().equals("checkTypeCPPC")).collect(Collectors.toList());
String CPPC = StringUtils.join(noCheckListCPPC.stream().map(QcCheckReportIncome::getCheckNo).collect(Collectors.toList()).toArray(),",");
@ -188,10 +188,10 @@ public class QcCheckTaskDetailServiceImpl implements IQcCheckTaskDetailService {
List<QcCheckReportIncome> noCheckListSC = noCheckList.stream().filter(condition -> condition.getCheckType().equals("checkTypeSC")).collect(Collectors.toList());
String SC = StringUtils.join(noCheckListSC.stream().map(QcCheckReportIncome::getCheckNo).collect(Collectors.toList()).toArray(),",");
if(noCheckListCP != null || noCheckListCP.size() > 0) {
noticeQo.setNoticeId(7L);
sendWeChartMessage(noticeQo,CP,noCheckListCP.size()+"个成品检验",noCheckListCP);
}
// if(noCheckListCP != null || noCheckListCP.size() > 0) {
// noticeQo.setNoticeId(7L);
// sendWeChartMessage(noticeQo,CP,noCheckListCP.size()+"个成品检验",noCheckListCP);
// }
if(noCheckListCPPC != null || noCheckListCPPC.size() > 0){
noticeQo.setNoticeId(12L);
sendWeChartMessage(noticeQo,CPPC,noCheckListCPPC.size()+"个批次成品检验",noCheckListCPPC);

@ -1,6 +1,7 @@
package com.op.quality.service.impl;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.RoundingMode;
import java.text.DateFormat;
import java.text.ParseException;
@ -1393,6 +1394,268 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService {
return qcStaticTableMapper.getXJCheckTableDetailList(qcStaticTable);
}
@Override
public List<String> getDaysOfMonth(QcStaticTable qcStaticTable) {
return getDaysOfMonth(Integer.parseInt(qcStaticTable.getYearMonth().split("-")[0]),
Integer.parseInt(qcStaticTable.getYearMonth().split("-")[1])
);
}
@Override
@DS("#header.poolName")
public List<Map<String, String>> getMonthOfData(QcStaticTable qcStaticTable) {
List<Map<String, String>> dtos = new ArrayList<>();
//获取白坯种类
List<QcStaticTable> bpMaterials = qcStaticTableMapper.getBPpMaterials(qcStaticTable);
Map<String,QcStaticTable> sampMaps = qcStaticTableMapper.getBPNoOkMap(qcStaticTable);
List<String> days = getDaysOfMonth(Integer.parseInt(qcStaticTable.getYearMonth().split("-")[0]),
Integer.parseInt(qcStaticTable.getYearMonth().split("-")[1]));
//List<String> itemNames = new ArrayList<String>(Arrays.asList("抽检数","不良品数","不良率%"));
Map<String,String> dto1,dto2,dto3 = null;
for(QcStaticTable bpMaterial:bpMaterials){
dto1 = new HashMap<>();
dto1.put("materialName",bpMaterial.getMaterialName());
dto1.put("dataType","抽检数");
for(int m=0;m<days.size();m++){
QcStaticTable sampMap = sampMaps.get(bpMaterial.getMaterialCode()+days.get(m));
if(sampMap!=null){
dto1.put("monthNum"+m,sampMap.getSampleQty().replace(".00",""));
}
}
dtos.add(dto1);
dto2 = new HashMap<>();
dto2.put("materialName",bpMaterial.getMaterialName());
dto2.put("dataType","不良品数");
for(int m=0;m<days.size();m++){
QcStaticTable sampMap = sampMaps.get(bpMaterial.getMaterialCode()+days.get(m));
if(sampMap!=null){
dto2.put("monthNum"+m,sampMap.getNoOkQty().replace(".00",""));
}
}
dtos.add(dto2);
dto3 = new HashMap<>();
dto3.put("materialName",bpMaterial.getMaterialName());
dto3.put("dataType","不良率%");
for(int m=0;m<days.size();m++){
QcStaticTable sampMap = sampMaps.get(bpMaterial.getMaterialCode()+days.get(m));
if(sampMap!=null){
BigDecimal nookqty = new BigDecimal(StringUtils.isEmpty(sampMap.getNoOkQty())?"0":sampMap.getNoOkQty());
BigDecimal sampleqty = new BigDecimal(sampMap.getSampleQty());
if(StringUtils.isEmpty(sampMap.getSampleQty())||sampleqty.compareTo(BigDecimal.ZERO)==0){
dto3.put("monthNum"+m,"0.00%");
}else{
BigDecimal nookrate = nookqty.multiply(new BigDecimal("100"))
.divide(sampleqty,2,BigDecimal.ROUND_HALF_UP);
dto3.put("monthNum"+m,nookrate+"%");
}
}
}
dtos.add(dto3);
}
return dtos;
}
@Override
@DS("#header.poolName")
public List<QcStaticTable> getMonthOfLine(QcStaticTable qcStaticTable) {
List<QcStaticTable> dtos = new ArrayList<>();
Map<String,QcStaticTable> sampMaps = qcStaticTableMapper.getBPSumNoOkMap(qcStaticTable);
List<String> days = getDaysOfMonth(Integer.parseInt(qcStaticTable.getYearMonth().split("-")[0]),
Integer.parseInt(qcStaticTable.getYearMonth().split("-")[1]));
QcStaticTable dto = null;
for(int m=0;m<days.size();m++){
dto = new QcStaticTable();
dto.setYmdms(days.get(m));
QcStaticTable sampMap = sampMaps.get(days.get(m));
if(sampMap!=null){
BigDecimal nookqty = new BigDecimal(StringUtils.isEmpty(sampMap.getNoOkQty())?"0":sampMap.getNoOkQty());
BigDecimal sampleqty = new BigDecimal(sampMap.getSampleQty());
if(StringUtils.isEmpty(sampMap.getSampleQty())||sampleqty.compareTo(BigDecimal.ZERO)==0){
dto.setNoOkBatchRate("0.00");
}else{
BigDecimal nookrate = nookqty.multiply(new BigDecimal("100"))
.divide(sampleqty,2,BigDecimal.ROUND_HALF_UP);
dto.setNoOkBatchRate(nookrate+"");
}
dtos.add(dto);
}
}
return dtos;
}
@Override
@DS("#header.poolName")
public List<Map<String, String>> getMonthOfDataRework(QcStaticTable qcStaticTable) {
List<Map<String, String>> dtos = new ArrayList<>();
//获取白坯种类
List<QcStaticTable> bpMaterials = qcStaticTableMapper.getBPpMaterials(qcStaticTable);
Map<String,QcStaticTable> sampMaps = qcStaticTableMapper.getBPReworkMap(qcStaticTable);
List<String> days = getDaysOfMonth(Integer.parseInt(qcStaticTable.getYearMonth().split("-")[0]),
Integer.parseInt(qcStaticTable.getYearMonth().split("-")[1]));
//List<String> itemNames = new ArrayList<String>(Arrays.asList("抽检数","不良品数","不良率%"));
Map<String,String> dto1,dto2,dto3 = null;
for(QcStaticTable bpMaterial:bpMaterials){
dto1 = new HashMap<>();
dto1.put("materialName",bpMaterial.getMaterialName());
dto1.put("dataType","抽检次数");
for(int m=0;m<days.size();m++){
QcStaticTable sampMap = sampMaps.get(bpMaterial.getMaterialCode()+days.get(m));
if(sampMap!=null){
dto1.put("monthNum"+m,sampMap.getSampleQty().replace(".00",""));
}
}
dtos.add(dto1);
dto2 = new HashMap<>();
dto2.put("materialName",bpMaterial.getMaterialName());
dto2.put("dataType","返工次数");
for(int m=0;m<days.size();m++){
QcStaticTable sampMap = sampMaps.get(bpMaterial.getMaterialCode()+days.get(m));
if(sampMap!=null){
dto2.put("monthNum"+m,sampMap.getNoOkQty().replace(".00",""));
}
}
dtos.add(dto2);
dto3 = new HashMap<>();
dto3.put("materialName",bpMaterial.getMaterialName());
dto3.put("dataType","返工率%");
for(int m=0;m<days.size();m++){
QcStaticTable sampMap = sampMaps.get(bpMaterial.getMaterialCode()+days.get(m));
if(sampMap!=null){
BigDecimal nookqty = new BigDecimal(StringUtils.isEmpty(sampMap.getNoOkQty())?"0":sampMap.getNoOkQty());
BigDecimal sampleqty = new BigDecimal(sampMap.getSampleQty());
if(StringUtils.isEmpty(sampMap.getSampleQty())||sampleqty.compareTo(BigDecimal.ZERO)==0){
dto3.put("monthNum"+m,"0.00%");
}else{
BigDecimal nookrate = nookqty.multiply(new BigDecimal("100"))
.divide(sampleqty,2,BigDecimal.ROUND_HALF_UP);
dto3.put("monthNum"+m,nookrate+"%");
}
}
}
dtos.add(dto3);
}
return dtos;
}
@Override
@DS("#header.poolName")
public List<QcStaticTable> getMonthOfLineRework(QcStaticTable qcStaticTable) {
List<QcStaticTable> dtos = new ArrayList<>();
Map<String,QcStaticTable> sampMaps = qcStaticTableMapper.getBPSumReworkMap(qcStaticTable);
List<String> days = getDaysOfMonth(Integer.parseInt(qcStaticTable.getYearMonth().split("-")[0]),
Integer.parseInt(qcStaticTable.getYearMonth().split("-")[1]));
QcStaticTable dto = null;
for(int m=0;m<days.size();m++){
dto = new QcStaticTable();
dto.setYmdms(days.get(m));
QcStaticTable sampMap = sampMaps.get(days.get(m));
if(sampMap!=null){
BigDecimal nookqty = new BigDecimal(StringUtils.isEmpty(sampMap.getNoOkQty())?"0":sampMap.getNoOkQty());
BigDecimal sampleqty = new BigDecimal(sampMap.getSampleQty());
if(StringUtils.isEmpty(sampMap.getSampleQty())||sampleqty.compareTo(BigDecimal.ZERO)==0){
dto.setNoOkBatchRate("0.00");
}else{
BigDecimal nookrate = nookqty.multiply(new BigDecimal("100"))
.divide(sampleqty,2,BigDecimal.ROUND_HALF_UP);
dto.setNoOkBatchRate(nookrate+"");
}
dtos.add(dto);
}
}
return dtos;
}
@Override
@DS("#header.poolName")
public List<Map<String, String>> getMonthOfDataDefect(QcStaticTable qcStaticTable) {
List<Map<String, String>> dtos = new ArrayList<>();
//获取不良种类
List<String> bpDefects = qcStaticTableMapper.getBpDefects(qcStaticTable);
Map<String,QcStaticTable> defectMaps = qcStaticTableMapper.getBPDefectMap(qcStaticTable);
List<String> days = getDaysOfMonth(Integer.parseInt(qcStaticTable.getYearMonth().split("-")[0]),
Integer.parseInt(qcStaticTable.getYearMonth().split("-")[1]));
Map<String,String> dto1 = null;
for(String defectName:bpDefects){
dto1 = new HashMap<>();
dto1.put("dataType",defectName);
BigDecimal rowSum= BigDecimal.ZERO;
for(int m=0;m<days.size();m++){
QcStaticTable sampMap = defectMaps.get(defectName+days.get(m));
if(sampMap!=null){
dto1.put("monthNum"+m,sampMap.getNoOkQty().replace(".00",""));
rowSum = rowSum.add(new BigDecimal(sampMap.getNoOkQty()));
}
}
dto1.put("rowSum",rowSum.toString().replace(".00",""));
dtos.add(dto1);
}
//合计行
if(!CollectionUtils.isEmpty(dtos)){
Map<String,String> dto2 = this.getHJRow(dtos,days.size());
dtos.add(dto2);
}
//抽样数行
Map<String,QcStaticTable> sampMaps = qcStaticTableMapper.getSampMap(qcStaticTable);
Map<String,String> dto3 = this.getSampRow(days,sampMaps);
dtos.add(dto3);
return dtos;
}
protected Map<String,String> getHJRow(List<Map<String, String>> dtos,int days){
Map<String,String> dto2 = new HashMap<>();
dto2.put("dataType","合计");
for(int day=1;day<=days;day++){
int daym =day;
dto2.put("monthNum"+day,dtos.stream()
.map(map -> map.get("monthNum"+daym))
.filter(numStr -> numStr != null)
.mapToDouble(numStr -> {
try {
return Double.parseDouble(numStr);
} catch (NumberFormatException e) {
System.err.println("无法将 " + numStr + " 转换为数字,跳过该元素。");
return 0;
}
})
.sum()+"");
}
dto2.put("rowSum",dtos.stream()
.map(map -> map.get("rowSum"))
.filter(numStr -> numStr != null)
.mapToDouble(numStr -> {
try {
return Double.parseDouble(numStr);
} catch (NumberFormatException e) {
System.err.println("无法将 " + numStr + " 转换为数字,跳过该元素。");
return 0;
}
})
.sum()+"");
return dto2;
}
protected Map<String,String> getSampRow(List<String> days,Map<String,QcStaticTable> sampMaps){
Map<String,String> dto3 = new HashMap<>();
dto3.put("dataType","抽样数");
BigDecimal rowSum= BigDecimal.ZERO;
for(int m=0;m<days.size();m++){
QcStaticTable sampMap = sampMaps.get(days.get(m));
if(sampMap!=null){
dto3.put("monthNum"+m,sampMap.getSampleQty().replace(".00",""));
rowSum = rowSum.add(new BigDecimal(sampMap.getSampleQty()));
}
}
dto3.put("rowSum",rowSum.toString().replace(".00",""));
return dto3;
}
//获取指定范围内得月份输出格式yyyy-mm
private List<String> getMonthByMonth(String startM,String endM){
YearMonth start = YearMonth.of(Integer.parseInt(startM.split("-")[0]), Integer.parseInt(startM.split("-")[1]));
@ -1425,6 +1688,7 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService {
return dateList;
}
public static void main(String args[]){
String ymd = "1、0.4016";
System.out.println(ymd.substring(2));

@ -208,8 +208,9 @@
confirm_time as confirmTime
from qc_check_task
where del_flag = '0'
and check_status = '0'
and datediff( hour, create_time,CONVERT(varchar(10),GETDATE())) > 1
and check_status = '0' and check_type != 'checkTypeCC'
and datediff( hour, create_time,CONVERT(varchar(10),GETDATE())) >= 2
and create_time > DATEADD(DAY, -1, CAST(GETDATE() AS DATE))
and confirm_time is null
</select>

@ -131,6 +131,9 @@
<if test="isqua != null">isqua,</if>
<if test="fileId != null">file_id,</if>
<if test="quality != null">quality,</if>
<if test="qualityNook != null">quality_nook,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="rfid != null and rfid != ''">#{rfid},</if>
@ -160,6 +163,8 @@
<if test="updateTime != null">#{updateTime},</if>
<if test="isqua != null">#{isqua},</if>
<if test="fileId != null">#{fileId},</if>
<if test="quality != null">#{quality},</if>
<if test="qualityNook != null">#{qualityNook},</if>
</trim>
</insert>
<insert id="insertBaseFileBatch">

@ -1035,5 +1035,161 @@
<if test="incomeTimeEnd != null ">and #{incomeTimeEnd} > CONVERT(varchar(30),qct.income_time, 120)</if>
order by qct.order_no,qct.income_batch_no,pow.product_date desc
</select>
<select id="getBPpMaterials" resultType="com.op.quality.domain.QcStaticTable">
select distinct bp.product_code materialCode,
bp.product_desc_zh materialName
from base_product bp
left join qc_check_task qct on qct.check_type = 'checkTypeLL' and qct.material_code = bp.product_code
where bp.product_group_name ='白坯' and bp.del_flag = '0' and bp.product_desc_zh like '%白坯%' and qct.del_flag = '0'
<if test="materialName != null ">
and (
bp.product_code like concat('%',#{materialName},'%') or
bp.product_desc_zh like concat('%',#{materialName},'%')
)
</if>
and CONVERT(varchar(7),qct.create_time, 120) = #{yearMonth}
order by bp.product_code
</select>
<select id="getBPNoOkMap" resultType="com.op.quality.domain.QcStaticTable">
select sum(t.noOk_quality) noOkQty,
sum(t.sample_quality) sampleQty,
concat(t.material_code,t.ymd) ymdms
from(
select qct.noOk_quality,
qct.sample_quality,
qct.material_code,
CONVERT(varchar(10),qct.create_time, 120) ymd
from qc_check_task qct
left join base_product bp on qct.material_code = bp.product_code
where qct.del_flag = '0' and qct.check_type = 'checkTypeLL'
and CONVERT(varchar(7),qct.create_time, 120) = #{yearMonth}
and check_man_code is not null
<if test="materialName != null ">
and (
bp.product_code like concat('%',#{materialName},'%') or
bp.product_desc_zh like concat('%',#{materialName},'%')
)
</if>
and bp.product_group_name ='白坯' and bp.del_flag = '0' and bp.product_desc_zh like '%白坯%'
) t GROUP BY t.ymd,t.material_code
</select>
<select id="getBPSumNoOkMap" resultType="com.op.quality.domain.QcStaticTable">
select sum(t.noOk_quality) noOkQty,
sum(t.sample_quality) sampleQty,
t.ymd ymdms
from(
select qct.noOk_quality,
qct.sample_quality,
CONVERT(varchar(10),qct.create_time, 120) ymd
from qc_check_task qct
left join base_product bp on qct.material_code = bp.product_code
where qct.del_flag = '0' and qct.check_type = 'checkTypeLL'
and CONVERT(varchar(7),qct.create_time, 120) = #{yearMonth}
and check_man_code is not null
<if test="materialName != null ">
and (
bp.product_code like concat('%',#{materialName},'%') or
bp.product_desc_zh like concat('%',#{materialName},'%')
)
</if>
and bp.product_group_name ='白坯' and bp.del_flag = '0' and bp.product_desc_zh like '%白坯%'
) t GROUP BY t.ymd
</select>
<select id="getBPReworkMap" resultType="com.op.quality.domain.QcStaticTable">
select SUM(CASE WHEN t.check_result = 'N' THEN 1 ELSE 0 END) noOkQty,
count(0) sampleQty,
concat(t.material_code,t.ymd) ymdms
from(
select
qct.check_result,
qct.material_code,
CONVERT(varchar(10),qct.create_time, 120) ymd
from qc_check_task qct
left join base_product bp on qct.material_code = bp.product_code
where qct.del_flag = '0' and qct.check_type = 'checkTypeLL'
and CONVERT(varchar(7),qct.create_time, 120) = #{yearMonth}
and check_man_code is not null
<if test="materialName != null ">
and (
bp.product_code like concat('%',#{materialName},'%') or
bp.product_desc_zh like concat('%',#{materialName},'%')
)
</if>
and bp.product_group_name ='白坯' and bp.del_flag = '0' and bp.product_desc_zh like '%白坯%'
) t GROUP BY t.ymd,t.material_code
</select>
<select id="getBPSumReworkMap" resultType="com.op.quality.domain.QcStaticTable">
select SUM(CASE WHEN t.check_result = 'N' THEN 1 ELSE 0 END) noOkQty,
count(0) sampleQty,
t.ymd ymdms
from(
select
qct.check_result,
CONVERT(varchar(10),qct.create_time, 120) ymd
from qc_check_task qct
left join base_product bp on qct.material_code = bp.product_code
where qct.del_flag = '0' and qct.check_type = 'checkTypeLL'
and CONVERT(varchar(7),qct.create_time, 120) = #{yearMonth}
and check_man_code is not null
<if test="materialName != null ">
and (
bp.product_code like concat('%',#{materialName},'%') or
bp.product_desc_zh like concat('%',#{materialName},'%')
)
</if>
and bp.product_group_name ='白坯' and bp.del_flag = '0' and bp.product_desc_zh like '%白坯%'
) t GROUP BY t.ymd
</select>
<select id="getBpDefects" resultType="java.lang.String">
select qdtc.class_name dataType
from qc_defect_type_class qdtc
where qdtc.defect_id ='8504b23592d44055a0c66661d6318c2e'
and qdtc.remark = '白坯专用' and qdtc.del_flag = '0'
</select>
<select id="getBPDefectMap" resultType="com.op.quality.domain.QcStaticTable">
select count(0) noOkQty,
concat(t.class_name,t.ymd) ymdms
from(
select
qdtc.class_name,
CONVERT(varchar(10),qct.create_time, 120) ymd
from qc_check_task qct
left join qc_defect_type_class qdtc on qct.remark_code = qdtc.id
left join base_product bp on qct.material_code = bp.product_code
where qct.del_flag = '0' and qct.check_type = 'checkTypeLL'
and CONVERT(varchar(7),qct.create_time, 120) = #{yearMonth}
and check_man_code is not null
and qdtc.class_name is not null
and bp.product_group_name ='白坯' and bp.del_flag = '0' and bp.product_desc_zh like '%白坯%'
<if test="materialName != null ">
and (
bp.product_code like concat('%',#{materialName},'%') or
bp.product_desc_zh like concat('%',#{materialName},'%')
)
</if>
) t GROUP BY t.ymd,t.class_name
</select>
<select id="getSampMap" resultType="com.op.quality.domain.QcStaticTable">
select count(0) sampleQty,
t.ymd ymdms
from(
select
CONVERT(varchar(10),qct.create_time, 120) ymd
from qc_check_task qct
left join base_product bp on qct.material_code = bp.product_code
where qct.del_flag = '0' and qct.check_type = 'checkTypeLL'
and CONVERT(varchar(7),qct.create_time, 120) = #{yearMonth}
and check_man_code is not null
and bp.product_group_name ='白坯' and bp.del_flag = '0' and bp.product_desc_zh like '%白坯%'
<if test="materialName != null ">
and (
bp.product_code like concat('%',#{materialName},'%') or
bp.product_desc_zh like concat('%',#{materialName},'%')
)
</if>
) t GROUP BY t.ymd
</select>
</mapper>

@ -190,6 +190,8 @@ public class SapWmsServicelmpl implements SapWmsService {
L_ITEM.appendRow();
L_ITEM.setValue("COSTCENTER", stringObjectMap.get("COSTCENTER"));//成本中心
L_ITEM.setValue("PLANT", stringObjectMap.get("PLANT"));//工厂
L_ITEM.setValue("GL_ACCOUNT", stringObjectMap.get("GL_ACCOUNT"));//总帐科目编号
L_ITEM.setValue("GR_RCPT", stringObjectMap.get("GR_RCPT"));//收货方/运达方
L_ITEM.setValue("LGORT", stringObjectMap.get("LGORT"));//库存地点
L_ITEM.setValue("MATNR", stringObjectMap.get("MATNR"));//物料号
L_ITEM.setValue("QUANTITY", stringObjectMap.get("QUANTITY"));//数量
@ -239,11 +241,11 @@ public class SapWmsServicelmpl implements SapWmsService {
try {
JCoRepository repository = dest.getRepository();
JCoFunction func = repository.getFunction("ZMES_961_MB1A");
JCoFunction func = repository.getFunction("ZMES_962_MB1A");
if (func == null) {
throw new RuntimeException("Function does not exist in SAP");
}
log.info("成品ZMES_201_MB1A-------" + mapList.toString());
log.info("ZMES_962_MB1A-------" + mapList.toString());
/**
AUFNR
POSNR
@ -269,7 +271,9 @@ public class SapWmsServicelmpl implements SapWmsService {
JCoTable L_ITEM = func.getTableParameterList().getTable("L_ITEM");
for (Map<String, Object> stringObjectMap : mapList) {
L_ITEM.appendRow();
L_ITEM.setValue("COSTCENTER", stringObjectMap.get("COSTCENTER"));//成本中心
L_ITEM.setValue("AUFNR", stringObjectMap.get("AUFNR"));//订单号
L_ITEM.setValue("GL_ACCOUNT", stringObjectMap.get("GL_ACCOUNT"));//总帐科目编号
L_ITEM.setValue("GR_RCPT", stringObjectMap.get("GR_RCPT"));//收货方/运达方
L_ITEM.setValue("PLANT", stringObjectMap.get("PLANT"));//工厂
L_ITEM.setValue("LGORT", stringObjectMap.get("LGORT"));//库存地点
L_ITEM.setValue("MATNR", stringObjectMap.get("MATNR"));//物料号

@ -131,8 +131,8 @@ public class WmsRawOrderInController extends BaseController {
*
*/
@PostMapping("/listZJ")
public TableDataInfo listInspectionReport(@RequestBody WmsRawOrderIn wmsRawOrderIn) {
@GetMapping("/listZJ")
public TableDataInfo listInspectionReport(WmsRawOrderIn wmsRawOrderIn) {
startPage();
List<WmsRawOrderIn> list = wmsRawOrderInService.listInspectionReport(wmsRawOrderIn);
return getDataTable(list);

@ -1568,111 +1568,138 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService {
@Override
public void OutboundPostingzcSAPTS(List<OdsProcureOutOrder> orderList) {
//先根据出库单获取
// * 退料的移动类型为 262
// * 领料的移动类型为 261
List<OdsProcureOutOrder> orderList1 = odsProcureOutOrderMapper.selectWmsOdsProcureOutOrderByIDsTS(orderList);
List<OdsProcureOutOrder> orderList2 = new ArrayList<>();//非反冲
List<Map<String, Object>> mapList = new ArrayList<>();//非反冲
List<SapBackflushMPQuery> sapMaterialPostingFCList = new ArrayList<>();//反冲
List<OdsProcureOutOrder> orderList2FC = new ArrayList<>();//反冲
for (OdsProcureOutOrder odsProcureOutOrder :
orderList1) {
if (!"X".equals(odsProcureOutOrder.getUserDefined3())){
Map<String, Object> map = new HashMap<>();
map.put("AUFNR", odsProcureOutOrder.getProduceCode());
map.put("PLANT", odsProcureOutOrder.getSiteCode());
String lgort = baseWarehouseMapper.selectByCode(odsProcureOutOrder.getLocCode());
map.put("LGORT", lgort);
map.put("MATNR", odsProcureOutOrder.getMaterialCode());
map.put("QUANTITY", odsProcureOutOrder.getOutNumber().toString());
map.put("MEINS", odsProcureOutOrder.getUnit());
mapList.add(map);
orderList2.add(odsProcureOutOrder);
}else {
SapBackflushMPQuery sapBackflushMPQuery = new SapBackflushMPQuery();
sapBackflushMPQuery.setPlant(odsProcureOutOrder.getSiteCode()); //工厂
String lgort = baseWarehouseMapper.selectByCode(odsProcureOutOrder.getLocCode());
sapBackflushMPQuery.setLgort(lgort);//库存地点
sapBackflushMPQuery.setMatnr(odsProcureOutOrder.getMaterialCode());//物料号
sapBackflushMPQuery.setQuantity(odsProcureOutOrder.getOutNumber().toString()); //数量
sapBackflushMPQuery.setMeins(odsProcureOutOrder.getUnit()); //基本计量单位
sapBackflushMPQuery.setBatch(odsProcureOutOrder.getUserDefined2()); //批号
sapMaterialPostingFCList.add(sapBackflushMPQuery);
orderList2FC.add(odsProcureOutOrder);
}
}
if (mapList.size() > 0) {
//非反冲过账
SapMaterialPosting sapMaterialPosting = new SapMaterialPosting();
sapMaterialPosting.setPostingType("261");
sapMaterialPosting.setMapList(mapList);
R result = remoteSapService.sapMaterialPosting(sapMaterialPosting);
OdsProcureOutOrder order = new OdsProcureOutOrder();
int code = result.getCode();
String msg = result.getMsg();
//order.setSapMaterialPostingList(sapMaterialPostingList);
order.setUserDefined11(msg);
if (code == 200) {
//过账成功
Map map = new HashMap();
map = (Map) result.getData();
String userDefined9 = (String) map.get("MATERIALDOCUMENT");
order.setUserDefined9(userDefined9);
order.setUserDefined10("2");//成功
odsProcureOutOrderMapper.updateWMSOdsProcureOutOrderByids(order, orderList2);
for (OdsProcureOutOrder order1:
orderList2) {
//过账成功--减库存
List<WmsOdsMateStorageNews> odsEmStorageNews= odsProcureOutOrderMapper.selectWmsRawMissionOutByPrdAndMa(order1);
for (WmsOdsMateStorageNews wmsOdsMateStorageNews:
odsEmStorageNews) {
//wmsOdsMateStorageNews
wmsOdsMateStorageNews.setLastModifiedBy(SecurityUtils.getUsername());
wmsOdsMateStorageNewsSnMapper.updatesub(wmsOdsMateStorageNews);//库存调整
}
}
} else {
//
order.setUserDefined9("");
order.setUserDefined10("3");//失败
odsProcureOutOrderMapper.updateWMSOdsProcureOutOrderByids(order, orderList2);
}
}
if (sapMaterialPostingFCList.size() > 0) {
//反冲过账
R result2 = remoteSapService.sapBackflushMP(sapMaterialPostingFCList);//x
int code = result2.getCode();
OdsProcureOutOrder order = new OdsProcureOutOrder();
String msg = result2.getMsg();
order.setUserDefined11(msg);
if (code == 200) {
//过账成功
Map map = new HashMap();
map = (Map) result2.getData();
String userDefined9 = (String) map.get("MATERIALDOCUMENT");
order.setUserDefined9(userDefined9);
order.setUserDefined10("2");//成功
odsProcureOutOrderMapper.updateWMSOdsProcureOutOrderByids(order, orderList2FC);
for (OdsProcureOutOrder order1:
orderList2FC) {
//过账成功--减库存
List<WmsOdsMateStorageNews> odsEmStorageNews= odsProcureOutOrderMapper.selectWmsRawMissionOutByPrdAndMa(order1);
for (WmsOdsMateStorageNews wmsOdsMateStorageNews:
odsEmStorageNews) {
//wmsOdsMateStorageNews
wmsOdsMateStorageNews.setLastModifiedBy(SecurityUtils.getUsername());
wmsOdsMateStorageNewsSnMapper.updatesub(wmsOdsMateStorageNews);//库存调整
}
}
} else {//
order.setUserDefined9("");
order.setUserDefined10("3");//失败
odsProcureOutOrderMapper.updateWMSOdsProcureOutOrderByids(order, orderList2FC);
}
}
OutboundPostingzcSAPGYTS(orderList1);
}
public void OutboundPostingzcSAPGYTS(List<OdsProcureOutOrder> orderList) {
//先根据出库单获取
// -- and wms_ods_procure_out_order.Order_Status='3'
//我把过账状态-- and wms_ods_procure_out_order.User_Defined10!='2'去掉了
List<OdsProcureOutOrder> orderList1 = odsProcureOutOrderMapper.selectWmsOdsProcureOutOrderSpecialByIDs(orderList);
for (OdsProcureOutOrder order:
orderList1 ) {
if ("成本中心".equals(orderList1.get(0).getUserDefined6())){
//区分出来内部订单
Map paramMap=new HashMap<>();
List<Map> mapList = new ArrayList<>();
paramMap.put("GL_ACCOUNT", order.getUserDefined2());//总帐科目编号
paramMap.put("COSTCENTER", order.getUserDefined3());//成本中心
paramMap.put("GR_RCPT", order.getUserDefined4());//收货方/运达方
paramMap.put("PLANT", order.getSiteCode());//工厂
paramMap.put("LGORT", order.getLocCode());//库存地点
paramMap.put("MATNR", order.getMaterialCode());//物料号
paramMap.put("QUANTITY", order.getPlanNumber());//数量
paramMap.put("MEINS", order.getUnit());//条目单位
paramMap.put("BATCH", order.getUserDefined1());//批号
paramMap.put("PROD_DATE", order.getPlanDate());//生产日期
paramMap.put("EXPIRYDATE", order.getUserDefined5());//货架寿命到期日
mapList.add(paramMap);
R result2 = remoteSapService.sapProductOutboundCostCenter(mapList);
int code = result2.getCode();
OdsProcureOutOrder order1 = new OdsProcureOutOrder();
String msg = result2.getMsg();
order.setUserDefined11(msg);
if (code== 200){
//过账成功
Map map = new HashMap();
map = (Map) result2.getData();
String userDefined9 = (String) map.get("MATERIALDOCUMENT");
//order.setUserDefined9(userDefined9);
// order.setUserDefined10("2");//成功
// for (OdsProcureOutOrder order2:
// orderList2 ) {
order1.setID(order.getID());
order1.setSapNumber(order.getOutNumber());//成功..这个是否的outNumber是用已出库减去已经过账的数量
order1.setUserDefined10("2");//1是未过账2是成功3是失败
order1.setUserDefined9(userDefined9);//凭证
order1.setUserDefined11(msg);//信息
odsProcureOutOrderMapper.updateWMSOdsProcureOutOrdersapSpecialById(order1);
// }
order1.setProduceCode(order.getProduceCode());
order1.setMaterialCode(order.getMaterialCode());
List<WmsOdsMateStorageNews> odsEmStorageNews= odsProcureOutOrderMapper.selectWmsRawMissionOutByPrdAndMa(order1);
for (WmsOdsMateStorageNews wmsOdsMateStorageNews:
odsEmStorageNews) {
//wmsOdsMateStorageNews
wmsOdsMateStorageNews.setLastModifiedBy(SecurityUtils.getUsername());
wmsOdsMateStorageNewsSnMapper.updatesub(wmsOdsMateStorageNews);//库存调整
}
}else {
order1.setID(order.getID());
// order1.setSapNumber(order.getOutNumber());//成功..这个是否的outNumber是用已出库减去已经过账的数量
order1.setUserDefined10("3");//1是未过账2是成功3是失败
// order1.setUserDefined9(userDefined9);//凭证
order1.setUserDefined11(msg);//信息
odsProcureOutOrderMapper.updateWMSOdsProcureOutOrdersapSpecialTWById(order1);
}
}else {
//内部订单
Map paramMap=new HashMap<>();
List<Map> mapList = new ArrayList<>();
paramMap.put("AUFNR", order.getProduceCode());//
paramMap.put("GL_ACCOUNT", order.getUserDefined2());//
paramMap.put("GR_RCPT", order.getUserDefined4());//收货方/运达方
paramMap.put("PLANT", order.getSiteCode());//工厂
paramMap.put("LGORT", order.getLocCode());//库存地点
paramMap.put("MATNR", order.getMaterialCode());//
paramMap.put("QUANTITY", order.getPlanNumber());//
paramMap.put("MEINS", order.getUnit());//
paramMap.put("BATCH", order.getUserDefined1());//
paramMap.put("PROD_DATE", order.getPlanDate());//生产日期
paramMap.put("EXPIRYDATE", order.getUserDefined5());//货架寿命到期日
mapList.add(paramMap);
// R result2 = remoteSapService.sapProductOutboundCostTWO(mapList);
R result2 = remoteSapService.sapProductOutboundCostTW(mapList);
int code = result2.getCode();
OdsProcureOutOrder order1 = new OdsProcureOutOrder();
String msg = result2.getMsg();
order.setUserDefined11(msg);
if (code== 200){
//过账成功
Map map = new HashMap();
map = (Map) result2.getData();
String userDefined9 = (String) map.get("MATERIALDOCUMENT");
//order.setUserDefined9(userDefined9);
// order.setUserDefined10("2");//成功
// for (OdsProcureOutOrder order2:
// orderList2 ) {
order1.setID(order.getID());
order1.setSapNumber(order.getOutNumber());//成功..这个是否的outNumber是用已出库减去已经过账的数量
order1.setUserDefined10("2");//1是未过账2是成功3是失败
order1.setUserDefined9(userDefined9);//凭证
order1.setUserDefined11(msg);//信息
odsProcureOutOrderMapper.updateWMSOdsProcureOutOrdersapSpecialById(order1);
// }
order1.setProduceCode(order.getProduceCode());
order1.setMaterialCode(order.getMaterialCode());
List<WmsOdsMateStorageNews> odsEmStorageNews= odsProcureOutOrderMapper.selectWmsRawMissionOutByPrdAndMa(order1);
for (WmsOdsMateStorageNews wmsOdsMateStorageNews:
odsEmStorageNews) {
//wmsOdsMateStorageNews
wmsOdsMateStorageNews.setLastModifiedBy(SecurityUtils.getUsername());
wmsOdsMateStorageNewsSnMapper.updatesub(wmsOdsMateStorageNews);//库存调整
}
}else {
order1.setID(order.getID());
// order1.setSapNumber(order.getOutNumber());//成功..这个是否的outNumber是用已出库减去已经过账的数量
order1.setUserDefined10("3");//1是未过账2是成功3是失败
// order1.setUserDefined9(userDefined9);//凭证
order1.setUserDefined11(msg);//信息
odsProcureOutOrderMapper.updateWMSOdsProcureOutOrdersapSpecialTWById(order1);
}
}
}
}
@Override
@DS("#header.poolName")
public void OutboundPostingzcSAPTH(List<OdsProcureOutOrder> orderList) {

@ -489,7 +489,8 @@ public class OdsProcureOutOrderServiceImpl implements IOdsProcureOutOrderService
List<OdsProcureOutOrder> orderList1 = odsProcureOutOrderMapper.selectWmsOdsProcureOutOrderSpecialByIDs(orderList);
for (OdsProcureOutOrder order:
orderList1 ) {
if ("成本中心".equals(orderList1.get(0).getUserDefined6())){//区分出来内部订单
if ("成本中心".equals(orderList1.get(0).getUserDefined6())){
//区分出来内部订单
Map paramMap=new HashMap<>();
List<Map> mapList = new ArrayList<>();
paramMap.put("GL_ACCOUNT", order.getUserDefined2());//总帐科目编号
@ -526,6 +527,15 @@ public class OdsProcureOutOrderServiceImpl implements IOdsProcureOutOrderService
order1.setUserDefined11(msg);//信息
odsProcureOutOrderMapper.updateWMSOdsProcureOutOrdersapSpecialById(order1);
// }
order1.setProduceCode(order.getProduceCode());
order1.setMaterialCode(order.getMaterialCode());
List<WmsOdsMateStorageNews> odsEmStorageNews= odsProcureOutOrderMapper.selectWmsRawMissionOutByPrdAndMa(order1);
for (WmsOdsMateStorageNews wmsOdsMateStorageNews:
odsEmStorageNews) {
//wmsOdsMateStorageNews
wmsOdsMateStorageNews.setLastModifiedBy(SecurityUtils.getUsername());
wmsOdsMateStorageNewsSnMapper.updatesub(wmsOdsMateStorageNews);//库存调整
}
}else {
order1.setID(order.getID());
// order1.setSapNumber(order.getOutNumber());//成功..这个是否的outNumber是用已出库减去已经过账的数量
@ -534,12 +544,15 @@ public class OdsProcureOutOrderServiceImpl implements IOdsProcureOutOrderService
order1.setUserDefined11(msg);//信息
odsProcureOutOrderMapper.updateWMSOdsProcureOutOrdersapSpecialTWById(order1);
}
//这个地方需要对
}else {
//内部订单
Map paramMap=new HashMap<>();
List<Map> mapList = new ArrayList<>();
paramMap.put("COSTCENTER", order.getUserDefined3());//
paramMap.put("AUFNR", order.getProduceCode());//
paramMap.put("GL_ACCOUNT", order.getUserDefined2());//
paramMap.put("GR_RCPT", order.getUserDefined4());//收货方/运达方
paramMap.put("PLANT", order.getSiteCode());//工厂
paramMap.put("LGORT", order.getLocCode());//库存地点
paramMap.put("MATNR", order.getMaterialCode());//
@ -551,121 +564,48 @@ public class OdsProcureOutOrderServiceImpl implements IOdsProcureOutOrderService
mapList.add(paramMap);
// R result2 = remoteSapService.sapProductOutboundCostTWO(mapList);
R result2 = remoteSapService.sapProductOutboundCostTW(mapList);
int code = result2.getCode();
OdsProcureOutOrder order1 = new OdsProcureOutOrder();
String msg = result2.getMsg();
order.setUserDefined11(msg);
if (code== 200){
//过账成功
Map map = new HashMap();
map = (Map) result2.getData();
String userDefined9 = (String) map.get("MATERIALDOCUMENT");
//order.setUserDefined9(userDefined9);
// order.setUserDefined10("2");//成功
// for (OdsProcureOutOrder order2:
// orderList2 ) {
order1.setID(order.getID());
order1.setSapNumber(order.getOutNumber());//成功..这个是否的outNumber是用已出库减去已经过账的数量
order1.setUserDefined10("2");//1是未过账2是成功3是失败
order1.setUserDefined9(userDefined9);//凭证
order1.setUserDefined11(msg);//信息
odsProcureOutOrderMapper.updateWMSOdsProcureOutOrdersapSpecialById(order1);
// }
order1.setProduceCode(order.getProduceCode());
order1.setMaterialCode(order.getMaterialCode());
List<WmsOdsMateStorageNews> odsEmStorageNews= odsProcureOutOrderMapper.selectWmsRawMissionOutByPrdAndMa(order1);
for (WmsOdsMateStorageNews wmsOdsMateStorageNews:
odsEmStorageNews) {
//wmsOdsMateStorageNews
wmsOdsMateStorageNews.setLastModifiedBy(SecurityUtils.getUsername());
wmsOdsMateStorageNewsSnMapper.updatesub(wmsOdsMateStorageNews);//库存调整
}
}else {
order1.setID(order.getID());
// order1.setSapNumber(order.getOutNumber());//成功..这个是否的outNumber是用已出库减去已经过账的数量
order1.setUserDefined10("3");//1是未过账2是成功3是失败
// order1.setUserDefined9(userDefined9);//凭证
order1.setUserDefined11(msg);//信息
odsProcureOutOrderMapper.updateWMSOdsProcureOutOrdersapSpecialTWById(order1);
}
}
}
// List<OdsProcureOutOrder> orderList2 = new ArrayList<>();//非反冲
// List<Map<String, Object>> mapList = new ArrayList<>();//非反冲
// List<SapBackflushMPQuery> sapMaterialPostingFCList = new ArrayList<>();//反冲
// List<OdsProcureOutOrder> orderList2FC = new ArrayList<>();//反冲
// for (OdsProcureOutOrder odsProcureOutOrder :
// orderList1) {
// if (!"X".equals(odsProcureOutOrder.getUserDefined3())){
// Map<String, Object> map = new HashMap<>();
// map.put("AUFNR", odsProcureOutOrder.getProduceCode());
// map.put("PLANT", odsProcureOutOrder.getSiteCode());
// String lgort = baseWarehouseMapper.selectByCode(odsProcureOutOrder.getLocCode());
// map.put("LGORT", lgort);
// map.put("MATNR", odsProcureOutOrder.getMaterialCode());
// map.put("QUANTITY", odsProcureOutOrder.getOutNumber().toString());
// map.put("MEINS", odsProcureOutOrder.getUnit());
// mapList.add(map);
// orderList2.add(odsProcureOutOrder);
// }else {
// SapBackflushMPQuery sapBackflushMPQuery = new SapBackflushMPQuery();
// sapBackflushMPQuery.setPlant(odsProcureOutOrder.getSiteCode()); //工厂
// String lgort = baseWarehouseMapper.selectByCode(odsProcureOutOrder.getLocCode());
// sapBackflushMPQuery.setLgort(lgort);//库存地点
// sapBackflushMPQuery.setUmlgo("0013");
// sapBackflushMPQuery.setMatnr(odsProcureOutOrder.getMaterialCode());//物料号
// sapBackflushMPQuery.setQuantity(odsProcureOutOrder.getOutNumber().toString()); //数量
// sapBackflushMPQuery.setMeins(odsProcureOutOrder.getUnit()); //基本计量单位
// sapBackflushMPQuery.setBatch(odsProcureOutOrder.getUserDefined2()); //批号
// sapMaterialPostingFCList.add(sapBackflushMPQuery);
// orderList2FC.add(odsProcureOutOrder);
// }
// }
// if (mapList.size() > 0) {
// //非反冲过账
// SapMaterialPosting sapMaterialPosting = new SapMaterialPosting();
// sapMaterialPosting.setPostingType("261");
// sapMaterialPosting.setMapList(mapList);
// R result = remoteSapService.sapMaterialPosting(sapMaterialPosting);
// OdsProcureOutOrder order = new OdsProcureOutOrder();
// int code = result.getCode();
// String msg = result.getMsg();
// //order.setSapMaterialPostingList(sapMaterialPostingList);
// order.setUserDefined11(msg);
// if (code == 200) {
// //过账成功
// Map map = new HashMap();
// map = (Map) result.getData();
// String userDefined9 = (String) map.get("MATERIALDOCUMENT");
// order.setUserDefined9(userDefined9);
// order.setUserDefined10("2");//成功
// for (OdsProcureOutOrder order1:
// orderList2 ) {
// BigDecimal sapNumber= order1.getSapNumber();
// order1.setSapNumber(sapNumber.add(order1.getOutNumber()));//成功..这个是否的outNumber是用已出库减去已经过账的数量
// odsProcureOutOrderMapper.updateWMSOdsProcureOutOrdersapById(order1);
// }
// odsProcureOutOrderMapper.updateWMSOdsProcureOutOrderByids(order, orderList2);
// for (OdsProcureOutOrder order1:
// orderList2) {
// //过账成功--减库存
// List<WmsOdsMateStorageNews> odsEmStorageNews= odsProcureOutOrderMapper.selectWmsRawMissionOutByPrdAndMa(order1);
// for (WmsOdsMateStorageNews wmsOdsMateStorageNews:
// odsEmStorageNews) {
// //wmsOdsMateStorageNews
// wmsOdsMateStorageNews.setLastModifiedBy(SecurityUtils.getUsername());
// wmsOdsMateStorageNewsSnMapper.updatesub(wmsOdsMateStorageNews);//库存调整
// }
// }
// } else {
// //
// order.setUserDefined9("");
// order.setUserDefined10("3");//失败
// odsProcureOutOrderMapper.updateWMSOdsProcureOutOrderByids(order, orderList2);
// }
// }
// if (sapMaterialPostingFCList.size() > 0) {
// //反冲过账
// R result2 = remoteSapService.sapBackflushMP(sapMaterialPostingFCList);//x
// int code = result2.getCode();
// OdsProcureOutOrder order = new OdsProcureOutOrder();
// String msg = result2.getMsg();
// order.setUserDefined11(msg);
// if (code == 200) {
// //过账成功
// Map map = new HashMap();
// map = (Map) result2.getData();
// String userDefined9 = (String) map.get("MATERIALDOCUMENT");
// order.setUserDefined9(userDefined9);
// order.setUserDefined10("2");//成功
// for (OdsProcureOutOrder order1:
// orderList2FC ) {
// BigDecimal sapNumber= order1.getSapNumber();
// order1.setSapNumber(sapNumber.add(order1.getOutNumber()));//成功..这个是否的outNumber是用已出库减去已经过账的数量
// odsProcureOutOrderMapper.updateWMSOdsProcureOutOrdersapById(order1);
// }
// odsProcureOutOrderMapper.updateWMSOdsProcureOutOrderByids(order, orderList2FC);
// for (OdsProcureOutOrder order1:
// orderList2FC) {
// //过账成功--减库存
// List<WmsOdsMateStorageNews> odsEmStorageNews= odsProcureOutOrderMapper.selectWmsRawMissionOutByPrdAndMa(order1);
// for (WmsOdsMateStorageNews wmsOdsMateStorageNews:
// odsEmStorageNews) {
// //wmsOdsMateStorageNews
// wmsOdsMateStorageNews.setLastModifiedBy(SecurityUtils.getUsername());
// wmsOdsMateStorageNewsSnMapper.updatesub(wmsOdsMateStorageNews);//库存调整
// }
// }
// } else {//
// order.setUserDefined9("");
// order.setUserDefined10("3");//失败
// odsProcureOutOrderMapper.updateWMSOdsProcureOutOrderByids(order, orderList2FC);
// }
// }
}
}

@ -1251,7 +1251,7 @@
wms_raw_mission_out
WHERE
prd_order=#{produceCode} AND
material_code=#{materialCode} AND
material_code like concat('%', #{materialCode},'%') AND
user_defined5='1'
</select>
<select id="selectWmsRawMissionOutByPrdAndMaQC" resultType="java.lang.String">

@ -524,18 +524,12 @@
and SAP_status='1'
</select>
<select id="selectQcCheckTask" resultType="java.lang.String">
SELECT DISTINCT
qc.check_result
SELECT DISTINCT
qc_check_task.check_result
FROM
mes_report_work AS mw
LEFT JOIN qc_check_task AS qc ON qc.order_no = mw.workorder_code
AND qc.check_type = 'checkTypeCP'
WHERE
mw.report_code = #{wmsProductPut.workOrder}
AND mw.product_code like concat('%', #{wmsProductPut.productCode},
'%')
AND mw.batch = #{wmsProductPut.batchNumber}
AND qc.check_result IS NOT NULL
<![CDATA[ AND qc.check_result <> '']]>
pro_order_workorder
LEFT JOIN qc_check_task ON pro_order_workorder.workorder_code=qc_check_task.order_no
WHERE pro_order_workorder.workorder_code_sap=#{wmsProductPut.productOrder}
AND qc_check_task.check_type='checkTypeCP'
</select>
</mapper>

Loading…
Cancel
Save