Merge remote-tracking branch 'origin/master'

master
Yangwl 1 year ago
commit b3d73b8b4d

@ -86,48 +86,44 @@ public class EquSpareApplyServiceImpl implements IEquSpareApplyService {
@Override
@DS("#header.poolName")
public AjaxResult insertEquSpareApply(EquSpareApply equSpareApply) {
try {
//equSpareApply.getSpareApplyLists().size() 是在维修申领备件的时候进行的操作 批量新增
if(equSpareApply.getSpareApplyLists().size() >= 1){
List<EquSpareApply> list = equSpareApply.getSpareApplyLists();
for(EquSpareApply applyList:list){
applyList.setApplyId(IdUtils.fastSimpleUUID());
//生成领料单code //申领单号
String serialNum = String.format("%03d", equSpareApplyMapper.selectSerialNumber());
String code = DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + applyList.getWorkCode().substring(2);
//申领单号
equSpareApply.setApplyCode("AW" + code + serialNum);
//领用时间
applyList.setApplyTime(DateUtils.getNowDate());
//申领人
applyList.setApplyPeople(SecurityUtils.getUsername());
//工厂号
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
applyList.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_",""));
//创建人、创建时间
applyList.setCreateTime(DateUtils.getNowDate());
applyList.setCreateBy(SecurityUtils.getUsername());
equSpareApplyMapper.insertEquSpareApply(applyList);
//更新完备品申领单后,更新库存
SparePartsLedger sparePartsLedger = new SparePartsLedger();
sparePartsLedger.setStorageId(applyList.getStorageId());
BigDecimal applyNum = applyList.getSpareQuantity();
BigDecimal amount = applyList.getAmount();
sparePartsLedger.setAmount(amount.subtract(applyNum));
sparePartsLedgerMapper.updateSparePartsLedger(sparePartsLedger);
if(equSpareApply.getSpareApplyLists() != null){
List<EquSpareApply> list = equSpareApply.getSpareApplyLists();
for(EquSpareApply applyList:list){
applyList.setApplyId(IdUtils.fastSimpleUUID());
String serialNum = String.format("%03d", equSpareApplyMapper.selectSerialNumber());
if(applyList.getWorkCode() != null){
String code = applyList.getWorkCode();
applyList.setApplyCode("AW" + code.substring(2) + serialNum);
}
}else{
//领用时间
applyList.setApplyTime(DateUtils.getNowDate());
//申领人
applyList.setApplyPeople(SecurityUtils.getUsername());
//工厂号
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
applyList.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_",""));
//创建人、创建时间
applyList.setCreateTime(DateUtils.getNowDate());
applyList.setCreateBy(SecurityUtils.getUsername());
equSpareApplyMapper.insertEquSpareApply(applyList);
//更新完备品申领单后,更新库存
SparePartsLedger sparePartsLedger = new SparePartsLedger();
sparePartsLedger.setStorageId(applyList.getStorageId());
BigDecimal applyNum = applyList.getSpareQuantity();
BigDecimal amount = applyList.getAmount();
sparePartsLedger.setAmount(amount.subtract(applyNum));
sparePartsLedgerMapper.updateSparePartsLedger(sparePartsLedger);
}
}else if(equSpareApply.getSpareApplyLists() == null){
equSpareApply.setApplyId(IdUtils.fastSimpleUUID());
String serialNum = String.format("%03d", equSpareApplyMapper.selectSerialNumber());
if(equSpareApply.getWorkCode().length() == 12){
//生成领料单code 十五位单号
equSpareApply.setApplyCode("A" + equSpareApply.getWorkCode() + serialNum);
}else if(equSpareApply.getWorkCode().length() > 12){
equSpareApply.setApplyCode("AW" + equSpareApply.getWorkCode().substring(2) + serialNum);
}else{
if(equSpareApply.getWorkCode() != null){
String code = equSpareApply.getWorkCode();
equSpareApply.setApplyCode("AW" + code.substring(2) + serialNum);
} else{
//普通申领单
equSpareApply.setApplyCode("AN" + DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equSpareApply.getSpareUseEquipment() + serialNum);
equSpareApply.setApplyCode("AW" + DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equSpareApply.getSpareUseEquipment() + serialNum);
}
//领用时间
equSpareApply.setApplyTime(DateUtils.getNowDate());
@ -151,9 +147,6 @@ public class EquSpareApplyServiceImpl implements IEquSpareApplyService {
sparePartsLedgerMapper.updateSparePartsLedger(sparePartsLedger);
}
return success("新增申领记录成功!");
} catch (Exception e) {
return error();
}
}
/**

@ -67,8 +67,8 @@ public interface MesPrepareDetailMapper {
/**
* idlist
* @param prepareId
* @param workorderCode
* @return
*/
List<MesPrepareDetail> selectPrintPrepareDetailList(String prepareId);
List<MesPrepareDetail> selectPrintPrepareDetailList(String workorderCode);
}

@ -16,7 +16,7 @@ import com.op.mes.service.IMesPrepareDetailService;
/**
* mesService
*
*
* @author Open Platform
* @date 2023-08-04
*/
@ -29,7 +29,7 @@ public class MesPrepareDetailServiceImpl implements IMesPrepareDetailService {
/**
* mes
*
*
* @param recordId mes
* @return mes
*/
@ -40,7 +40,7 @@ public class MesPrepareDetailServiceImpl implements IMesPrepareDetailService {
/**
* mes
*
*
* @param mesPrepareDetail mes
* @return mes
*/
@ -51,7 +51,7 @@ public class MesPrepareDetailServiceImpl implements IMesPrepareDetailService {
/**
* mes
*
*
* @param mesPrepareDetail mes
* @return
*/
@ -63,7 +63,7 @@ public class MesPrepareDetailServiceImpl implements IMesPrepareDetailService {
/**
* mes
*
*
* @param mesPrepareDetail mes
* @return
*/
@ -75,7 +75,7 @@ public class MesPrepareDetailServiceImpl implements IMesPrepareDetailService {
/**
* mes
*
*
* @param recordIds mes
* @return
*/
@ -86,7 +86,7 @@ public class MesPrepareDetailServiceImpl implements IMesPrepareDetailService {
/**
* mes
*
*
* @param recordId mes
* @return
*/
@ -103,7 +103,7 @@ public class MesPrepareDetailServiceImpl implements IMesPrepareDetailService {
@DS("#header.poolName")
public AjaxResult printPrepareByCode(String workorderCode) {
MesPrepare mesPrepare = mesPrepareMapper.selectMesPrepareByCode(workorderCode);
List<MesPrepareDetail> mesPrepareDetailList = mesPrepareDetailMapper.selectPrintPrepareDetailList(mesPrepare.getPrepareId());
List<MesPrepareDetail> mesPrepareDetailList = mesPrepareDetailMapper.selectPrintPrepareDetailList(workorderCode);
PrintPrepareVo printPrepareVo = new PrintPrepareVo();
printPrepareVo.setMesPrepare(mesPrepare);
printPrepareVo.setMesPrepareDetailList(mesPrepareDetailList);

@ -8,7 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="recordId" column="record_id" />
<result property="prepareId" column="prepare_id" />
<result property="materialCode" column="material_code" />
<result property="materailName" column="materail_name" />
<result property="materialName" column="material_name" />
<result property="materailSpc" column="material_spc" />
<result property="unit" column="unit" />
<result property="quantity" column="quantity" />
@ -63,12 +63,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where record_id = #{recordId}
</select>
<select id="selectPrintPrepareDetailList" parameterType="String" resultMap="MesPrepareDetailResult">
select record_id, prepare_id, material_code,material_name, unit,
quantity, status, remark, attr1, attr2, attr3, attr4,
create_by, create_time, update_by, update_time, prod_type, factory_code,fund_quanlity
from mes_prepare_detail
where prepare_id = #{prepareId}
<select id="selectPrintPrepareDetailList" parameterType="String" resultType="com.op.mes.domain.MesPrepareDetail">
select
mp.workorder_name workorderCode,
mpd.material_code materialCode,
mpd.material_name materialName,
mpd.quantity,
mpd.unit,
mpd.status,
mpd.fund_quanlity fundQuanlity,
mpd.factory_code factoryCode,
ow.product_date productDate
from pro_order_workorder ow
left join mes_prepare mp on ow.workorder_code = mp.workorder_code
left join mes_prepare_detail mpd on mp.prepare_id = mpd.prepare_id
where ow.belong_work_order = #{workorderCode}
order by mp.workorder_name desc
</select>
<insert id="insertMesPrepareDetail" parameterType="MesPrepareDetail">

@ -39,63 +39,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectMesPrepareVo">
select prepare_id, workorder_code, workorder_name, parent_order, order_id, order_code, product_id, product_code, prod_type, product_name, product_spc, wet_detail_plan_id, product_date, shift_id, ancestors, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time, factory_code, material_code, material_name, material_spc, unit, quantity from mes_prepare
select prepare_id, workorder_code, workorder_name, parent_order, order_id, order_code, product_id,
product_code, prod_type, product_name, product_spc, wet_detail_plan_id, product_date,
shift_id, ancestors, status, remark, attr1, attr2, attr3, attr4, create_by, create_time,
update_by, update_time, factory_code, material_code, material_name, material_spc, unit, quantity
from mes_prepare
</sql>
<select id="selectMesPrepareList" parameterType="MesPrepare" resultMap="MesPrepareResult">
<select id="selectMesPrepareList" parameterType="com.op.mes.domain.MesPrepare" resultType="com.op.mes.domain.MesPrepare">
select
ms.prepare_id,
ms.workorder_code,
ms.workorder_name,
ms.parent_order,
ms.order_id,
ms.order_code,
ms.product_id,
ms.product_code,
ms.prod_type,
ms.product_name,
ms.product_spc,
ms.wet_detail_plan_id,
ms.product_date,
ms.shift_id,
ms.ancestors,
ms.status,
ms.remark,
ms.attr1,
ms.attr2,
ms.attr3,
ms.attr4,
ms.create_by,
ms.create_time,
ms.update_by,
ms.update_time,
ms.factory_code,
msd.prepare_id id,
msd.material_code,
msd.material_name,
msd.material_spc,
msd.unit,
msd.quantity
from mes_prepare ms,mes_prepare_detail msd
ms.workorder_name workorderCodeSap,
ow.workorder_code workorderCode,
ow.product_code productCode,
ow.product_name productName,
ow.product_date productDate,
ow.quantity_split quantity,
ow.unit
from mes_prepare ms
left join pro_order_workorder ow on ms.workorder_code = ow.workorder_code
<where>
<if test="workorderCode != null and workorderCode != ''"> and workorder_code like concat('%', #{workorderCode}, '%')</if>
<if test="workorderName != null and workorderName != ''"> and workorder_name like concat('%', #{workorderName}, '%')</if>
<if test="parentOrder != null and parentOrder != ''"> and parent_order = #{parentOrder}</if>
<if test="orderId != null and orderId != ''"> and order_id like concat('%', #{orderId}, '%')</if>
<if test="orderCode != null and orderCode != ''"> and order_code = #{orderCode}</if>
<if test="productId != null and productId != ''"> and product_id = #{productId}</if>
<if test="productCode != null and productCode != ''"> and product_code like concat('%', #{productCode}, '%')</if>
<if test="prodType != null and prodType != ''"> and prod_type = #{prodType}</if>
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
<if test="productSpc != null and productSpc != ''"> and product_spc = #{productSpc}</if>
<if test="wetDetailPlanId != null and wetDetailPlanId != ''"> and wet_detail_plan_id = #{wetDetailPlanId}</if>
<if test="productDate != null "> and product_date = #{productDate}</if>
<if test="shiftId != null and shiftId != ''"> and shift_id = #{shiftId}</if>
<if test="ancestors != null and ancestors != ''"> and ancestors = #{ancestors}</if>
<if test="status != null and status != ''"> and ms.status = #{status}</if>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
ow.del_flag = '0' and ow.parent_order = '0'
<if test="workorderCode != null and workorderCode != ''"> and ow.workorder_code like concat('%', #{workorderCode}, '%')</if>
<if test="workorderCodeSap != null and workorderCodeSap != ''"> and ms.workorder_name like concat('%', #{workorderCodeSap}, '%')</if>
<if test="productCode != null and productCode != ''"> and ow.product_code like concat('%', #{productCode}, '%')</if>
<if test="productName != null and productName != ''"> and ow.product_name like concat('%', #{productName}, '%')</if>
<if test="productDate != null "> and ow.product_date = #{productDate}</if>
and ms.del_flag = '0'
</where>
order by ow.product_date desc
</select>
<select id="selectMesPrepareByPrepareId" parameterType="String" resultMap="MesPrepareResult">

@ -5,9 +5,7 @@ import com.op.quality.domain.QcCheckType;
import com.op.quality.domain.QcInterface;
import com.op.quality.service.IQcInterfaceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@ -37,8 +35,8 @@ public class QcInterfaceController {
* @param qcInterface
* @return
*/
@GetMapping("/getOverallInfo")
public List<QcInterface> getOverallInfo(QcInterface qcInterface) {
@PostMapping("/getOverallInfo")
public List<QcInterface> getOverallInfo(@RequestBody QcInterface qcInterface) {
return qcInterfaceService.getOverallInfo(qcInterface);
}
@ -47,8 +45,45 @@ public class QcInterfaceController {
* @param qcInterface
* @return
*/
@GetMapping("/getCheckProjectsPie")
public List<QcInterface> getCheckProjectsPie(QcInterface qcInterface) {
@PostMapping("/getCheckProjectsPie")
public List<QcInterface> getCheckProjectsPie(@RequestBody QcInterface qcInterface) {
return qcInterfaceService.getCheckProjectsPie(qcInterface);
}
/**
* --
* @param qcInterface
* @return
*/
@PostMapping("/getSupplierBadTOP5")
public List<QcInterface> getSupplierBadTOP5(@RequestBody QcInterface qcInterface) {
return qcInterfaceService.getSupplierBadTOP5(qcInterface);
}
@PostMapping("/getSupplierNoOkList")
public List<QcInterface> getSupplierNoOkList(@RequestBody QcInterface qcInterface) {
return qcInterfaceService.getSupplierNoOkList(qcInterface);
}
/**
* --
* @param qcInterface
* @return
*/
@PostMapping("/getSupplierTaskList")
public List<QcInterface> getSupplierTaskList(@RequestBody QcInterface qcInterface) {
return qcInterfaceService.getSupplierTaskList(qcInterface);
}
/**
* -
* @param qcInterface
* @return
*/
@PostMapping("/getProduceStaticInfo")
public List<QcInterface> getProduceStaticInfo(@RequestBody QcInterface qcInterface) {
return qcInterfaceService.getProduceStaticInfo(qcInterface);
}
}

@ -1,5 +1,6 @@
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;
@ -20,6 +21,106 @@ public class QcInterface extends BaseEntity {
private String quality;
private String ymd;
private String projectName;
private String checkNo;
private String incomeBatchNo;
private String orderNo;
private String materialName;
private String unit;
private String supplierName;
@JsonFormat(pattern = "yyyy-MM-dd")
private String incomeTime;
private String checkStatus;
private String checkResult;
private String checkManName;
private String checkName;
public String getCheckNo() {
return checkNo;
}
public void setCheckNo(String checkNo) {
this.checkNo = checkNo;
}
public String getIncomeBatchNo() {
return incomeBatchNo;
}
public void setIncomeBatchNo(String incomeBatchNo) {
this.incomeBatchNo = incomeBatchNo;
}
public String getOrderNo() {
return orderNo;
}
public void setOrderNo(String orderNo) {
this.orderNo = orderNo;
}
public String getMaterialName() {
return materialName;
}
public void setMaterialName(String materialName) {
this.materialName = materialName;
}
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
public String getSupplierName() {
return supplierName;
}
public void setSupplierName(String supplierName) {
this.supplierName = supplierName;
}
public String getIncomeTime() {
return incomeTime;
}
public void setIncomeTime(String incomeTime) {
this.incomeTime = incomeTime;
}
public String getCheckStatus() {
return checkStatus;
}
public void setCheckStatus(String checkStatus) {
this.checkStatus = checkStatus;
}
public String getCheckResult() {
return checkResult;
}
public void setCheckResult(String checkResult) {
this.checkResult = checkResult;
}
public String getCheckManName() {
return checkManName;
}
public void setCheckManName(String checkManName) {
this.checkManName = checkManName;
}
public String getCheckName() {
return checkName;
}
public void setCheckName(String checkName) {
this.checkName = checkName;
}
public String getProjectName() {
return projectName;

@ -21,4 +21,10 @@ public interface QcInterfaceMapper {
List<QcInterface> getOverallInfo(QcInterface qcInterface);
List<QcInterface> getCheckProjectsPie(QcInterface qcInterface);
List<QcInterface> getSupplierBadTOP5(QcInterface qcInterface);
List<QcInterface> getSupplierTaskList(QcInterface qcInterface);
List<QcInterface> getSupplierNoOkList(QcInterface qcInterface);
}

@ -18,4 +18,12 @@ public interface IQcInterfaceService {
List<QcInterface> getOverallInfo(QcInterface qcInterface);
List<QcInterface> getCheckProjectsPie(QcInterface qcInterface);
List<QcInterface> getSupplierBadTOP5(QcInterface qcInterface);
List<QcInterface> getSupplierTaskList(QcInterface qcInterface);
List<QcInterface> getSupplierNoOkList(QcInterface qcInterface);
List<QcInterface> getProduceStaticInfo(QcInterface qcInterface);
}

@ -13,6 +13,8 @@ import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.LocalDate;
import java.util.Calendar;
import java.util.List;
/**
@ -63,7 +65,63 @@ public class QcInterfaceServiceImpl implements IQcInterfaceService {
String nowYMD = DateUtils.getDate();
qcInterface.setYmd(nowYMD);
List<QcInterface> dtos = qcInterfaceMapper.getCheckProjectsPie(qcInterface);
return dtos;
}
@Override
public List<QcInterface> getSupplierBadTOP5(QcInterface qcInterface) {
DynamicDataSourceContextHolder.push(qcInterface.getFactoryCode());
String nowYMD = DateUtils.getDate();
qcInterface.setYmd(nowYMD);
List<QcInterface> dtos = qcInterfaceMapper.getSupplierBadTOP5(qcInterface);
return dtos;
}
@Override
public List<QcInterface> getSupplierTaskList(QcInterface qcInterface) {
DynamicDataSourceContextHolder.push(qcInterface.getFactoryCode());
String nowYMD = DateUtils.getDate();
qcInterface.setYmd(nowYMD);
List<QcInterface> dtos = qcInterfaceMapper.getSupplierTaskList(qcInterface);
for(QcInterface dto:dtos){
String[] ymdArray = dto.getIncomeTime().split("-");
LocalDate date1 = LocalDate.of(Integer.parseInt(ymdArray[0]),
Integer.parseInt(ymdArray[1]),
Integer.parseInt(ymdArray[2]));
LocalDate date2 = LocalDate.now();
if(date1.compareTo(date2)<0){
dto.setCheckStatus("逾期未检");
}else {
dto.setCheckStatus("0".equals(dto.getCheckStatus()) ? "待检测" : "检测完成");
}
dto.setCheckResult("Y".equals(dto.getCheckResult())?"合格":"不合格");
}
return dtos;
}
@Override
public List<QcInterface> getSupplierNoOkList(QcInterface qcInterface) {
DynamicDataSourceContextHolder.push(qcInterface.getFactoryCode());
String nowYMD = DateUtils.getDate();
qcInterface.setYmd(nowYMD);
List<QcInterface> dtos = qcInterfaceMapper.getSupplierNoOkList(qcInterface);
for(QcInterface dto:dtos){
dto.setCheckStatus("0".equals(dto.getCheckStatus())?"待检测":"检测完成");
dto.setCheckResult("Y".equals(dto.getCheckResult())?"合格":"不合格");
}
return dtos;
}
@Override
public List<QcInterface> getProduceStaticInfo(QcInterface qcInterface) {
DynamicDataSourceContextHolder.push(qcInterface.getFactoryCode());
String nowYMD = DateUtils.getDate();
qcInterface.setYmd(nowYMD);
List<QcInterface> dtos = qcInterfaceMapper.getSupplierNoOkList(qcInterface);
return dtos;
}
}

@ -191,6 +191,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="factoryCode != null and factoryCode != ''">factory_code,</if>
<if test="delFlag != null">del_flag,</if>
<if test="checkType != null">check_type,</if>
<if test="typeCode != null">type_code,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="recordId != null">#{recordId},</if>
@ -223,6 +224,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="factoryCode != null and factoryCode != ''">#{factoryCode},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="checkType != null">#{checkType},</if>
<if test="typeCode != null">#{typeCode},</if>
</trim>
</insert>

@ -145,6 +145,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="factoryCode != null and factoryCode != ''">factory_code,</if>
<if test="delFlag != null">del_flag,</if>
<if test="checkType != null">check_type,</if>
<if test="typeCode != null">type_code,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="recordId != null">#{recordId},</if>
@ -181,6 +182,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="factoryCode != null and factoryCode != ''">#{factoryCode},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="checkType != null">#{checkType},</if>
<if test="typeCode != null">#{typeCode},</if>
</trim>
</insert>

@ -128,6 +128,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="factoryCode != null and factoryCode != ''">factory_code,</if>
<if test="delFlag != null">del_flag,</if>
<if test="checkType != null">check_type,</if>
<if test="typeCode != null">type_code,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="recordId != null">#{recordId},</if>
@ -159,6 +160,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="factoryCode != null and factoryCode != ''">#{factoryCode},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="checkType != null">#{checkType},</if>
<if test="typeCode != null">#{typeCode},</if>
</trim>
</insert>

@ -101,7 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from wms_raw_order_in wroi
left join base_supplier bs on bs.supplier_code = wroi.supply_code
where wroi.active_flag = '1' and wroi.quality_status = '0'
<if test="orderNo != null">and wroi.order_no like contact like ('%',#{orderNo})</if>
<if test="orderNo != null">and wroi.order_no like concat like ('%',#{orderNo})</if>
</select>
<select id="getWorkOrder" resultType="com.op.quality.domain.QcCheckTaskIncome">
select
@ -114,7 +114,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
product_date incomeTime
from pro_order_workorder
where status != 'w5' and parent_order != '0' and workorder_code_sap is not null
<if test="orderNo != null">and workorder_code_sap like contact like ('%',#{orderNo})</if>
<if test="orderNo != null">and workorder_code_sap like concat like ('%',#{orderNo})</if>
order by product_date desc
</select>

@ -57,4 +57,101 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
group by qctd.project_no,qctd.rule_name
</select>
<select id="getSupplierBadTOP5" resultType="com.op.quality.domain.QcInterface">
select top 5 * from(
select
concat(t1.supplier_name,'-',t1.material_name) supplierName,
ROUND(t2.noOkNum*100.00/t1.allNum, 2) quality
from (
select count(0) allNum,
qct.supplier_code,qct.supplier_name,qct.material_code,qct.material_name
from qc_check_task qct
where qct.type_code = #{typeCode}
<if test='ymdType=="yyyy"'>
and CONVERT(varchar(4),qct.income_time, 120) = SUBSTRING(#{ymd},0,5)
</if>
<if test='ymdType=="mm"'>
and CONVERT(varchar(7),qct.income_time, 120) = SUBSTRING(#{ymd},0,8)
</if>
<if test='ymdType=="dd"'>
and CONVERT(varchar(10),qct.income_time, 120) = SUBSTRING(#{ymd},0,11)
</if>
group by
qct.supplier_code,qct.supplier_name,qct.material_code,qct.material_name
) t1
left join (
select
count(0) noOkNum,qct.supplier_code,qct.supplier_name,qct.material_code,qct.material_name
from qc_check_task qct
where qct.type_code = #{typeCode} and qct.check_result = 'N'
<if test='ymdType=="yyyy"'>
and CONVERT(varchar(4),qct.income_time, 120) = SUBSTRING(#{ymd},0,5)
</if>
<if test='ymdType=="mm"'>
and CONVERT(varchar(7),qct.income_time, 120) = SUBSTRING(#{ymd},0,8)
</if>
<if test='ymdType=="dd"'>
and CONVERT(varchar(10),qct.income_time, 120) = SUBSTRING(#{ymd},0,11)
</if>
group by
qct.supplier_code,qct.supplier_name,qct.material_code,qct.material_name
) t2 on t1.supplier_code = t2.supplier_code and t1.material_code = t2.material_code
) t order by t.quality desc
</select>
<select id="getSupplierTaskList" resultType="com.op.quality.domain.QcInterface">
select
qct.check_no checkNo,
qct.income_batch_no incomeBatchNo,
qct.order_no orderNo,
qct.material_name materialName,
qct.quality,
qct.unit,
qct.supplier_name supplierName,
qct.income_time incomeTime,
qct.check_status checkStatus,
qct.check_result checkResult,
qct.check_man_name checkManName,
qc.check_name checkName
from qc_check_task qct
left join qc_check_type qc on qct.check_type = qc.order_code
where qct.del_flag = '0' and qct.status = '1'
and qct.type_code = #{typeCode}
<if test='ymdType=="yyyy"'>
and CONVERT(varchar(4),qct.income_time, 120) = SUBSTRING(#{ymd},0,5)
</if>
<if test='ymdType=="mm"'>
and CONVERT(varchar(7),qct.income_time, 120) = SUBSTRING(#{ymd},0,8)
</if>
<if test='ymdType=="dd"'>
and CONVERT(varchar(10),qct.income_time, 120) = SUBSTRING(#{ymd},0,11)
</if>
order by qct.income_time desc,qct.check_status asc
</select>
<select id="getSupplierNoOkList" resultType="com.op.quality.domain.QcInterface">
select
qct.check_no checkNo,
qct.income_batch_no incomeBatchNo,
qct.order_no orderNo,
qct.material_name materialName,
qct.quality,
qct.unit,
qct.supplier_name supplierName,
qct.income_time incomeTime,
qct.check_result checkResult,
qct.check_man_name checkManName,
qc.check_name checkName
from qc_check_task qct
left join qc_check_type qc on qct.check_type = qc.order_code
where qct.type_code = #{typeCode} and qct.check_result = 'N'
<if test='ymdType=="yyyy"'>
and CONVERT(varchar(4),qct.income_time, 120) = SUBSTRING(#{ymd},0,5)
</if>
<if test='ymdType=="mm"'>
and CONVERT(varchar(7),qct.income_time, 120) = SUBSTRING(#{ymd},0,8)
</if>
<if test='ymdType=="dd"'>
and CONVERT(varchar(10),qct.income_time, 120) = SUBSTRING(#{ymd},0,11)
</if>
order by qct.income_time desc
</select>
</mapper>

@ -24,8 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
qct.supplier_code supplierCode,qct.supplier_name supplierName,
count(0) batchs,sum(qct.quality) nums
from qc_check_task qct
left join qc_check_type qc on qc.order_code = qct.check_type
where qc.type_code = #{qc.typeCode}
where qct.type_code = #{qc.typeCode}
and qct.del_flag = '0'
and CONVERT(varchar(7),qct.income_time, 120) = #{qc.yearMonth}
<if test="qc.checkResult != null">
@ -44,8 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
qct.supplier_code supplierCode,qct.supplier_name supplierName,
sum(qct.noOk_quality) noOkNums
from qc_check_task qct
left join qc_check_type qc on qc.order_code = qct.check_type
where qc.type_code = #{qc.typeCode}
where qct.type_code = #{qc.typeCode}
and qct.del_flag = '0'
and CONVERT(varchar(7),qct.income_time, 120) = #{qc.yearMonth}
<if test="codes != null and codes.size()>0">
@ -66,8 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
qct.cNoOkquality,
qct.income_time
from qc_check_task qct
left join qc_check_type qc on qc.order_code = qct.check_type
where qct.del_flag = '0' and qc.type_code = 'produce'
where qct.del_flag = '0' and qct.type_code = 'produce'
<if test="materialCode != null "> and qct.material_code in (${materialCode})</if>
<if test="workCenter != null "> and qct.supplier_code = #{workCenter}</if>
<if test="ymArrayStart != null "> and CONVERT(varchar(10),qct.income_time, 120) >= #{ymArrayStart}</if>
@ -77,8 +74,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select distinct qct.material_code materialCode,
qct.material_name materialName
from qc_check_task qct
left join qc_check_type qc on qc.order_code = qct.check_type
where qct.del_flag = '0' and qc.type_code = 'produce'
where qct.del_flag = '0' and qct.type_code = 'produce'
<if test="materialCode != null "> and qct.material_code in (${materialCode})</if>
<if test="workCenter != null "> and qct.supplier_code = #{workCenter}</if>
<if test="ymArrayStart != null "> and CONVERT(varchar(10),qct.income_time, 120) >= #{ymArrayStart}</if>
@ -95,8 +91,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sum(qct.cNoOkquality) cNoOkquality,
CONVERT(varchar(7),qct.income_time, 120) incomeTime
from qc_check_task qct
left join qc_check_type qc on qc.order_code = qct.check_type
where qct.del_flag = '0' and qc.type_code = 'produce'
where qct.del_flag = '0' and qct.type_code = 'produce'
<if test="materialCode != null "> and qct.material_code in (${materialCode})</if>
<if test="workCenter != null "> and qct.supplier_code = #{workCenter}</if>
<if test="ymArrayStart != null "> and CONVERT(varchar(10),qct.income_time, 120) >= #{ymArrayStart}</if>

@ -149,6 +149,14 @@ public class OdsProcureOrderController extends BaseController {
return success(wmsRawOrderInSns);
}
/**
*
*/
@ -221,7 +229,7 @@ public class OdsProcureOrderController extends BaseController {
@PostMapping("/InventoryPlanIssuance")
public AjaxResult InventoryPlanIssuance(@RequestBody WCSInventoryPlan wcsInventoryPlan) {
String result= odsProcureOrderService.InventoryPlanIssuance(wcsInventoryPlan);
//托盘状态更新
return success(result);
}
//http://192.168.202.37:9001/api/v1/ReceiveMesMsg/packingMaterialsOutBoundByPallet
@ -237,5 +245,36 @@ public class OdsProcureOrderController extends BaseController {
//托盘状态更新
return success(result);
}
/**
*
* @param odsProcureOutOrder
* @return
*/
@PostMapping("/ProductionMaterialRequisition")
public AjaxResult ProductionMaterialRequisition(@RequestBody OdsProcureOutOrder odsProcureOutOrder) {
List<OdsProcureOutOrder> result= odsProcureOrderService.ProductionMaterialRequisition(odsProcureOutOrder);
return success(result);
}
/**
* --
* @param wmsDesignatedPalle
* @return
*/
@PostMapping("/ProductionMaterialRequisition")
public AjaxResult ProductionMaterialRequisition(@RequestBody WMSDesignatedPalle wmsDesignatedPalle) {
// Integer result= odsProcureOrderService.ProductionMaterialRequisitionAdd(orderList);
return success();
}
/**
* --
* @param orderList
* @return
*/
@PostMapping("/ProductionMaterialRequisitionAdd")
public AjaxResult ProductionMaterialRequisitionAdd(@RequestBody List<OdsProcureOutOrder> orderList) {
Integer result= odsProcureOrderService.ProductionMaterialRequisitionAdd(orderList);
return success(result);
}
}

@ -118,6 +118,7 @@ public WmsToWCSDTO packingMaterialsOutBoundCompleted(@RequestBody WmsToWCSDTO wc
return success(wmsRawOrderInSns);
}
/**
*
*/
@ -141,7 +142,17 @@ public WmsToWCSDTO packingMaterialsOutBoundCompleted(@RequestBody WmsToWCSDTO wc
return success();
}
/**
*
* @param odsProcureOutOrder
* @return
*/
@PostMapping("/ProductionMaterialRequisition")
public AjaxResult ProductionMaterialRequisition(@RequestBody OdsProcureOutOrder odsProcureOutOrder) {
List<OdsProcureOutOrder> result= odsProcureOrderService.ProductionMaterialRequisition(odsProcureOutOrder);
return success(result);
}
/**
*
*/

@ -20,6 +20,15 @@ import com.op.common.core.web.domain.BaseEntity;
@JsonInclude(JsonInclude.Include.NON_NULL)
public class OdsProcureOutOrder extends BaseEntity {
private static final long serialVersionUID = 1L;
private String factoryCode;
public String getFactoryCode() {
return factoryCode;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
/** 工厂编码 */
@Excel(name = "工厂编码")

@ -14,7 +14,15 @@ public class OrderLine extends BaseEntity {
private BigDecimal qty;//数量
private String qualityStatus;//质检状态1合格2不合格
private String stationNo;//包装线
private String ken;//包装线--如果是用于自动化就选1,如果是手持人工出库就选2
public String getKen() {
return ken;
}
public void setKen(String ken) {
this.ken = ken;
}
private String materialCode;
private String materialDesc;

@ -82,4 +82,8 @@ public interface IOdsProcureOrderService {
String InventoryPlanIssuance(WCSInventoryPlan wcsInventoryPlan);
String DesignatedPalletOutbound(WMSDesignatedPalle wmsDesignatedPalle);
List<OdsProcureOutOrder> ProductionMaterialRequisition(OdsProcureOutOrder odsProcureOutOrder);
Integer ProductionMaterialRequisitionAdd(List<OdsProcureOutOrder> orderList);
}

@ -139,8 +139,8 @@ public class BaseEquipmentServiceImpl implements IBaseEquipmentService {
@Override
@DS("#header.poolName")
public int insertBaseEquipment(BaseEquipment baseEquipment) {
Date createTime = DateUtils.getNowDate();
baseEquipment.setCreateTime(createTime);
baseEquipment.setCreateTime(DateUtils.getNowDate());
baseEquipment.setCreateBy(SecurityUtils.getUsername());
String equipmentTypeName = baseEquipmentMapper.getEquipmentTypeName(baseEquipment);
String workCenterName = baseEquipmentMapper.getWorkCenterName(baseEquipment);
baseEquipment.setWorkshopName(workCenterName);
@ -245,6 +245,7 @@ public class BaseEquipmentServiceImpl implements IBaseEquipmentService {
public int updateBaseEquipment(BaseEquipment baseEquipment) {
baseEquipment.setUpdateTime(DateUtils.getNowDate());
baseEquipment.setUpdateBy(SecurityUtils.getUsername());
String equipmentTypeName = baseEquipmentMapper.getEquipmentTypeName(baseEquipment);
String workCenterName = baseEquipmentMapper.getWorkCenterName(baseEquipment);
baseEquipment.setWorkshopName(workCenterName);

@ -1,6 +1,6 @@
package com.op.wms.service.impl;
import com.alibaba.csp.sentinel.util.StringUtil;
import com.alibaba.fastjson2.JSONArray;
@ -13,9 +13,11 @@ import java.util.Date;
import java.util.List;
import com.op.common.core.constant.Constants;
import com.op.common.core.domain.R;
import com.op.common.core.utils.StringUtils;
import com.op.common.core.web.domain.AjaxResult;
import okhttp3.OkHttpClient;
import okhttp3.MediaType;
@ -269,35 +271,56 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService {
orderLine1.setOrderLineNo(String.format("%05d", orderItem));
orderLine1.setBatchNo("00001");
}
String meg= addPurchaseOrderOutboundWCS(orderLine);
if ("OK".equals(meg)){//成功
for (OrderLine orderLine1:
orderList) {
OdsProcureOutOrder odsProcureOutOrder=new OdsProcureOutOrder();
odsProcureOutOrder.setID(IdUtils.fastSimpleUUID());
odsProcureOutOrder.setProduceCode(orderLine.getOrderNo());
odsProcureOutOrder.setMaterialCode(orderLine1.getMaterialCode());
odsProcureOutOrder.setMaterialDesc(orderLine1.getMaterialDesc());
odsProcureOutOrder.setPlanDate(new Date());
odsProcureOutOrder.setUnit(orderLine1.getUnit());
odsProcureOutOrder.setProductionLineCode(orderLine1.getStationNo());
odsProcureOutOrder.setUserDefined1(orderLine1.getBatchNo());
odsProcureOutOrder.setActive("1");
odsProcureOutOrder.setOrderStatus("1");
odsProcureOutOrder.setPlanNumber(orderLine1.getPlanNumber());
odsProcureOutOrder.setUserDefined2(orderLine1.getOrderLineNo());
//odsProcureOutOrder.set
odsProcureOutOrderMapper.insertOdsProcureOutOrder(odsProcureOutOrder);
String ken=orderLine.getKen();
if("2".equals(ken)){
//手持出库
for (OrderLine orderLine1:
orderList) {
OdsProcureOutOrder odsProcureOutOrder=new OdsProcureOutOrder();
odsProcureOutOrder.setID(IdUtils.fastSimpleUUID());
odsProcureOutOrder.setProduceCode(orderLine.getOrderNo());
odsProcureOutOrder.setMaterialCode(orderLine1.getMaterialCode());
odsProcureOutOrder.setMaterialDesc(orderLine1.getMaterialDesc());
odsProcureOutOrder.setPlanDate(new Date());
odsProcureOutOrder.setUnit(orderLine1.getUnit());
odsProcureOutOrder.setProductionLineCode(orderLine1.getStationNo());
odsProcureOutOrder.setUserDefined1(orderLine1.getBatchNo());
odsProcureOutOrder.setActive("1");
odsProcureOutOrder.setOrderStatus("1");
odsProcureOutOrder.setPlanNumber(orderLine1.getPlanNumber());
odsProcureOutOrder.setUserDefined2(orderLine1.getOrderLineNo());
//odsProcureOutOrder.set
odsProcureOutOrderMapper.insertOdsProcureOutOrder(odsProcureOutOrder);
}
}else {
String meg= addPurchaseOrderOutboundWCS(orderLine);
if ("OK".equals(meg)){//成功
for (OrderLine orderLine1:
orderList) {
OdsProcureOutOrder odsProcureOutOrder=new OdsProcureOutOrder();
odsProcureOutOrder.setID(IdUtils.fastSimpleUUID());
odsProcureOutOrder.setProduceCode(orderLine.getOrderNo());
odsProcureOutOrder.setMaterialCode(orderLine1.getMaterialCode());
odsProcureOutOrder.setMaterialDesc(orderLine1.getMaterialDesc());
odsProcureOutOrder.setPlanDate(new Date());
odsProcureOutOrder.setUnit(orderLine1.getUnit());
odsProcureOutOrder.setProductionLineCode(orderLine1.getStationNo());
odsProcureOutOrder.setUserDefined1(orderLine1.getBatchNo());
odsProcureOutOrder.setActive("1");
odsProcureOutOrder.setOrderStatus("1");
odsProcureOutOrder.setPlanNumber(orderLine1.getPlanNumber());
odsProcureOutOrder.setUserDefined2(orderLine1.getOrderLineNo());
//odsProcureOutOrder.set
odsProcureOutOrderMapper.insertOdsProcureOutOrder(odsProcureOutOrder);
}
}
}
return orderLine;
}
@Override
public R sapPurchaseOrderSync(SapBackflushMPQuery sapPurchaseOrderQuery) {
// DynamicDataSourceContextHolder.push("ds_" + sapPurchaseOrderQuery.getFactoryCode());
DynamicDataSourceContextHolder.push("ds_" + sapPurchaseOrderQuery.getFactoryCode());
// try {
// // 获取调用 RFC 函数对象
// //获取连接
@ -496,6 +519,22 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService {
return result;
}
@Override
public List<OdsProcureOutOrder> ProductionMaterialRequisition(OdsProcureOutOrder odsProcureOutOrder) {
DynamicDataSourceContextHolder.push("ds_" + odsProcureOutOrder.getFactoryCode());
List<OdsProcureOutOrder> orderList= odsProcureOutOrderMapper.selectOdsProcureOutOrderList(odsProcureOutOrder);
return orderList;
}
@Override
public Integer ProductionMaterialRequisitionAdd(List<OdsProcureOutOrder> orderList) {
//修改对应订单--插入对应出库托盘数据数据
return null;
}
public String DesignatedPalletOutboundWCS(WMSDesignatedPalle wmsDesignatedPalle){
// 定义请求的URL地址
String url = "http://192.168.202.37:9001/api/v1/ReceiveMesMsg/packingMaterialsOutBoundByPallet";

@ -1,6 +1,7 @@
package com.op.wms.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.wms.domain.*;
import com.op.wms.mapper.*;
@ -29,6 +30,7 @@ public class WmsToWCSInterfaceServiceImpl implements IWmsToWCSInterfaceService {
@Override
@DS("#header.poolName")
public WmsToWCSDTO requestMaterialLoadNo(WmsToWCSDTO wcsdto) {
DynamicDataSourceContextHolder.push("ds_" + wcsdto.getFactory());
WmsToWCSDTO wmsToWCSDTO= wmsToWCSInterfaceMapper.selectWmsToWCSDTO(wcsdto);
// wmsToWCSDTO.set//
wmsToWCSDTO.setCode("0");
@ -46,6 +48,8 @@ public class WmsToWCSInterfaceServiceImpl implements IWmsToWCSInterfaceService {
@Override
@DS("#header.poolName")
public WmsToWCSDTO blankStorageOrTransferCompleted(WmsToWCSDTO wcsdto) {
DynamicDataSourceContextHolder.push("ds_" + wcsdto.getFactory());
WmsOdsWhiteEmbryoIn wmsOdsWhiteEmbryoIn1=new WmsOdsWhiteEmbryoIn();
//rfidNo-托盘
WmsToWCSDTO wmsToWCSDTO= wmsToWCSInterfaceMapper.selectWmsToWCSDTO(wcsdto);
@ -61,11 +65,9 @@ public class WmsToWCSInterfaceServiceImpl implements IWmsToWCSInterfaceService {
boolean ten = sum.compareTo(planNumber) >= 0; // 判断sum是否大于等于planNumber
if (ten) {
wmsOdsWhiteEmbryoIn1.setOrderStatus("1");
} else {
//小于
wmsOdsWhiteEmbryoIn1.setOrderStatus("2");
}
wmsOdsWhiteEmbryoIn1.setRealityNumber(sum);///操作数量+已入数量
//1,修改订单

@ -305,8 +305,8 @@
<if test="sapAsset != null">#{sapAsset},</if>
<if test="equipmentHead != null">#{equipmentHead},</if>
<if test="factoryCode != null">#{factoryCode},</if>
<if test="equipmentStatus != null">equipmentStatus,</if>
<if test="equipmentCategory != null">equipmentCategory,</if>
<if test="equipmentStatus != null">#{equipmentStatus},</if>
<if test="equipmentCategory != null">#{equipmentCategory},</if>
</trim>
</insert>
@ -581,7 +581,6 @@
where equipment_id = #{equipmentId}
</update>
<select id="selectAuxiliaryEquipmentList" parameterType="com.op.wms.domain.EquBindAuxiliaryEquipment" resultType="BaseEquipment">
select
ebac.auxiliary_equipment_code AS equipmentCode,

@ -218,14 +218,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectmesPrepare" parameterType="OdsProcureOutOrder" resultMap="OdsProcureOutOrderResult">
SELECT
prepare_id id,
workorder_code Produce_Code,
workorder_name Produce_Code,
product_code Material_Code,
product_name Material_Desc,
unit Unit,
product_date Plan_Date,
prod_type User_Defined1
FROM mes_prepare WHERE
workorder_code =#{produceCode}
workorder_name =#{produceCode}
</select>
<select id="selectmesPrepareDetail" parameterType="OdsProcureOutOrder" resultMap="OdsProcureOutOrderResult">

Loading…
Cancel
Save