Merge remote-tracking branch 'origin/master'

orign^2
wws 1 year ago
commit b9a9d5c6f0

@ -3,7 +3,10 @@ package com.op.device.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.op.device.domain.EquRepairOrder;
import com.op.device.domain.WorkCenter;
import com.op.device.domain.dto.EquCheckItemDTO;
import com.op.device.domain.dto.SummaryReportDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -118,4 +121,31 @@ public class EquCheckItemController extends BaseController {
public AjaxResult remove(@PathVariable String[] itemIds) {
return equCheckItemService.deleteEquCheckItemByItemIds(itemIds);
}
//检查标准汇总 点检、巡检、保养
@RequiresPermissions("device:item:summaryReport")
@GetMapping("/summaryReport")
public AjaxResult getSummaryReport(EquCheckItem equCheckItem) {
return equCheckItemService.getSummaryReport(equCheckItem);
}
/**
*
*
* @return
*/
@GetMapping("/getWorkCenter")
public AjaxResult getWorkCenter() {
return equCheckItemService.getWorkCenter();
}
/**
*
* @return
*/
@GetMapping("/matchList")
public AjaxResult selectMatchListByEquipmentCode(SummaryReportDTO summaryReportDTO) {
return equCheckItemService.selectMatchListByEquipmentCode(summaryReportDTO);
}
}

@ -203,6 +203,174 @@ public class SparePartsLedger extends BaseEntity {
@Excel(name = "备件类型", readConverterExp = "备=件用")
private String spareType;
//////////////////////////////////////////////////////////附属表
/** id */
private String id;
/** 主表备件编码 */
@Excel(name = "主表备件编码")
private String primaryCode;
/** 所属设备名称 */
@Excel(name = "所属设备名称")
private String ownEquipmentName;
/** 单机装配数量 */
@Excel(name = "单机装配数量")
private String unitQuantity;
/** 安全库存 */
@Excel(name = "安全库存")
private String safeStock;
/** 单价 */
@Excel(name = "单价")
private BigDecimal unitPrice;
/** 采购方式 */
@Excel(name = "采购方式")
private String procurementMethod;
/** 采购周期 */
@Excel(name = "采购周期")
private String procurementCycle;
/** 期初结存 */
@Excel(name = "期初结存")
private String openingBalance;
/** 出库记录 */
@Excel(name = "出库记录")
private String outputRecords;
/** 入库记录 */
@Excel(name = "入库记录")
private String inputRecords;
/** 期末盘点 */
@Excel(name = "期末盘点")
private String endInventory;
/** 期末金额 */
@Excel(name = "期末金额")
private BigDecimal endMoney;
/** 代用件 */
@Excel(name = "代用件")
private String substituteParts;
/** 所属设备编码 */
@Excel(name = "所属设备编码")
private String ownEquipmentCode;
public void setId(String id) {
this.id = id;
}
public String getId() {
return id;
}
public void setPrimaryCode(String primaryCode) {
this.primaryCode = primaryCode;
}
public String getPrimaryCode() {
return primaryCode;
}
public void setOwnEquipmentName(String ownEquipmentName) {
this.ownEquipmentName = ownEquipmentName;
}
public String getOwnEquipmentName() {
return ownEquipmentName;
}
public void setUnitQuantity(String unitQuantity) {
this.unitQuantity = unitQuantity;
}
public String getUnitQuantity() {
return unitQuantity;
}
public void setSafeStock(String safeStock) {
this.safeStock = safeStock;
}
public String getSafeStock() {
return safeStock;
}
public void setUnitPrice(BigDecimal unitPrice) {
this.unitPrice = unitPrice;
}
public BigDecimal getUnitPrice() {
return unitPrice;
}
public void setProcurementMethod(String procurementMethod) {
this.procurementMethod = procurementMethod;
}
public String getProcurementMethod() {
return procurementMethod;
}
public void setProcurementCycle(String procurementCycle) {
this.procurementCycle = procurementCycle;
}
public String getProcurementCycle() {
return procurementCycle;
}
public void setOpeningBalance(String openingBalance) {
this.openingBalance = openingBalance;
}
public String getOpeningBalance() {
return openingBalance;
}
public void setOutputRecords(String outputRecords) {
this.outputRecords = outputRecords;
}
public String getOutputRecords() {
return outputRecords;
}
public void setInputRecords(String inputRecords) {
this.inputRecords = inputRecords;
}
public String getInputRecords() {
return inputRecords;
}
public void setEndInventory(String endInventory) {
this.endInventory = endInventory;
}
public String getEndInventory() {
return endInventory;
}
public void setEndMoney(BigDecimal endMoney) {
this.endMoney = endMoney;
}
public BigDecimal getEndMoney() {
return endMoney;
}
public void setSubstituteParts(String substituteParts) {
this.substituteParts = substituteParts;
}
public String getSubstituteParts() {
return substituteParts;
}
public void setOwnEquipmentCode(String ownEquipmentCode) {
this.ownEquipmentCode = ownEquipmentCode;
}
public String getOwnEquipmentCode() {
return ownEquipmentCode;
}
/////////////////////////////
// 领用数量-保养备件领用使用
private BigDecimal applyNum;
public BigDecimal getApplyNum() {

@ -0,0 +1,477 @@
package com.op.device.domain.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.op.common.core.annotation.Excel;
import com.op.device.domain.EquCheckItemDetail;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
// 检查项维护页面DTO
public class SummaryReportDTO {
/** 主键 */
private String itemId ;
/** 检查项编码 */
private String itemCode ;
/** 检查项名称 */
private String itemName ;
/** 检查项方法/工具 */
private String itemMethod ;
/** 维护类型编码 */
private String itemType ;
/** 维护类型名称 */
private String itemTypeName ;
/** 检查项备注 */
private String itemRemark ;
// 检查工具
private String itemTools;
//标准类型
private String standardType;
//标准名称
private String standardName;
// 循环周期类型
private String itemLoopType;
// 循环周期
private int itemLoop;
/** 主键 */
private String orderId;
//设备
private String equipmentCode;
/** 维修前达标 */
private String detailReach;
//维修后是否达标
private String repairReach;
/** 主键 */
private String detailId ;
/** 主键 */
private String id ;
//1号
private String one ;
//2号
private String two ;
//3号
private String three ;
//4号
private String four ;
//5号
private String five ;
//6号
private String six ;
//7号
private String seven ;
//8号
private String eight ;
//9号
private String nine ;
//10号
private String ten ;
//11号
private String eleven ;
//12号
private String twelve ;
//13号
private String thirteen ;
//14号
private String fourteen;
//15号
private String fifteen;
//16号
private String sixteen;
//17号
private String seventeen;
//18号
private String eighteen;
//19号
private String nineteen;
//20号
private String twenty;
//21号
private String twentyOne;
//22号
private String twentyTwo;
//23号
private String twentyThree;
//24号
private String twentyFour;
//25号
private String twentyFive;
//26号
private String twentySix;
//27号
private String twentySeven;
//28号
private String twentyEight;
//29号
private String twentyNine;
//30号
private String thirty;
//31号
private String thirtyOne;
/** 实际结束时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
private Date orderEnd;
/** 时间 */
private String yearMouth;
public void setId(String id) {
this.id = id;
}
public String getId() {
return id;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
}
public String getOrderId() {
return orderId;
}
public String getItemTools() {
return itemTools;
}
public void setItemTools(String itemTools) {
this.itemTools = itemTools;
}
public String getItemId() {
return itemId;
}
public void setItemId(String itemId) {
this.itemId = itemId;
}
public String getItemCode() {
return itemCode;
}
public void setItemCode(String itemCode) {
this.itemCode = itemCode;
}
public String getItemName() {
return itemName;
}
public void setItemName(String itemName) {
this.itemName = itemName;
}
public String getItemMethod() {
return itemMethod;
}
public void setItemMethod(String itemMethod) {
this.itemMethod = itemMethod;
}
public String getItemType() {
return itemType;
}
public void setItemType(String itemType) {
this.itemType = itemType;
}
public String getItemTypeName() {
return itemTypeName;
}
public void setItemTypeName(String itemTypeName) {
this.itemTypeName = itemTypeName;
}
public String getItemRemark() {
return itemRemark;
}
public void setItemRemark(String itemRemark) {
this.itemRemark = itemRemark;
}
public String getStandardType() {
return standardType;
}
public void setStandardType(String standardType) {
this.standardType = standardType;
}
public String getStandardName() {
return standardName;
}
public void setStandardName(String standardName) {
this.standardName = standardName;
}
public int getItemLoop() {
return itemLoop;
}
public void setItemLoop(int itemLoop) {
this.itemLoop = itemLoop;
}
public String getItemLoopType() {
return itemLoopType;
}
public void setItemLoopType(String itemLoopType) {
this.itemLoopType = itemLoopType;
}
public void setEquipmentCode(String equipmentCode) {
this.equipmentCode = equipmentCode;
}
public String getEquipmentCode() {
return equipmentCode;
}
public void setDetailId(String detailId) {
this.detailId = detailId;
}
public String getDetailId() {
return detailId;
}
public String getRepairReach() {
return repairReach;
}
public void setRepairReach(String repairReach) {
this.repairReach = repairReach;
}
public String getDetailReach() {
return detailReach;
}
public void setDetailReach(String detailReach) {
this.detailReach = detailReach;
}
public void setOrderEnd(Date orderEnd) {
this.orderEnd = orderEnd;
}
public Date getOrderEnd() {
return orderEnd;
}
public void setYearMouth(String yearMouth) {
this.yearMouth = yearMouth;
}
public String getYearMouth() {
return yearMouth;
}
public void setOne(String one) {
this.one = one;
}
public String getOne() {
return one;
}
public void setTwo(String two) {
this.two = two;
}
public String getTwo() {
return two;
}
public void setThree(String three) {
this.three = three;
}
public String getThree() {
return three;
}
public void setFour(String four) {
this.four = four;
}
public String getFour() {
return four;
}
public void setFive(String five) {
this.five = five;
}
public String getFive() {
return five;
}
public void setSix(String six) {
this.six = six;
}
public String getSix() {
return six;
}
public void setSeven(String seven) {
this.seven = seven;
}
public String getSeven() {
return seven;
}
public void setEight(String eight) {
this.eight = eight;
}
public String getEight() {
return eight;
}
public void setNine(String nine) {
this.nine = nine;
}
public String getNine() {
return nine;
}
public void setTen(String ten) {
this.ten = ten;
}
public String getTen() {
return ten;
}
public void setEleven(String eleven) {
this.eleven = eleven;
}
public String getEleven() {
return eleven;
}
public void setTwelve(String twelve) {
this.twelve = twelve;
}
public String getTwelve() {
return twelve;
}
public void setThirteen(String thirteen) {
this.thirteen = thirteen;
}
public String getThirteen() {
return thirteen;
}
public void setFourteen(String fourteen) {
this.fourteen = fourteen;
}
public String getFourteen() {
return fourteen;
}
public void setFifteen(String fifteen) {
this.fifteen = fifteen;
}
public String getFifteen() {
return fifteen;
}
public void setSixteen(String sixteen) {
this.sixteen = sixteen;
}
public String getSixteen() {
return sixteen;
}
public void setSeventeen(String seventeen) {
this.seventeen = seventeen;
}
public String getSeventeen() {
return seventeen;
}
public void setEighteen(String eighteen) {
this.eighteen = eighteen;
}
public String getEighteen() {
return eighteen;
}
public void setNineteen(String nineteen) {
this.nineteen = nineteen;
}
public String getNineteen() {
return nineteen;
}
public void setTwenty(String twenty) {
this.twenty = twenty;
}
public String getTwenty() {
return twenty;
}
public void setTwentyOne(String twentyOne) {
this.twentyOne = twentyOne;
}
public String getTwentyOne() {
return twentyOne;
}
public void setTwentyTwo(String twentyTwo) {
this.twentyTwo = twentyTwo;
}
public String getTwentyTwo() {
return twentyTwo;
}
public void setTwentyThree(String twentyThree) {
this.twentyThree = twentyThree;
}
public String getTwentyThree() {
return twentyThree;
}
public void setTwentyFour(String twentyFour) {
this.twentyFour = twentyFour;
}
public String getTwentyFour() {
return twentyFour;
}
public void setTwentyFive(String twentyFive) {
this.twentyFive = twentyFive;
}
public String getTwentyFive() {
return twentyFive;
}
public void setTwentySix(String twentySix) {
this.twentySix = twentySix;
}
public String getTwentySix() {
return twentySix;
}
public void setTwentySeven(String twentySeven) {
this.twentySeven = twentySeven;
}
public String getTwentySeven() {
return twentySeven;
}
public void setTwentyEight(String twentyEight) {
this.twentyEight = twentyEight;
}
public String getTwentyEight() {
return twentyEight;
}
public void setTwentyNine(String twentyNine) {
this.twentyNine = twentyNine;
}
public String getTwentyNine() {
return twentyNine;
}
public void setThirty(String thirty) {
this.thirty = thirty;
}
public String getThirty() {
return thirty;
}
public void setThirtyOne(String thirtyOne) {
this.thirtyOne = thirtyOne;
}
public String getThirtyOne() {
return thirtyOne;
}
}

@ -4,6 +4,8 @@ import java.util.List;
import com.op.device.domain.EquCheckItem;
import com.op.device.domain.EquPlanDetail;
import com.op.device.domain.WorkCenter;
import com.op.device.domain.dto.SummaryReportDTO;
import com.op.device.domain.vo.EquCheckItemVO;
import org.apache.ibatis.annotations.Param;
@ -94,4 +96,24 @@ public interface EquCheckItemMapper {
* @return
*/
List<EquPlanDetail> checkDelItem(String itemCode);
////////////////////////////////////////////////汇总页面
/**
*
* @param equCheckItem
* @return
*/
List<SummaryReportDTO> getSummaryReport(EquCheckItem equCheckItem);
/**
*
* @return
*/
List<WorkCenter> selectWorkCenter();
/**
*
* @return
*/
List<SummaryReportDTO> selectMatchListByEquipmentCode(SummaryReportDTO summaryReportDTO);
}

@ -4,7 +4,9 @@ import java.util.List;
import com.op.common.core.web.domain.AjaxResult;
import com.op.device.domain.EquCheckItem;
import com.op.device.domain.EquRepairOrder;
import com.op.device.domain.dto.EquCheckItemDTO;
import com.op.device.domain.dto.SummaryReportDTO;
import com.op.device.domain.vo.EquCheckItemVO;
/**
@ -66,11 +68,29 @@ public interface IEquCheckItemService {
* list
* @return
*/
AjaxResult getEquipmentList();
public AjaxResult getEquipmentList();
/**
* codecode
* @return
*/
AjaxResult getEquipmentCodeListByItemCode(String itemCode);
public AjaxResult getEquipmentCodeListByItemCode(String itemCode);
/**
*
* @return
*/
public AjaxResult getSummaryReport(EquCheckItem equCheckItem);
/**
*
* @return
*/
public AjaxResult getWorkCenter();
/**
*
* @return
*/
public AjaxResult selectMatchListByEquipmentCode(SummaryReportDTO summaryReportDTO);
}

@ -693,6 +693,9 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
//维修工单结束时间
equRepairWorkOrder.setWorkEndTime(DateUtils.getNowDate());
//计算维修工单用时
//获取工单的开始时间
////更新每一项点检/巡检检查项信息
//判空
if(StringUtils.isNotEmpty(equRepairWorkOrder.getDetailList())){

@ -1,7 +1,9 @@
package com.op.device.service.impl;
import java.text.DateFormat;
import java.text.Format;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
@ -9,10 +11,9 @@ import com.op.common.core.context.SecurityContextHolder;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.core.web.domain.AjaxResult;
import com.op.device.domain.EquCheckItemDetail;
import com.op.device.domain.EquItemEquipment;
import com.op.device.domain.EquPlanDetail;
import com.op.device.domain.*;
import com.op.device.domain.dto.EquCheckItemDTO;
import com.op.device.domain.dto.SummaryReportDTO;
import com.op.device.domain.vo.EquCheckItemVO;
import com.op.device.mapper.EquCheckItemDetailMapper;
import com.op.device.mapper.EquItemEquipmentMapper;
@ -160,7 +161,7 @@ public class EquCheckItemServiceImpl implements IEquCheckItemService {
@Transactional
public AjaxResult updateEquCheckItem(EquCheckItemDTO equCheckItemDTO) {
// 校验检查项是否已存在
// 检验
EquCheckItem checkQuery = new EquCheckItem();
checkQuery.setItemType(equCheckItemDTO.getItemType());
checkQuery.setItemName(equCheckItemDTO.getItemName());
@ -329,4 +330,41 @@ public class EquCheckItemServiceImpl implements IEquCheckItemService {
equItemEquipmentMapper.insertEquItemEquipment(equItemEquipment);
}
}
/**
*
* @return
*/
@Override
@DS("#header.poolName")
public AjaxResult getSummaryReport(EquCheckItem equCheckItem){
List<SummaryReportDTO> summaryReportList = equCheckItemMapper.getSummaryReport(equCheckItem);
return success(summaryReportList);
}
/**
*
*
* @return
*/
@Override
@DS("#header.poolName")
public AjaxResult getWorkCenter() {
List<WorkCenter> workCenterList = equCheckItemMapper.selectWorkCenter();
return success(workCenterList);
}
/**
*
* @return
*/
@Override
@DS("#header.poolName")
public AjaxResult selectMatchListByEquipmentCode(SummaryReportDTO summaryReportDTO){
DateFormat df = new SimpleDateFormat("yyyy-MM");
summaryReportDTO.setYearMouth(df.format(summaryReportDTO.getOrderEnd()));
List<SummaryReportDTO> matchList = equCheckItemMapper.selectMatchListByEquipmentCode(summaryReportDTO);
return success(matchList);
}
}

@ -182,6 +182,29 @@ public class EquRepairWorkOrderServiceImpl implements IEquRepairWorkOrderService
//更新标准表
for(EquOrderStandard equOrderStandard:equRepairWorkOrder.getStandardList()){
//先删除每个检查项标准图片
String imageType = "4";
equOrderStandardMapper.deleteBaseFileBySourceId(equOrderStandard.getId(),imageType);
//图片批量新增
if (StringUtils.isNotEmpty(equOrderStandard.getPicturePath())) {
String[] ids = equOrderStandard.getPicturePath().split(",");
List<BaseFileData> files = new ArrayList<>();
BaseFileData file = null;
for (String id : ids) {
file = new BaseFileData();
file.setFileId(IdUtils.fastSimpleUUID());
file.setFileName(id.split("&fileName=")[1]);
file.setFileAddress(id);
file.setSourceId(equOrderStandard.getId());
file.setCreateBy(SecurityUtils.getUsername());
file.setCreateTime(new Date());
//图片类型 维修后
file.setImageType("4");
files.add(file);
}
equOrderStandardMapper.insertBaseFileBatch(files);
}
equOrderStandard.setUpdateBy(SecurityUtils.getUsername());
equOrderStandard.setUpdateTime(DateUtils.getNowDate());
equOrderStandardMapper.updateStandardAfterRepair(equOrderStandard);

@ -168,4 +168,49 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{itemId}
</foreach>
</delete>
<select id="getSummaryReport" resultType="com.op.device.domain.dto.SummaryReportDTO">
SELECT
eci.item_type_name AS itemTypeName,
eci.item_name AS itemName,
eci.item_method AS itemMethod,
eci.item_tools AS itemTools,
eci.item_loop_type AS itemLoopType,
eci.item_loop AS itemLoop,
ecid.detail_id AS detailId,
ecid.standard_type AS standardType,
ecid.standard_name AS standardName
FROM equ_check_item eci
left join equ_check_item_detail ecid on eci.item_code = ecid.parent_code
where eci.del_flag = '0'
</select>
<select id="selectWorkCenter" resultType="com.op.device.domain.WorkCenter">
select
factory_name AS factoryName,
factory_code AS factoryCode
from sys_factory
where f_type = 'c'
</select>
<select id="selectMatchListByEquipmentCode" resultType="com.op.device.domain.dto.SummaryReportDTO">
SELECT
eo.order_id AS orderId,
eo.equipment_code AS equipmentCode,
eo.order_end AS orderEnd,
eod.item_type_name AS itemTypeName,
eod.item_name AS itemName,
eos.id AS id,
eos.standard_name AS standardName,
eos.detail_reach AS detailReach,
eos.repair_reach AS repairReach
from equ_order eo
left join equ_order_detail eod on eo.order_code = eod.order_code
left join equ_order_standard eos on eod.id = eos.parent_code
where eo.del_flag = '0'
and eo.order_status = '1'
and eo.equipment_code = #{equipmentCode}
and CONVERT(varchar,order_end,21) like concat('%',#{yearMouth}, '%')
</select>
</mapper>

@ -32,6 +32,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="factoryCode" column="factory_code" />
<result property="sapFactoryCode" column="sap_factory_code" />
<result property="delFlag" column="del_flag" />
<!--附属表-->
<result property="id" column="id" />
<result property="primaryCode" column="primary_code" />
<result property="ownEquipmentName" column="own_equipment_name" />
<result property="unitQuantity" column="unit_quantity" />
<result property="safeStock" column="safe_stock" />
<result property="unitPrice" column="unit_price" />
<result property="procurementMethod" column="procurement_method" />
<result property="procurementCycle" column="procurement_cycle" />
<result property="openingBalance" column="opening_balance" />
<result property="outputRecords" column="output_records" />
<result property="inputRecords" column="input_records" />
<result property="endInventory" column="end_inventory" />
<result property="endMoney" column="end_money" />
<result property="createBy" column="create_by" />
<result property="factoryCode" column="factory_code" />
<result property="substituteParts" column="substitute_parts" />
<result property="ownEquipmentCode" column="own_equipment_code" />
</resultMap>
<sql id="selectSparePartsLedgerVo">
@ -67,53 +87,99 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
<select id="selectSparePartsLedgerList" parameterType="SparePartsLedger" resultMap="SparePartsLedgerResult">
<include refid="selectSparePartsLedgerVo"/>
select
womsn.storage_id,
womsn.storage_type,
womsn.material_code,
womsn.material_desc,
womsn.amount,
womsn.storage_amount,
womsn.sap_factory_code,
womsn.wl_name,
womsn.del_flag,
womsn.spare_use_life,
womsn.spare_name,
womsn.spare_mode,
womsn.spare_manufacturer,
womsn.spare_supplier,
womsn.spare_replacement_cycle,
womsn.spare_measurement_unit,
womsn.spare_conversion_unit,
womsn.spare_conversion_ratio,
womsn.spare_inventory_floor,
womsn.spare_inventory_upper,
womsn.spare_type,
womsn.create_by,
womsn.gmt_create,
womsn.last_modified_by,
womsn.gmt_modified,
womsn.active_flag,
womsn.factory_code,
womsna.id,
womsna.primary_code,
womsna.own_equipment_name,
womsna.unit_quantity,
womsna.safe_stock,
womsna.unit_price,
womsna.procurement_method,
womsna.procurement_cycle,
womsna.opening_balance,
womsna.output_records,
womsna.input_records,
womsna.end_inventory,
womsna.end_money,
womsna.substitute_parts,
womsna.own_equipment_code
from wms_ods_mate_storage_news womsn
left join wms_ods_mate_storage_news_attached womsna on womsn.material_code = womsna.primary_code
<where>
<if test="storageId != null and storageId != ''"> and storage_id = #{storageId}</if>
<if test="whCode != null and whCode != ''"> and wh_code = #{whCode}</if>
<if test="regionCode != null and regionCode != ''"> and region_code = #{regionCode}</if>
<if test="waCode != null and waCode != ''"> and wa_code = #{waCode}</if>
<if test="storageType != null and storageType != ''"> and storage_type = #{storageType}</if>
<if test="wlCode != null and wlCode != ''"> and wl_code = #{wlCode}</if>
<if test="materialCode != null and materialCode != ''"> and material_code like concat('%', #{materialCode}, '%')</if>
<if test="materialDesc != null and materialDesc != ''"> and material_desc like concat('%', #{materialDesc}, '%')</if>
<if test="amount != null "> and amount = #{amount}</if>
<if test="storageAmount != null "> and storage_amount = #{storageAmount}</if>
<if test="occupyAmount != null "> and occupy_amount = #{occupyAmount}</if>
<if test="lpn != null and lpn != ''"> and lpn = #{lpn}</if>
<if test="productBatch != null and productBatch != ''"> and product_batch = #{productBatch}</if>
<if test="receiveDate != null "> and receive_date = #{receiveDate}</if>
<if test="productDate != null "> and product_date = #{productDate}</if>
<if test="userDefined1 != null and userDefined1 != ''"> and user_defined1 = #{userDefined1}</if>
<if test="userDefined2 != null and userDefined2 != ''"> and user_defined2 = #{userDefined2}</if>
<if test="userDefined3 != null and userDefined3 != ''"> and user_defined3 = #{userDefined3}</if>
<if test="userDefined4 != null and userDefined4 != ''"> and user_defined4 = #{userDefined4}</if>
<if test="userDefined5 != null and userDefined5 != ''"> and user_defined5 = #{userDefined5}</if>
<if test="userDefined6 != null and userDefined6 != ''"> and user_defined6 = #{userDefined6}</if>
<if test="userDefined7 != null and userDefined7 != ''"> and user_defined7 = #{userDefined7}</if>
<if test="userDefined8 != null and userDefined8 != ''"> and user_defined8 = #{userDefined8}</if>
<if test="userDefined9 != null and userDefined9 != ''"> and user_defined9 = #{userDefined9}</if>
<if test="userDefined10 != null and userDefined10 != ''"> and user_defined10 = #{userDefined10}</if>
<if test="gmtCreate != null "> and gmt_create = #{gmtCreate}</if>
<if test="lastModifiedBy != null and lastModifiedBy != ''"> and last_modified_by = #{lastModifiedBy}</if>
<if test="gmtModified != null "> and gmt_modified = #{gmtModified}</if>
<if test="activeFlag != null and activeFlag != ''"> and active_flag = #{activeFlag}</if>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
<if test="sapFactoryCode != null and sapFactoryCode != ''"> and sap_factory_code = #{sapFactoryCode}</if>
<if test="wlName != null and wlName != ''"> and wl_name like concat('%', #{wlName}, '%')</if>
<if test="spareUseLife != null and spareUseLife != ''"> and spare_use_life = #{spareUseLife}</if>
<if test="spareName != null and spareName != ''"> and spare_name like concat('%', #{spareName}, '%')</if>
<if test="spareMode != null and spareMode != ''"> and spare_mode like concat('%', #{spareMode}, '%')</if>
<if test="spareManufacturer != null and spareManufacturer != ''"> and spare_manufacturer = #{spareManufacturer}</if>
<if test="spareSupplier != null and spareSupplier != ''"> and spare_supplier = #{spareSupplier}</if>
<if test="spareReplacementCycle != null and spareReplacementCycle != ''"> and spare_replacement_cycle = #{spareReplacementCycle}</if>
<if test="spareMeasurementUnit != null and spareMeasurementUnit != ''"> and spare_measurement_unit = #{spareMeasurementUnit}</if>
<if test="spareConversionUnit != null and spareConversionUnit != ''"> and spare_conversion_unit = #{spareConversionUnit}</if>
<if test="spareConversionRatio != null and spareConversionRatio != ''"> and spare_conversion_ratio = #{spareConversionRatio}</if>
<if test="spareInventoryFloor != null and spareInventoryFloor != ''"> and spare_inventory_floor = #{spareInventoryFloor}</if>
<if test="spareInventoryUpper != null and spareInventoryUpper != ''"> and spare_inventory_upper = #{spareInventoryUpper}</if>
<if test="spareType != null and spareType != ''"> and spare_type = #{spareType}</if>
and del_flag = '0'
<if test="storageId != null and storageId != ''"> and womsn.storage_id = #{storageId}</if>
<if test="whCode != null and whCode != ''"> and womsn.wh_code = #{whCode}</if>
<if test="regionCode != null and regionCode != ''"> and womsn.region_code = #{regionCode}</if>
<if test="waCode != null and waCode != ''"> and womsn.wa_code = #{waCode}</if>
<if test="storageType != null and storageType != ''"> and womsn.storage_type = #{storageType}</if>
<if test="wlCode != null and wlCode != ''"> and womsn.wl_code = #{wlCode}</if>
<if test="materialCode != null and materialCode != ''"> and womsn.material_code like concat('%', #{materialCode}, '%')</if>
<if test="materialDesc != null and materialDesc != ''"> and womsn.material_desc like concat('%', #{materialDesc}, '%')</if>
<if test="amount != null "> and womsn.amount = #{amount}</if>
<if test="storageAmount != null "> and womsn.storage_amount = #{storageAmount}</if>
<if test="occupyAmount != null "> and womsn.occupy_amount = #{occupyAmount}</if>
<if test="lpn != null and lpn != ''"> and womsn.lpn = #{lpn}</if>
<if test="productBatch != null and productBatch != ''"> and womsn.product_batch = #{productBatch}</if>
<if test="receiveDate != null "> and womsn.receive_date = #{receiveDate}</if>
<if test="productDate != null "> and womsn.product_date = #{productDate}</if>
<if test="userDefined1 != null and userDefined1 != ''"> and womsn.user_defined1 = #{userDefined1}</if>
<if test="userDefined2 != null and userDefined2 != ''"> and womsn.user_defined2 = #{userDefined2}</if>
<if test="userDefined3 != null and userDefined3 != ''"> and womsn.user_defined3 = #{userDefined3}</if>
<if test="userDefined4 != null and userDefined4 != ''"> and womsn.user_defined4 = #{userDefined4}</if>
<if test="userDefined5 != null and userDefined5 != ''"> and womsn.user_defined5 = #{userDefined5}</if>
<if test="userDefined6 != null and userDefined6 != ''"> and womsn.user_defined6 = #{userDefined6}</if>
<if test="userDefined7 != null and userDefined7 != ''"> and womsn.user_defined7 = #{userDefined7}</if>
<if test="userDefined8 != null and userDefined8 != ''"> and womsn.user_defined8 = #{userDefined8}</if>
<if test="userDefined9 != null and userDefined9 != ''"> and womsn.user_defined9 = #{userDefined9}</if>
<if test="userDefined10 != null and userDefined10 != ''"> and womsn.user_defined10 = #{userDefined10}</if>
<if test="gmtCreate != null "> and womsn.gmt_create = #{gmtCreate}</if>
<if test="lastModifiedBy != null and lastModifiedBy != ''"> and womsn.last_modified_by = #{lastModifiedBy}</if>
<if test="gmtModified != null "> and womsn.gmt_modified = #{gmtModified}</if>
<if test="activeFlag != null and activeFlag != ''"> and womsn.active_flag = #{activeFlag}</if>
<if test="factoryCode != null and factoryCode != ''"> and womsn.factory_code = #{factoryCode}</if>
<if test="sapFactoryCode != null and sapFactoryCode != ''"> and womsn.sap_factory_code = #{sapFactoryCode}</if>
<if test="wlName != null and wlName != ''"> and womsn.wl_name like concat('%', #{wlName}, '%')</if>
<if test="spareUseLife != null and spareUseLife != ''"> and womsn.spare_use_life = #{spareUseLife}</if>
<if test="spareName != null and spareName != ''"> and womsn.spare_name like concat('%', #{spareName}, '%')</if>
<if test="spareMode != null and spareMode != ''"> and womsn.spare_mode like concat('%', #{spareMode}, '%')</if>
<if test="spareManufacturer != null and spareManufacturer != ''"> and womsn.spare_manufacturer = #{spareManufacturer}</if>
<if test="spareSupplier != null and spareSupplier != ''"> and womsn.spare_supplier like concat('%', #{spareSupplier}, '%')</if>
<if test="spareReplacementCycle != null and spareReplacementCycle != ''"> and womsn.spare_replacement_cycle = #{spareReplacementCycle}</if>
<if test="spareMeasurementUnit != null and spareMeasurementUnit != ''"> and womsn.spare_measurement_unit = #{spareMeasurementUnit}</if>
<if test="spareConversionUnit != null and spareConversionUnit != ''"> and womsn.spare_conversion_unit = #{spareConversionUnit}</if>
<if test="spareConversionRatio != null and spareConversionRatio != ''"> and womsn.spare_conversion_ratio = #{spareConversionRatio}</if>
<if test="spareInventoryFloor != null and spareInventoryFloor != ''"> and womsn.spare_inventory_floor = #{spareInventoryFloor}</if>
<if test="spareInventoryUpper != null and spareInventoryUpper != ''"> and womsn.spare_inventory_upper = #{spareInventoryUpper}</if>
<if test="spareType != null and spareType != ''"> and womsn.spare_type = #{spareType}</if>
<if test="ownEquipmentName != null and ownEquipmentName != ''"> and womsna.own_equipment_name like concat('%', #{ownEquipmentName}, '%')</if>
and womsn.del_flag = '0'
</where>
</select>

@ -267,7 +267,7 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
new LinkedBlockingQueue<Runnable>());
try {
dateSources.forEach(dateSource -> {
if("ds_1000".equals(dateSource.get("poolName"))){//只有999白坯工厂有这种情况
if("ds_999".equals(dateSource.get("poolName"))){//只有999白坯工厂有这种情况
logger.info("++++++++++++" + dateSource.get("poolName") + "++++开始++++++++++");
Runnable run = () -> dateBKFunc(dateSource.get("poolName"),tables);
executorService.execute(run);
@ -320,11 +320,13 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
//母工单报工
logger.info("==========================母工单报工开始");
pHzWork.setQuantityFeedback(sHzWorks.getQuantityFeedback());
this.reportHzToSap(pHzWork);
pHzWork.setSac1(sHzWorks.getSac1());
R sapR = this.reportHzToSap(pHzWork);
logger.info("==========================母工单报工结束");
//最终报工标识:关闭子母工单
//最终报工标识且sap报工成功:关闭子母工单
MesReportWork endReport = mesReportWorkMapper.getEndReport(pHzWork);
if("1".equals(endReport.getEndReport())){
if("1".equals(endReport.getEndReport())&&sapR.getCode()==200){
/**
logger.info("报工======母sap工单编码"+sapWorkOrders.get(0).getWorkorderCodeSap()+
"子sap工单编码"+sapWorkOrders.get(1).getWorkorderCodeSap()
);
@ -338,6 +340,7 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
closeR.getCode()+","+
closeR.getMsg()+","+
closeR.getData());
**/
MesReportWork rworkVo = new MesReportWork();
rworkVo.setStatus("w3");
rworkVo.setUpdateTime(DateUtils.getNowDate());
@ -349,17 +352,34 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
return R.ok();
}
/**
*
* =sum(/)
* = *
* =
* =
*
*
* =
* = *
* =
* =
* @param workOrder
* @return
*/
private R reportHzToSap(MesReportWork workOrder){
SapRFW sapRFW = new SapRFW();
sapRFW.setAufnr(workOrder.getWorkorderCodeSap());//虚拟工单号
sapRFW.setGamng(workOrder.getQuantityFeedback().toString());//报工数量
SapRFW.lt_gs ltgs = new SapRFW.lt_gs();//生产订单报工工时修改
ltgs.setConf_activity1(workOrder.getSac1());//人工
ltgs.setConf_activity2(workOrder.getSac2());
ltgs.setConf_activity3(workOrder.getSac3());//机器
ltgs.setConf_activity4(workOrder.getSac4());
ltgs.setConf_activity5(workOrder.getSac5());//折旧
ltgs.setConf_activity6(workOrder.getSac6());
ltgs.setConf_activity1(workOrder.getSac1());//机器
BigDecimal newMan = new BigDecimal(workOrder.getSac1())
.multiply(new BigDecimal(workOrder.getSac2()));
ltgs.setConf_activity2(newMan.toString());//人工
ltgs.setConf_activity3(workOrder.getSac1());//折旧
ltgs.setConf_activity4(newMan.toString());//其它
// ltgs.setConf_activity5(workOrder.getSac5());
// ltgs.setConf_activity6(workOrder.getSac6());
sapRFW.setLt_gs(ltgs);
List<SapRFW.lt_hw> lt_hwList =new ArrayList<>();
MesReportWorkConsume consumeqo = new MesReportWorkConsume();
@ -387,6 +407,7 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
} else {
workOrder.setUploadStatus("2");
workOrder.setUploadMsg(r.getMsg());
return r;
}
workOrder.setUploadTime(DateUtils.getNowDate());
mesReportWorkMapper.updateSyncSapStatus(workOrder);

@ -319,7 +319,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from mes_material_transfer_result mt
left join base_equipment equ on mt.equipmentCode = equ.equipment_code
left join pro_order_workorder pow on pow.workorder_id = mt.OrderCode
where 1=1
where mt.rfid_status = '1'
<if test="productDateStart != null "> and CONVERT(varchar(30),mt.update_time, 120) >= #{productDateStart}</if>
<if test="productDateEnd != null "> and #{productDateEnd} > CONVERT(varchar(30),mt.update_time, 120)</if>
<if test="shiftId != null and shiftId != ''">
@ -360,7 +360,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
equipmentCode,
OrderCode
from mes_material_transfer_result
where 1=1
where rfid_status = '1'
<if test="productDateStart != null "> and CONVERT(varchar(30),update_time, 120) >= #{productDateStart}</if>
<if test="productDateEnd != null "> and #{productDateEnd} > CONVERT(varchar(30),update_time, 120)</if>
)mt
@ -466,14 +466,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select workorder_code_sap workorderCodeSap,
workorder_code workorderCode
from pro_order_workorder
where belong_work_order = #{workorderCode} and del_flag = '0'
where belong_work_order = #{workorderCode} and del_flag = '0' and status = 'w2'
order by parent_order
</select>
<select id="getReportWorkHzList" resultType="com.op.mes.domain.MesReportWork">
select mrw.workorderCode,mrw.productCode,mrw.productName,mrw.machineCode,mrw.machineName,
mrw.shiftCode,mrw.feedbackTime feedbackTimeStr,mrw.quantityFeedback,
mrw.workTime,mrw.useMan,mrw.uploadStatus,mrw.unit,<!--mrw.uploadTime,-->
pow.order_code orderCode,pow.quantity_split quantity
mrw.shiftCode,mrw.quantityFeedback,
mrw.workTime,mrw.useMan,mrw.uploadStatus,mrw.unit,
pow.order_code orderCode,pow.quantity_split quantity,
pow.workorder_code_sap workorderCodeSap,
pow.product_date productDate
from (
select workorder_code workorderCode,
product_code productCode,
@ -481,7 +483,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
machine_code machineCode,
machine_name machineName,
shift_code shiftCode,
CONVERT(varchar(10),feedback_time, 120) feedbackTime,
sum(quantity_feedback) quantityFeedback,
sum(work_time) workTime,
sum(use_man) useMan,
@ -495,18 +496,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
<if test="machineCode != null and machineCode != ''"> and machine_code = #{machineCode}</if>
<if test="machineName != null and machineName != ''"> and machine_name like concat('%', #{machineName}, '%')</if>
<if test="feedbackTimeStart != null "> and CONVERT(varchar(19),feedback_time, 120) >= #{feedbackTimeStart}</if>
<if test="feedbackTimeEnd != null "> and #{feedbackTimeEnd} >= CONVERT(varchar(19),feedback_time, 120)</if>
<if test="uploadStatus != null and uploadStatus != ''"> and upload_status = #{uploadStatus}</if>
group by workorder_code, product_code,product_name,CONVERT(varchar(10),feedback_time, 120),machine_code,machine_name,shift_code
group by workorder_code, product_code,product_name,machine_code,machine_name,shift_code
,upload_status,unit
<!--,upload_time-->
) mrw
left join pro_order_workorder pow on mrw.workorderCode = pow.workorder_code
<where>
pow.del_flag = '0'
<if test="feedbackTimeStart != null "> and pow.product_date >= #{feedbackTimeStart}</if>
<if test="feedbackTimeEnd != null "> and #{feedbackTimeEnd} >= pow.product_date</if>
<if test="orderCode != null and orderCode != ''"> and pow.order_code like concat('%', #{orderCode}, '%')</if>
</where>
order by mrw.feedbackTime desc
order by pow.product_date desc
</select>
<select id="getReportList" resultType="com.op.mes.domain.MesReportWork">
select
@ -552,26 +554,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mrw.quantity_feedback quantityFeedback,
mrw.product_code productCode,
mrw.product_name productName,
mrw.sac1,
mrw.sac2
<!--,
rte.tec_machine sac1,
rte.tec_man sac2,
rte.tec_depreciation sac3,
rte.tec_other sac4,
rte.tec_conf_acivity5 sac5,
rte.tec_conf_acivity6 sac6
-->
from (
select
workorder_code,
sum(quantity_feedback) quantity_feedback,
sum(round( work_time/use_man,2)) sac1,
use_man sac2,
product_code,
product_name
from
mes_report_work
where upload_status != #{uploadStatus} and prod_type = #{prodType}
and workorder_code = #{workorderCode}
group by workorder_code,product_code,product_name
group by workorder_code,product_code,product_name,use_man
) mrw
left join pro_order_workorder ow on mrw.workorder_code = ow.workorder_code
left join pro_route rte on rte.route_code = ow.route_code
<!--left join pro_route rte on rte.route_code = ow.route_code-->
</select>
<select id="getEndReport" resultType="com.op.mes.domain.MesReportWork">
select end_report endReport

@ -9,10 +9,7 @@ import com.op.common.log.annotation.Log;
import com.op.common.log.enums.BusinessType;
import com.op.common.security.annotation.RequiresPermissions;
import com.op.common.security.utils.SecurityUtils;
import com.op.quality.domain.QcBomComponent;
import com.op.quality.domain.QcCheckTaskDetail;
import com.op.quality.domain.QcCheckReportIncome;
import com.op.quality.domain.QcSupplier;
import com.op.quality.domain.*;
import com.op.quality.service.IQcCheckReportIncomeService;
import com.op.system.api.domain.SysUser;
import org.apache.commons.lang.StringUtils;
@ -49,7 +46,7 @@ public class QcCheckReportIncomeController extends BaseController {
LocalDate date = LocalDate.now();
LocalDate dateEnd = date.plusDays(1);
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
String dateEndStr = dtf.format(dateEnd)+" 00:00:00";
String dateEndStr = dtf.format(dateEnd)+" 23:59:59";
qcCheckReportIncome.setCheckTimeEnd(dateEndStr);//end
}

@ -3,6 +3,7 @@ package com.op.quality.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.op.quality.domain.QcCheckProject;
import com.op.quality.domain.QcMaterialGroup;
import com.op.quality.service.IQcMaterialGroupService;
import org.springframework.beans.factory.annotation.Autowired;
@ -105,5 +106,15 @@ public class QcCheckTypeProjectController extends BaseController {
public AjaxResult changeStatus(@RequestBody QcCheckTypeProject qcCheckTypeProject) {
return toAjax(qcCheckTypeProjectService.changeStatus(qcCheckTypeProject));
}
@GetMapping("/getProjectInfoList")
public TableDataInfo getProjectInfoList(QcCheckProject qcCheckProject) {
startPage();
List<QcCheckProject> list = qcCheckTypeProjectService.getProjectInfoList(qcCheckProject);
return getDataTable(list);
}
@PostMapping("/submitProjects")
public AjaxResult submitProjects(@RequestBody List<QcCheckTypeProject> typeProjects) {
return toAjax(qcCheckTypeProjectService.submitProjects(typeProjects));
}
}

@ -0,0 +1,54 @@
package com.op.quality.controller;
import com.op.common.core.utils.StringUtils;
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 java.util.List;
/**
*
*
* @author zxl
* @date 2023-11-15
*/
@RestController
@RequestMapping("/qcInterface")
public class QcInterfaceController {
@Autowired
private IQcInterfaceService qcInterfaceService;
/**
*/
@GetMapping("/getDictData")
public List<QcInterface> getDictData(QcInterface qcInterface) {
return qcInterfaceService.getDictData(qcInterface);
}
/**
* --
* @param qcInterface
* @return
*/
@GetMapping("/getOverallInfo")
public List<QcInterface> getOverallInfo(QcInterface qcInterface) {
return qcInterfaceService.getOverallInfo(qcInterface);
}
/**
* --
* @param qcInterface
* @return
*/
@GetMapping("/getCheckProjectsPie")
public List<QcInterface> getCheckProjectsPie(QcInterface qcInterface) {
return qcInterfaceService.getCheckProjectsPie(qcInterface);
}
}

@ -138,6 +138,15 @@ public class QcStaticTableController extends BaseController {
String key = keyPre+ymd;
QcStaticTable mdata = seriesdtos.get(key);
if(mdata != null){
if(mdata.getaNoOkquality()==null){
mdata.setaNoOkquality(new BigDecimal("0"));
}
if(mdata.getbNoOkquality()==null){
mdata.setbNoOkquality(new BigDecimal("0"));
}
if(mdata.getcNoOkquality()==null){
mdata.setcNoOkquality(new BigDecimal("0"));
}
BigDecimal defectRate = (mdata.getaNoOkquality().add(mdata.getbNoOkquality()).multiply(new BigDecimal("0.65"))
.add(mdata.getcNoOkquality()).multiply(new BigDecimal(0.35)))
.divide(new BigDecimal(mdata.getSampleQuality()))

@ -234,7 +234,7 @@ public class QuaController extends BaseController {
*/
@GetMapping("/pdaMaterialTree")
public AjaxResult pdaMaterialTree(QcMaterialGroup materialGroup) {
DynamicDataSourceContextHolder.push("ds_"+materialGroup.getFactoryCode());
DynamicDataSourceContextHolder.push(materialGroup.getFactoryCode());
return success(qcMaterialGroupService.selectQcMaterialTreeList(materialGroup));
}
@ -244,7 +244,7 @@ public class QuaController extends BaseController {
@GetMapping("/getCheckTypeProjectList")
public TableDataInfo list(QcCheckTypeProject qcCheckTypeProject) {
DynamicDataSourceContextHolder.push("ds_"+qcCheckTypeProject.getFactoryCode());
DynamicDataSourceContextHolder.push(qcCheckTypeProject.getFactoryCode());
startPage();
List<QcCheckTypeProject> list = qcMaterialGroupService.getCheckTypeProjectList(qcCheckTypeProject);
return getDataTable(list);
@ -252,7 +252,7 @@ public class QuaController extends BaseController {
@GetMapping("/getUnqualifiedList")
public TableDataInfo getUnqualifiedList(QcCheckUnqualified qcCheckUnqualified) {
DynamicDataSourceContextHolder.push("ds_"+qcCheckUnqualified.getFactoryCode());
DynamicDataSourceContextHolder.push(qcCheckUnqualified.getFactoryCode());
startPage();
qcCheckUnqualified.setDelFlag("0");
List<QcCheckUnqualified> list = qcCheckUnqualifiedService.selectQcCheckUnqualifiedList(qcCheckUnqualified);
@ -262,7 +262,7 @@ public class QuaController extends BaseController {
/**获取来料工单列表**/
@GetMapping("/getLLWorkOrder")
public TableDataInfo getLLWorkOrder(QcCheckTaskIncome qcCheckTaskIncome) {
DynamicDataSourceContextHolder.push("ds_"+qcCheckTaskIncome.getFactoryCode());
DynamicDataSourceContextHolder.push(qcCheckTaskIncome.getFactoryCode());
startPage();
List<QcCheckTaskIncome> list = qcCheckTaskIncomeService.getLLWorkOrder(qcCheckTaskIncome);
return getDataTable(list);
@ -270,7 +270,7 @@ public class QuaController extends BaseController {
/**获取生产工单列表**/
@GetMapping("/getWorkOrder")
public TableDataInfo getWorkOrder(QcCheckTaskIncome qcCheckTaskIncome) {
DynamicDataSourceContextHolder.push("ds_"+qcCheckTaskIncome.getFactoryCode());
DynamicDataSourceContextHolder.push(qcCheckTaskIncome.getFactoryCode());
startPage();
List<QcCheckTaskIncome> list = qcCheckTaskIncomeService.getWorkOrder(qcCheckTaskIncome);
return getDataTable(list);
@ -278,7 +278,7 @@ public class QuaController extends BaseController {
@PutMapping("/getBatchList")
public List<QcCheckTaskIncome> getBatchList(@RequestBody QcCheckTaskIncome qcCheckTaskIncome) {
DynamicDataSourceContextHolder.push("ds_"+qcCheckTaskIncome.getFactoryCode());
DynamicDataSourceContextHolder.push(qcCheckTaskIncome.getFactoryCode());
return qcCheckTaskIncomeService.getBatchList(qcCheckTaskIncome);
}
}

@ -57,6 +57,43 @@ public class QcCheckProject extends BaseEntity {
private String judge;
private String defectLevel;
private String materialCode;
private String typeCode;
private String groupId;
public String getMaterialCode() {
return materialCode;
}
public void setMaterialCode(String materialCode) {
this.materialCode = materialCode;
}
public String getGroupId() {
return groupId;
}
public void setGroupId(String groupId) {
this.groupId = groupId;
}
public String getTypeCode() {
return typeCode;
}
public void setTypeCode(String typeCode) {
this.typeCode = typeCode;
}
public String getDefectLevel() {
return defectLevel;
}
public void setDefectLevel(String defectLevel) {
this.defectLevel = defectLevel;
}
public String getJudge() {
return judge;
}

@ -0,0 +1,79 @@
package com.op.quality.domain;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
*
*
* @author Open Platform
* @date 2023-10-12
*/
public class QcInterface extends BaseEntity {
private static final long serialVersionUID = 1L;
private String ymdType;
private String ymdTypeName;
private String dictType;
private String factoryCode;
private String quality;
private String ymd;
private String projectName;
public String getProjectName() {
return projectName;
}
public void setProjectName(String projectName) {
this.projectName = projectName;
}
public String getYmd() {
return ymd;
}
public void setYmd(String ymd) {
this.ymd = ymd;
}
public String getQuality() {
return quality;
}
public void setQuality(String quality) {
this.quality = quality;
}
public String getFactoryCode() {
return factoryCode;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getYmdType() {
return ymdType;
}
public void setYmdType(String ymdType) {
this.ymdType = ymdType;
}
public String getYmdTypeName() {
return ymdTypeName;
}
public void setYmdTypeName(String ymdTypeName) {
this.ymdTypeName = ymdTypeName;
}
public String getDictType() {
return dictType;
}
public void setDictType(String dictType) {
this.dictType = dictType;
}
}

@ -62,4 +62,5 @@ public interface QcCheckProjectMapper {
public int deleteQcCheckProjectByIds(String[] ids);
public QcCheckProject selectSerialNumber();
}

@ -1,9 +1,6 @@
package com.op.quality.mapper;
import com.op.quality.domain.QcBomComponent;
import com.op.quality.domain.QcCheckReportIncome;
import com.op.quality.domain.QcCheckTaskDetail;
import com.op.quality.domain.QcSupplier;
import com.op.quality.domain.*;
import com.op.system.api.domain.SysUser;
import org.apache.ibatis.annotations.Mapper;

@ -84,4 +84,6 @@ public interface QcCheckTaskIncomeMapper {
List<SysDictData> getQcUnitList(SysDictData sysDictData);
List<QcCheckTaskIncome> getBatchList(QcCheckTaskIncome qcCheckTaskIncome);
String getTypeCode(String checkType);
}

@ -3,11 +3,13 @@ package com.op.quality.mapper;
import java.util.List;
import java.util.Map;
import com.op.quality.domain.QcCheckProject;
import com.op.quality.domain.QcCheckTaskDetail;
import com.op.quality.domain.QcCheckTypeProject;
import com.op.system.api.domain.SysDictData;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* Mapper
@ -72,4 +74,7 @@ public interface QcCheckTypeProjectMapper {
List<QcCheckTypeProject> getCheckTypeProjectList(QcCheckTypeProject qcCheckTypeProject);
@MapKey("dictValue")
Map<String, SysDictData> getDictMap(SysDictData sysDictData);
List<QcCheckProject> getProjectInfoList(QcCheckProject qcCheckProject);
int insertQcCheckTypeProjects(@Param("list") List<QcCheckTypeProject> typeProjects);
}

@ -0,0 +1,24 @@
package com.op.quality.mapper;
import com.op.quality.domain.QcCheckProject;
import com.op.quality.domain.QcCheckType;
import com.op.quality.domain.QcInterface;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* Mapper
*
* @author Open Platform
* @date 2023-10-13
*/
@Mapper
public interface QcInterfaceMapper {
List<QcInterface> getDictData(QcInterface qcInterface);
List<QcInterface> getOverallInfo(QcInterface qcInterface);
List<QcInterface> getCheckProjectsPie(QcInterface qcInterface);
}

@ -71,4 +71,5 @@ public interface IQcCheckReportIncomeService {
List<QcCheckTaskDetail> getCkeckProjectList(QcCheckTaskDetail qcCheckTaskDetail);
public List<QcCheckReportIncome> getPrintData(QcCheckReportIncome qcCheckReportIncome);
}

@ -1,6 +1,8 @@
package com.op.quality.service;
import java.util.List;
import com.op.quality.domain.QcCheckProject;
import com.op.quality.domain.QcCheckTypeProject;
/**
@ -61,4 +63,7 @@ public interface IQcCheckTypeProjectService {
*
*/
public int changeStatus(QcCheckTypeProject qcCheckTypeProject);
List<QcCheckProject> getProjectInfoList(QcCheckProject qcCheckProject);
int submitProjects(List<QcCheckTypeProject> typeProjects);
}

@ -0,0 +1,21 @@
package com.op.quality.service;
import com.op.quality.domain.QcCheckType;
import com.op.quality.domain.QcInterface;
import java.util.List;
/**
*
* @author Open Platform
* @date 2023-10-13
*/
public interface IQcInterfaceService {
List<QcInterface> getDictData(QcInterface qcInterface);
List<QcInterface> getOverallInfo(QcInterface qcInterface);
List<QcInterface> getCheckProjectsPie(QcInterface qcInterface);
}

@ -196,6 +196,7 @@ public class QcCheckReportIncomeServiceImpl implements IQcCheckReportIncomeServi
}
@Override
@DS("#header.poolName")
public List<QcCheckReportIncome> getPrintData(QcCheckReportIncome qcCheckReportIncome) {
return null;
}

@ -135,6 +135,8 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService {
qcCheckTaskIncome.setRecordId(beLongId);
qcCheckTaskIncome.setFactoryCode(factoryCode);
qcCheckTaskIncome.setCreateTime(nowDate);
//String typeCode = qcCheckTaskIncomeMapper.getTypeCode(qcCheckTaskIncome.getCheckType());
qcCheckTaskIncome.setTypeCode("material");//大检验节点
qcCheckTaskIncomeMapper.insertQcCheckTaskIncome(qcCheckTaskIncome);
/**qc_check_task_detail**/
for(QcCheckTaskDetail item:items){
@ -321,7 +323,7 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService {
@Override
public int commitCheckResults(List<QcCheckTaskDetail> details) {
DynamicDataSourceContextHolder.push("ds_"+details.get(0).getFactoryCode());
DynamicDataSourceContextHolder.push(details.get(0).getFactoryCode());
Date nowTime = DateUtils.getNowDate();
String factoryCode = details.get(0).getFactoryCode();
String updateBy = details.get(0).getUpdateBy();
@ -341,8 +343,9 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService {
QcCheckTaskIncome qcCheckTask = new QcCheckTaskIncome();
qcCheckTask.setUpdateBy(updateBy);
qcCheckTask.setRecordId(belongId);
qcCheckTask.setCheckResult("2");//检测状态0待检测1检测中2检测完成
qcCheckTask.setCheckStatus("2");//检测状态0待检测1检测中2检测完成
qcCheckTask.setUpdateTime(nowTime);
qcCheckTask.setCheckTime(nowTime);
qcCheckTask.setCheckResult(result);//检验结果Y合格 N不合格
/**qc_check_task**/
n = qcCheckTaskIncomeMapper.updateQcCheckTask(qcCheckTask);

@ -126,6 +126,7 @@ public class QcCheckTaskProduceServiceImpl implements IQcCheckTaskProduceService
qcCheckTaskProduce.setRecordId(beLongId);
qcCheckTaskProduce.setFactoryCode(factoryCode);
qcCheckTaskProduce.setCreateTime(nowDate);
qcCheckTaskProduce.setTypeCode("produce");//大检验节点
qcCheckTaskProduceMapper.insertQcCheckTaskProduce(qcCheckTaskProduce);
/**qc_check_task_detail**/
for(QcCheckTaskDetail item:items){

@ -127,6 +127,7 @@ public class QcCheckTaskWarehousingServiceImpl implements IQcCheckTaskWarehousin
qcCheckTaskWarehousing.setRecordId(beLongId);
qcCheckTaskWarehousing.setFactoryCode(factoryCode);
qcCheckTaskWarehousing.setCreateTime(nowDate);
qcCheckTaskWarehousing.setTypeCode("product");//大检验节点
qcCheckTaskWarehousingMapper.insertQcCheckTaskWarehousing(qcCheckTaskWarehousing);
/**qc_check_task_detail**/
for(QcCheckTaskDetail item:items){

@ -1,5 +1,6 @@
package com.op.quality.service.impl;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -8,6 +9,7 @@ import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.security.utils.SecurityUtils;
import com.op.quality.domain.QcCheckProject;
import com.op.system.api.domain.SysDictData;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -131,4 +133,27 @@ public class QcCheckTypeProjectServiceImpl implements IQcCheckTypeProjectService
qcCheckTypeProject.setUpdateTime(DateUtils.getNowDate());
return qcCheckTypeProjectMapper.updateQcCheckTypeProject(qcCheckTypeProject);
}
@Override
@DS("#header.poolName")
public List<QcCheckProject> getProjectInfoList(QcCheckProject qcCheckProject) {
return qcCheckTypeProjectMapper.getProjectInfoList(qcCheckProject);
}
@Override
@DS("#header.poolName")
public int submitProjects(List<QcCheckTypeProject> typeProjects) {
int m = 0;
Date nowTime = DateUtils.getNowDate();
String createBy = SecurityUtils.getUsername();
for(QcCheckTypeProject typeProject:typeProjects){
typeProject.setId(IdUtils.fastSimpleUUID());
typeProject.setCreateBy(createBy);
typeProject.setCreateTime(nowTime);
}
m = qcCheckTypeProjectMapper.insertQcCheckTypeProjects(typeProjects);
return m;
}
}

@ -0,0 +1,69 @@
package com.op.quality.service.impl;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import com.op.common.core.utils.DateUtils;
import com.op.quality.domain.QcCheckType;
import com.op.quality.domain.QcInterface;
import com.op.quality.mapper.QcInterfaceMapper;
import com.op.quality.service.IQcInterfaceService;
import com.op.system.api.domain.SysDictData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.List;
/**
* Service
*
* @author Open Platform
* @date 2023-10-13
*/
@Service
public class QcInterfaceServiceImpl implements IQcInterfaceService {
@Autowired
private QcInterfaceMapper qcInterfaceMapper;
@Override
public List<QcInterface> getDictData(QcInterface qcInterface) {
DynamicDataSourceContextHolder.push("master");
return qcInterfaceMapper.getDictData(qcInterface);
}
@Override
public List<QcInterface> getOverallInfo(QcInterface qcInterface) {
DynamicDataSourceContextHolder.push(qcInterface.getFactoryCode());
String nowYMD = DateUtils.getDate();
qcInterface.setYmd(nowYMD);
List<QcInterface> dtos = qcInterfaceMapper.getOverallInfo(qcInterface);
if(!CollectionUtils.isEmpty(dtos)&&dtos.size()==2){
QcInterface qif = new QcInterface();
qif.setYmdTypeName("okRate");
if(dtos.get(1).getQuality().equals("0")){
qif.setQuality("100%");
}else{
BigDecimal okRate = (new BigDecimal(dtos.get(0).getQuality())
.subtract(new BigDecimal(dtos.get(1).getQuality())))
.multiply(new BigDecimal("100"))
.divide(new BigDecimal(dtos.get(0).getQuality()),2, RoundingMode.HALF_UP);
qif.setQuality(okRate.toString()+"%");
}
dtos.add(qif);
}
return dtos;
}
@Override
public List<QcInterface> getCheckProjectsPie(QcInterface qcInterface) {
DynamicDataSourceContextHolder.push(qcInterface.getFactoryCode());
String nowYMD = DateUtils.getDate();
qcInterface.setYmd(nowYMD);
List<QcInterface> dtos = qcInterfaceMapper.getCheckProjectsPie(qcInterface);
return dtos;
}
}

@ -194,9 +194,11 @@ public class QcMaterialGroupServiceImpl implements IQcMaterialGroupService {
Map<String,SysDictData> dictMap = qcCheckTypeProjectMapper.getDictMap(sData);
if(dictMap != null){
for(QcCheckTypeProject dto:dtos){
if(StringUtils.isNotBlank(dto.getUnit())){
dto.setUnit(dictMap.get(dto.getUnit()).getDictLabel());
}
}
}
return dtos;
}

@ -126,7 +126,7 @@ public class QcProCheckServiceImpl implements QcProCheckService {
@Override
public List<QcCheckTaskDetail> getCheckTaskDetailList(QcCheckTaskDetail qcCheckTaskDetail) {
DynamicDataSourceContextHolder.push("ds_"+qcCheckTaskDetail.getFactoryCode());
DynamicDataSourceContextHolder.push(qcCheckTaskDetail.getFactoryCode());
return qcCheckTaskIncomeMapper.getCkeckProjectList(qcCheckTaskDetail);
}

@ -146,6 +146,7 @@ public class QcUserMaterialServiceImpl implements IQcUserMaterialService {
public List<QcUserMaterial> getList(QcUserMaterial qcUserMaterial) {
List<QcUserMaterial> dto = qcUserMaterialMapper.getUserMaterialListUndo(qcUserMaterial);
qcUserMaterial.setMaterialName(null);
List<QcUserMaterial> selected = qcUserMaterialMapper.getUserMaterialListDo(qcUserMaterial);
dto.addAll(selected);

@ -22,13 +22,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="delFlag" column="del_flag" />
<result property="samplePlan" column="sample_plan" />
<result property="judge" column="judge" />
<result property="defectLevel" column="defect_level" />
</resultMap>
<sql id="selectQcCheckProjectVo">
select id, order_num, rule_name, property_code, check_mode, check_tool, unit_code, check_standard,
attr1, create_by, create_time, update_by, update_time, factory_code, del_flag,sample_plan,
judge
judge,defect_level
from qc_check_project
</sql>
@ -74,6 +75,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="delFlag != null">del_flag,</if>
<if test="samplePlan != null">sample_plan,</if>
<if test="judge != null">judge,</if>
<if test="defectLevel != null">defect_level,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
@ -93,6 +96,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="delFlag != null">#{delFlag},</if>
<if test="samplePlan != null">#{samplePlan},</if>
<if test="judge != null">#{judge},</if>
<if test="defectLevel != null">#{defectLevel},</if>
</trim>
</insert>
@ -115,6 +119,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="samplePlan != null">sample_plan = #{samplePlan},</if>
<if test="judge != null">judge = #{judge},</if>
<if test="defectLevel != null">defect_level = #{defectLevel},</if>
</trim>
where id = #{id}
</update>
@ -135,4 +140,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
FROM qc_check_project
WHERE CONVERT(varchar(10),create_time, 120) = CONVERT(varchar(10),GETDATE(), 120)
</select>
</mapper>

@ -154,6 +154,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where powb.del_flag = '0' and pow.del_flag = '0'
and pow.workorder_code = #{workorderCode}
</select>
<select id="getTypeCode" resultType="java.lang.String">
select type_code from qc_check_type where order_code = #{checkType}
</select>
<insert id="insertQcCheckTaskIncome" parameterType="QcCheckTaskIncome">
insert into qc_check_task

@ -152,8 +152,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT
ctp.id,
ctp.project_id projectId,
cp.rule_name ruleName,
cp.property_code propertyCode,
qcp.rule_name ruleName,
qcp.property_code propertyCode,
ctp.type_id typeId,
ct.check_name,
ctp.standard_value standardValue,
@ -166,11 +166,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
qcp.check_tool checkTool,
qcp.check_mode checkMode
FROM qc_check_type_project ctp
LEFT JOIN qc_check_project cp ON ctp.project_id = cp.id
LEFT JOIN qc_check_project qcp ON ctp.project_id = qcp.id
left join qc_check_type ct on ct.id = ctp.type_id
left join base_product p on p.product_code = ctp.material_code
<where>
AND ctp.del_flag = '0' AND cp.del_flag = '0'
AND ctp.del_flag = '0' AND qcp.del_flag = '0'
<if test="groupId != null and groupId != ''"> and ctp.group_id = #{groupId}</if>
</where>
order by ctp.type_id
@ -231,6 +231,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="sort != null">#{sort},</if>
</trim>
</insert>
<insert id="insertQcCheckTypeProjects">
insert into qc_check_type_project(
id,project_id,project_no,type_id,
standard_value,upper_diff,down_diff,unit,
sample,sort,
create_by,create_time,
group_id,material_code,property_code
)values
<foreach collection="list" index="index" item="item" separator=",">
(
#{item.id},#{item.projectId},#{item.projectNo},#{item.typeId},
#{item.standardValue},#{item.upperDiff},#{item.downDiff},#{item.unit},
#{item.sample},#{item.sort},
#{item.createBy},#{item.createTime},
#{item.groupId},#{item.materialCode},#{item.propertyCode}
)
</foreach>
</insert>
<update id="updateQcCheckTypeProject" parameterType="QcCheckTypeProject">
update qc_check_type_project
@ -270,4 +288,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<select id="getProjectInfoList" resultType="com.op.quality.domain.QcCheckProject">
select
id,
order_num orderNum,
rule_name ruleName,
property_code propertyCode,
check_mode checkMode,
check_tool checkTool,
unit_code unitCode,
check_standard checkStandard,
sample_plan samplePlan,
judge ,
defect_level defectLevel
from qc_check_project
where del_flag = '0'
<if test="ruleName != null">and rule_name like concat('%',#{ruleName},'%') </if>
and id not in(
select project_id from qc_check_type_project
where type_id = #{typeCode}
<if test="samplePlan != null">and sample_plan = #{samplePlan}</if>
<if test="materialCode != null">and material_code = #{materialCode} </if>
)
</select>
</mapper>

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.op.quality.mapper.QcInterfaceMapper">
<select id="getDictData" resultType="com.op.quality.domain.QcInterface">
select dict_label ymdTypeName,
dict_value ymdType
from sys_dict_data
where dict_type = #{dictType} and status = '0'
</select>
<select id="getOverallInfo" resultType="com.op.quality.domain.QcInterface">
select count(0) quality,'all' ymdTypeName
from wms_raw_order_in
where active_flag = '1'
<if test='ymdType=="yyyy"'>
and CONVERT(varchar(4),receipt_time, 120) = SUBSTRING(#{ymd},0,5)
</if>
<if test='ymdType=="mm"'>
and CONVERT(varchar(7),receipt_time, 120) =SUBSTRING(#{ymd},0,8)
</if>
<if test='ymdType=="dd"'>
and CONVERT(varchar(10),receipt_time, 120) = SUBSTRING(#{ymd},0,11)
</if>
union ALL
select count(0),'unOk'
from qc_check_unqualified qcu
left join qc_check_type qct on qcu.type = qct.order_code
where qct.type_code = #{typeCode} and qcu.del_flag = '0'
<if test='ymdType=="yyyy"'>
and CONVERT(varchar(4),qcu.create_time, 120) = SUBSTRING(#{ymd},0,5)
</if>
<if test='ymdType=="mm"'>
and CONVERT(varchar(7),qcu.create_time, 120) = SUBSTRING(#{ymd},0,8)
</if>
<if test='ymdType=="dd"'>
and CONVERT(varchar(10),qcu.create_time, 120) = SUBSTRING(#{ymd},0,11)
</if>
</select>
<select id="getCheckProjectsPie" resultType="com.op.quality.domain.QcInterface">
select count(0) quality,
qctd.project_no,
qctd.rule_name projectName
from qc_check_task_detail qctd
left join qc_check_task qct on qctd.belong_to = qct.record_id
where qct.check_result = 'N' and qct.type_code = #{typeCode}
<if test='ymdType=="yyyy"'>
and CONVERT(varchar(4),qctd.update_time, 120) = SUBSTRING(#{ymd},0,5)
</if>
<if test='ymdType=="mm"'>
and CONVERT(varchar(7),qcu.update_time, 120) = SUBSTRING(#{ymd},0,8)
</if>
<if test='ymdType=="dd"'>
and CONVERT(varchar(10),qcu.update_time, 120) = SUBSTRING(#{ymd},0,11)
</if>
group by qctd.project_no,qctd.rule_name
</select>
</mapper>

@ -192,7 +192,7 @@ public class OdsProcureOrderController extends BaseController {
/**
*
*
* @param odsProcureOrder
* @param
* @return
*/
@PostMapping("/addPurchaseOrderOutbound")
@ -201,5 +201,41 @@ public class OdsProcureOrderController extends BaseController {
return success();
}
/**
*
* @param wmsTraystatus
* @return
*/
@PostMapping("/TraystatusUpdate")
public AjaxResult TraystatusUpdate(@RequestBody WMSTraystatus wmsTraystatus) {
odsProcureOrderService.TraystatusUpdate(wmsTraystatus);
//托盘状态更新
return success();
}
/**
*
* @param wcsInventoryPlan
* @return
*/
@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
/**
*
* @param wmsDesignatedPalle
* @return
*/
@PostMapping("/DesignatedPalletOutbound")
public AjaxResult DesignatedPalletOutbound(@RequestBody WMSDesignatedPalle wmsDesignatedPalle) {
String result= odsProcureOrderService.DesignatedPalletOutbound(wmsDesignatedPalle);
//托盘状态更新
return success(result);
}
}

@ -141,6 +141,7 @@ public WmsToWCSDTO packingMaterialsOutBoundCompleted(@RequestBody WmsToWCSDTO wc
return success();
}
/**
*
*/

@ -0,0 +1,101 @@
package com.op.wms.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import java.util.Date;
@JsonInclude(JsonInclude.Include.NON_NULL)
public class WCSInventoryPlan {
private String reqCode;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date reqTime;//请求时间
private String rfidNo;//rfid编号
private String batchNo;//批次号
private String sku;////物料编码
private String location;//扫码获取
private String qty; //数量
private String qualityStatus;////质检状态
private String factoryCode;
private String createBy;
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public String getFactoryCode() {
return factoryCode;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getReqCode() {
return reqCode;
}
public void setReqCode(String reqCode) {
this.reqCode = reqCode;
}
public Date getReqTime() {
return reqTime;
}
public void setReqTime(Date reqTime) {
this.reqTime = reqTime;
}
public String getRfidNo() {
return rfidNo;
}
public void setRfidNo(String rfidNo) {
this.rfidNo = rfidNo;
}
public String getBatchNo() {
return batchNo;
}
public void setBatchNo(String batchNo) {
this.batchNo = batchNo;
}
public String getSku() {
return sku;
}
public void setSku(String sku) {
this.sku = sku;
}
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
public String getQty() {
return qty;
}
public void setQty(String qty) {
this.qty = qty;
}
public String getQualityStatus() {
return qualityStatus;
}
public void setQualityStatus(String qualityStatus) {
this.qualityStatus = qualityStatus;
}
}

@ -0,0 +1,78 @@
package com.op.wms.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import java.util.Date;
@JsonInclude(JsonInclude.Include.NON_NULL)
public class WMSDesignatedPalle {
private String reqCode;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date reqTime;//请求时间
private String rfidNo;//rfid编号//如果是空托出库的话,这个字段就传固定的那个物料号
private String warehouseNo; //仓库编号
private String factoryCode;
public String getFactoryCode() {
return factoryCode;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getWarehouseNo() {
return warehouseNo;
}
public void setWarehouseNo(String warehouseNo) {
this.warehouseNo = warehouseNo;
}
private String location;//填包装线
private String type; //类型1是托盘出库,2是空托出库计划下发
public String getReqCode() {
return reqCode;
}
public void setReqCode(String reqCode) {
this.reqCode = reqCode;
}
public Date getReqTime() {
return reqTime;
}
public void setReqTime(Date reqTime) {
this.reqTime = reqTime;
}
public String getRfidNo() {
return rfidNo;
}
public void setRfidNo(String rfidNo) {
this.rfidNo = rfidNo;
}
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
}

@ -0,0 +1,79 @@
package com.op.wms.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import java.util.Date;
@JsonInclude(JsonInclude.Include.NON_NULL)
public class WMSTraystatus {
private String reqCode;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date reqTime;//请求时间
private String factoryCode;
private String rfidNo;
////0代表当前位置为空用于托盘被人拿走时的位置状态信息更新
private String locationStatus;
private String location;//当前托盘所处的具体的位置
//托盘类型:1空托盘 2.进入入库前整理区
private String palletType;
public String getFactoryCode() {
return factoryCode;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getReqCode() {
return reqCode;
}
public void setReqCode(String reqCode) {
this.reqCode = reqCode;
}
public Date getReqTime() {
return reqTime;
}
public void setReqTime(Date reqTime) {
this.reqTime = reqTime;
}
public String getRfidNo() {
return rfidNo;
}
public void setRfidNo(String rfidNo) {
this.rfidNo = rfidNo;
}
public String getLocationStatus() {
return locationStatus;
}
public void setLocationStatus(String locationStatus) {
this.locationStatus = locationStatus;
}
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
public String getPalletType() {
return palletType;
}
public void setPalletType(String palletType) {
this.palletType = palletType;
}
}

@ -2,8 +2,10 @@ package com.op.wms.mapper;
import java.util.List;
import com.op.wms.domain.WCSInventoryPlan;
import com.op.wms.domain.WmsOdsEmStorageNews;
import com.op.wms.domain.WmsOdsMateStorageNews;
import com.op.wms.domain.WmsToWCSDTO;
/**
* Mapper
@ -61,4 +63,7 @@ public interface WmsOdsMateStorageNewsMapper {
public int deleteWmsOdsMateStorageNewsByStorageIds(String[] storageIds);
WmsOdsMateStorageNews selectByWhCodeAndMate(WmsOdsEmStorageNews wmsOdsEmStorageNews);
WmsOdsMateStorageNews selectBaseProductByCode(WCSInventoryPlan wcsInventoryPlan);
}

@ -3,7 +3,9 @@ package com.op.wms.mapper;
import java.util.List;
import com.op.wms.domain.WmsOdsEmStorageNews;
import com.op.wms.domain.WmsOdsMateStorageNews;
import com.op.wms.domain.WmsOdsMateStorageNewsSn;
import com.op.wms.domain.WmsToWCSDTO;
/**
* Mapper
@ -64,4 +66,6 @@ public interface WmsOdsMateStorageNewsSnMapper {
void updatekdd(WmsOdsEmStorageNews wmsOdsEmStorageNews);
WmsOdsMateStorageNewsSn selectwmsRfidNotwo(WmsToWCSDTO wcsdto);
}

@ -2,6 +2,7 @@ package com.op.wms.mapper;
import java.util.List;
import com.op.wms.domain.WCSInventoryPlan;
import com.op.wms.domain.WmsRawOrderInSn;
import com.op.wms.domain.WmsToWCSDTO;
@ -64,5 +65,6 @@ public interface WmsRawOrderInSnMapper {
void updateU1Byid(WmsRawOrderInSn wmsRawOrderInSn);
WmsRawOrderInSn selectwmsRfidNotwo(WmsToWCSDTO wmsToWCSDTO);
}

@ -3,6 +3,7 @@ package com.op.wms.service;
import java.util.List;
import com.op.common.core.domain.R;
import com.op.common.core.web.domain.AjaxResult;
import com.op.wms.domain.*;
/**
@ -75,4 +76,10 @@ public interface IOdsProcureOrderService {
OrderLine addPurchaseOrderOutbound(OrderLine orderLine);
R sapPurchaseOrderSync(SapBackflushMPQuery sapPurchaseOrderQuery);
void TraystatusUpdate(WMSTraystatus wmsTraystatus);
String InventoryPlanIssuance(WCSInventoryPlan wcsInventoryPlan);
String DesignatedPalletOutbound(WMSDesignatedPalle wmsDesignatedPalle);
}

@ -1,5 +1,6 @@
package com.op.wms.service.impl;
import com.alibaba.csp.sentinel.util.StringUtil;
import com.alibaba.fastjson2.JSONArray;
@ -7,6 +8,7 @@ import com.alibaba.fastjson.JSONObject;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -14,8 +16,7 @@ import java.util.List;
import com.op.common.core.domain.R;
import com.op.common.core.web.domain.AjaxResult;
import okhttp3.OkHttpClient;
import okhttp3.MediaType;
import okhttp3.RequestBody;
@ -236,7 +237,7 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService {
wmsOdsMateStorageNewsSnMapper.updateAdd(wmsOdsEmStorageNews);
}
wmsRawOrderInSnMapper.updateU1Byid(wmsRawOrderInSn);
//修改库存--加,并且为冻结的,sap过账后再解
}
@Override
@ -268,7 +269,7 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService {
orderLine1.setOrderLineNo(String.format("%05d", orderItem));
orderLine1.setBatchNo("00001");
}
String meg= addPurchaseOrderOutboundSAP(orderLine);
String meg= addPurchaseOrderOutboundWCS(orderLine);
if ("OK".equals(meg)){//成功
for (OrderLine orderLine1:
orderList) {
@ -389,8 +390,266 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService {
return R.ok();
}
@Override
public void TraystatusUpdate(WMSTraystatus wmsTraystatus) {
//空托从楼到楼locationStatus是palletType是
//空托就不用管了只给他们发消息就可以了半托的话从2楼到3楼返回后需要下发计划这样就需要下发入口任务
// if ("2".equals(wmsTraystatus.getPalletType())){//palletType是半托从2楼到3楼返回
// //这个进入入库前整理区--要记录在入库-取消在这里添加记录,在下发任务的时候在添加
//
// }
TraystatusUpdateWCS(wmsTraystatus);
}
@Override
public String InventoryPlanIssuance(WCSInventoryPlan wcsInventoryPlan) {
DynamicDataSourceContextHolder.push("ds_" + wcsInventoryPlan.getFactoryCode());
//根据对应物料编码查询物料名称--如果没有
String message ="";
WmsOdsMateStorageNews wmsOdsMateStorageNews= wmsOdsMateStorageNewsMapper.selectBaseProductByCode(wcsInventoryPlan);
//wms_raw_order_in_sn
if (wmsOdsMateStorageNews==null){
//null
message="物料号错误";
return message;
}
WmsRawOrderInSn wmsRawOrderInSn=new WmsRawOrderInSn();
wmsRawOrderInSn.setRawOrderInSnId(IdUtils.fastSimpleUUID());
wmsRawOrderInSn.setUserDefined1("1");//出入库
wmsRawOrderInSn.setUserDefined2(wcsInventoryPlan.getBatchNo());//批次
wmsRawOrderInSn.setWhCode("WH02");//厂库编号
//wmsRawOrderInSn.setPoNo();//采购单号
// wmsRawOrderInSn.setPoLine(odsProcureOrder.getPoLine());//行项目
wmsRawOrderInSn.setMaterialCode(wcsInventoryPlan.getSku());
wmsRawOrderInSn.setMaterialDesc(wmsOdsMateStorageNews.getMaterialDesc());
wmsRawOrderInSn.setAmount(new BigDecimal(wcsInventoryPlan.getQty()));
wmsRawOrderInSn.setCreateBy(wcsInventoryPlan.getCreateBy());
wmsRawOrderInSn.setGmtCreate(new Date());
wmsRawOrderInSn.setActiveFlag("1");
wmsRawOrderInSn.setUserDefined4(wmsOdsMateStorageNews.getUserDefined1());//单位
wmsRawOrderInSn.setSn(wcsInventoryPlan.getRfidNo());//托盘号
wmsRawOrderInSn.setFactoryCode(wcsInventoryPlan.getFactoryCode());
//wmsRawOrderInSn.setUserDefined3(order.getID());//返库的入库记录
wmsRawOrderInSnMapper.insertWmsRawOrderInSn(wmsRawOrderInSn);
String tem= InventoryPlanIssuanceWCS(wcsInventoryPlan);
if ("OK".equals(tem)){
message="操作成功";
}
return message;
}
@Override
public String DesignatedPalletOutbound(WMSDesignatedPalle wmsDesignatedPalle) {
DynamicDataSourceContextHolder.push("ds_" + wmsDesignatedPalle.getFactoryCode());
String result="";
if ("1".equals(wmsDesignatedPalle.getType())){//类型1是托盘出库,2是空托出库计划下发
String meg= DesignatedPalletOutboundWCS(wmsDesignatedPalle);
if ("OK".equals(meg)){//成功 rfidNo
WmsToWCSDTO wcsdto =new WmsToWCSDTO();
wcsdto.setRfidNo(wmsDesignatedPalle.getRfidNo());
WmsOdsMateStorageNewsSn wmsOdsMateStorageNewsSn= wmsOdsMateStorageNewsSnMapper.selectwmsRfidNotwo(wcsdto);
WCSInventoryPlan wcsInventoryPlan=new WCSInventoryPlan();
wcsInventoryPlan.setSku(wmsOdsMateStorageNewsSn.getMaterialCode());
WmsOdsMateStorageNews wmsOdsMateStorageNews= wmsOdsMateStorageNewsMapper.selectBaseProductByCode(wcsInventoryPlan);
OdsProcureOutOrder odsProcureOutOrder=new OdsProcureOutOrder();
odsProcureOutOrder.setID(IdUtils.fastSimpleUUID());
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = new Date();
String formattedDate = dateFormat.format(date);
odsProcureOutOrder.setProduceCode("DE"+formattedDate);
odsProcureOutOrder.setMaterialCode(wmsOdsMateStorageNewsSn.getMaterialCode());
odsProcureOutOrder.setMaterialDesc(wmsOdsMateStorageNewsSn.getMaterialDesc());
odsProcureOutOrder.setPlanDate(new Date());
odsProcureOutOrder.setUnit(wmsOdsMateStorageNews.getUserDefined1());
odsProcureOutOrder.setProductionLineCode(wmsDesignatedPalle.getLocation());
odsProcureOutOrder.setUserDefined1(formattedDate);
odsProcureOutOrder.setActive("1");
odsProcureOutOrder.setOrderStatus("1");
odsProcureOutOrder.setPlanNumber(wmsOdsMateStorageNewsSn.getAmount());
odsProcureOutOrder.setUserDefined2("00001");//行项目
//odsProcureOutOrder.set
odsProcureOutOrderMapper.insertOdsProcureOutOrder(odsProcureOutOrder);
result="操作成功";
return result;
}
}else {
OrderLine orderLine=new OrderLine();
orderLine.setWarehouseNo("WH02");
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = new Date();
String formattedDate = dateFormat.format(date);
orderLine.setOrderNo(formattedDate);//,如果是空托盘垛的需求可以随机生成一个
List<OrderLine> list=new ArrayList<>();
Integer orderItem = 1;
OrderLine orderLine1=new OrderLine();
orderLine1.setOrderLineNo(String.format("%05d", orderItem));
orderLine1.setSku(wmsDesignatedPalle.getRfidNo());
list.add(orderLine1);
orderLine.setList(list);
String message= addPurchaseOrderOutboundTwoWCS(orderLine);
if ("OK".equals(message)) {//成功
result="操作成功";
return result;
}
}
return result;
}
public String DesignatedPalletOutboundWCS(WMSDesignatedPalle wmsDesignatedPalle){
// 定义请求的URL地址
String url = "http://192.168.202.37:9001/api/v1/ReceiveMesMsg/packingMaterialsOutBoundByPallet";
// 创建OkHttpClient实例
OkHttpClient client = new OkHttpClient();
// 定义请求体的媒体类型为json
MediaType mediaType = MediaType.parse("application/json");
try {
// 创建JSON对象payload并设置请求参数
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = new Date();
String formattedDate = dateFormat.format(date);
JSONObject payload = new JSONObject();
payload.put("reqCode", IdUtils.fastSimpleUUID());
payload.put("reqTime",formattedDate );
payload.put("warehouseNo", wmsDesignatedPalle.getWarehouseNo());
payload.put("rfidNo", wmsDesignatedPalle.getRfidNo());
payload.put("location", wmsDesignatedPalle.getLocation());
// 创建请求体将JSON对象转换为字符串
RequestBody body = RequestBody.create(mediaType, payload.toString());
// 创建POST请求
Request request = new Request.Builder()
.url(url)
.post(body)
.build();
// 执行请求并获取响应
Response response = client.newCall(request).execute();
// 获取响应数据并转换为JSON对象
String responseData = response.body().string();
JSONObject result = JSONObject.parseObject(responseData);
// 获取返回结果结果JSON对象请求编码、状态码和消息
result.get("reqCode");
result.get("code");
String message= (String) result.get("message");
response.close();
return message;
} catch (IOException e) {
// 捕获IOException并处理异常
e.printStackTrace(); // 这里最好记录异常到日志文件或者进行其他处理
} finally {
// 关闭OkHttpClient
client.dispatcher().executorService().shutdown();
}
// 返回0
return null;
}
public String InventoryPlanIssuanceWCS(WCSInventoryPlan wcsInventoryPlan){
// 定义请求的URL地址
String url = "http://192.168.202.37:9001/api/v1/ReceiveMesMsg/packingMaterialsInBoundTaskSend";
// 创建OkHttpClient实例
OkHttpClient client = new OkHttpClient();
// 定义请求体的媒体类型为json
MediaType mediaType = MediaType.parse("application/json");
try {
// 创建JSON对象payload并设置请求参数
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = new Date();
String formattedDate = dateFormat.format(date);
JSONObject payload = new JSONObject();
payload.put("reqCode", IdUtils.fastSimpleUUID());
payload.put("reqTime",formattedDate );
payload.put("rfidNo", wcsInventoryPlan.getRfidNo());
payload.put("batchNo", wcsInventoryPlan.getBatchNo());
payload.put("sku", wcsInventoryPlan.getSku());
payload.put("location", wcsInventoryPlan.getLocation());
payload.put("qty", wcsInventoryPlan.getQty());
payload.put("qualityStatus", wcsInventoryPlan.getQualityStatus());
// 创建请求体将JSON对象转换为字符串
RequestBody body = RequestBody.create(mediaType, payload.toString());
// 创建POST请求
Request request = new Request.Builder()
.url(url)
.post(body)
.build();
// 执行请求并获取响应
Response response = client.newCall(request).execute();
// 获取响应数据并转换为JSON对象
String responseData = response.body().string();
JSONObject result = JSONObject.parseObject(responseData);
// 获取返回结果结果JSON对象请求编码、状态码和消息
result.get("reqCode");
result.get("code");
String message= (String) result.get("message");
response.close();
return message;
} catch (IOException e) {
// 捕获IOException并处理异常
e.printStackTrace(); // 这里最好记录异常到日志文件或者进行其他处理
} finally {
// 关闭OkHttpClient
client.dispatcher().executorService().shutdown();
}
// 返回0
return null;
}
public String TraystatusUpdateWCS(WMSTraystatus wmsTraystatus){
// 定义请求的URL地址
String url = "http://192.168.202.37:9001/api/v1/ReceiveMesMsg/packingMaterialsReturnTaskSend";
// 创建OkHttpClient实例
OkHttpClient client = new OkHttpClient();
// 定义请求体的媒体类型为json
MediaType mediaType = MediaType.parse("application/json");
try {
// 创建JSON对象payload并设置请求参数
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = new Date();
String formattedDate = dateFormat.format(date);
JSONObject payload = new JSONObject();
payload.put("reqCode", IdUtils.fastSimpleUUID());
payload.put("reqTime",formattedDate );
payload.put("rfidNo", wmsTraystatus.getRfidNo());
payload.put("locationStatus", wmsTraystatus.getLocationStatus());
payload.put("location", wmsTraystatus.getLocation());
payload.put("palletType", wmsTraystatus.getPalletType());
// 创建请求体将JSON对象转换为字符串
RequestBody body = RequestBody.create(mediaType, payload.toString());
// 创建POST请求
Request request = new Request.Builder()
.url(url)
.post(body)
.build();
// 执行请求并获取响应
Response response = client.newCall(request).execute();
// 获取响应数据并转换为JSON对象
String responseData = response.body().string();
JSONObject result = JSONObject.parseObject(responseData);
// 获取返回结果结果JSON对象请求编码、状态码和消息
result.get("reqCode");
result.get("code");
String message= (String) result.get("message");
response.close();
return message;
} catch (IOException e) {
// 捕获IOException并处理异常
e.printStackTrace(); // 这里最好记录异常到日志文件或者进行其他处理
} finally {
// 关闭OkHttpClient
client.dispatcher().executorService().shutdown();
}
// 返回0
return null;
}
//下发计划的接口
public String addPurchaseOrderOutboundSAP(OrderLine orderLinete) {
public String addPurchaseOrderOutboundWCS(OrderLine orderLinete) {
// 定义请求的URL地址
String url = "http://192.168.202.37:9001/api/v1/ReceiveMesMsg/packingMaterialsOutBoundRequest";
// 创建OkHttpClient实例
@ -452,5 +711,63 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService {
return null;
}
//空托下发计划的接口
public String addPurchaseOrderOutboundTwoWCS(OrderLine orderLinete) {
// 定义请求的URL地址
String url = "http://192.168.202.37:9001/api/v1/ReceiveMesMsg/packingMaterialsOutBoundRequest";
// 创建OkHttpClient实例
OkHttpClient client = new OkHttpClient();
// 定义请求体的媒体类型为json
MediaType mediaType = MediaType.parse("application/json");
try {
// 创建JSON对象payload并设置请求参数
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = new Date();
String formattedDate = dateFormat.format(date);
JSONObject payload = new JSONObject();
payload.put("reqCode", IdUtils.fastSimpleUUID());
payload.put("reqTime",formattedDate );
payload.put("warehouseNo", orderLinete.getWarehouseNo());
payload.put("orderNo", orderLinete.getOrderNo());
JSONArray orderLines = new JSONArray();
List<OrderLine> orderList= orderLinete.getList();
// 创建订单行数组,并将订单行对象添加到数组中
for (OrderLine orderLine1:
orderList ) {
JSONObject orderLine = new JSONObject();
orderLine.put("orderLineNo", orderLine1.getOrderLineNo());
orderLine.put("sku", orderLine1.getMaterialCode());
orderLines.add(orderLine);
}
payload.put("orderLines", orderLines);
// 创建请求体将JSON对象转换为字符串
RequestBody body = RequestBody.create(mediaType, payload.toString());
// 创建POST请求
Request request = new Request.Builder()
.url(url)
.post(body)
.build();
// 执行请求并获取响应
Response response = client.newCall(request).execute();
// 获取响应数据并转换为JSON对象
String responseData = response.body().string();
JSONObject result = JSONObject.parseObject(responseData);
// 获取返回结果结果JSON对象请求编码、状态码和消息
result.get("reqCode");
result.get("code");
String message= (String) result.get("message");
response.close();
return message;
} catch (IOException e) {
// 捕获IOException并处理异常
e.printStackTrace(); // 这里最好记录异常到日志文件或者进行其他处理
} finally {
// 关闭OkHttpClient
client.dispatcher().executorService().shutdown();
}
// 返回0
return null;
}
}

@ -65,6 +65,7 @@ public class WmsToWCSmissionServiceImpl implements IWmsToWCSmissionService {
@Override
public WmsToWCSDTO packingMaterialsInboundCompleted(WmsToWCSDTO wmsToWCSDTO) {
DynamicDataSourceContextHolder.push("ds_" + wmsToWCSDTO.getFactory());
//wms_raw_order_in_sn
WmsRawOrderInSn wmsRawOrderInSn= wmsRawOrderInSnMapper.selectwmsRfidNo(wmsToWCSDTO);
wmsRawOrderInSn.setWhCode(wmsToWCSDTO.getWarehouseNo());
wmsRawOrderInSn.setWlCode(wmsToWCSDTO.getLocation());
@ -76,10 +77,12 @@ public class WmsToWCSmissionServiceImpl implements IWmsToWCSmissionService {
wmsOdsMateStorageNewsSn.setSn(wmsRawOrderInSn.getSn());
wmsOdsMateStorageNewsSn.setAmount(wmsRawOrderInSn.getAmount());
wmsOdsMateStorageNewsSn.setCreateBy("AGV");
wmsOdsMateStorageNewsSn.setActiveFlag("1");
wmsOdsMateStorageNewsSn.setGmtCreate(new Date());
wmsOdsMateStorageNewsSn.setMateOrderInSnId(IdUtils.fastSimpleUUID());
wmsOdsMateStorageNewsSn.setFactoryCode(wmsToWCSDTO.getFactory());
wmsOdsMateStorageNewsSn.setSapFactoryCode(wmsToWCSDTO.getFactory());
//wms_ods_mate_storage_news_sn
wmsOdsMateStorageNewsSnMapper.insertWmsOdsMateStorageNewsSn(wmsOdsMateStorageNewsSn);
//修改库存
//修改库存加库存数量storage_amount = IFNULL(storage_amount, 0) + #{amount},
@ -128,15 +131,23 @@ public class WmsToWCSmissionServiceImpl implements IWmsToWCSmissionService {
//记录明细消减库存
DynamicDataSourceContextHolder.push("ds_" + wcsdto.getFactory());
WmsRawOrderInSn wmsRawOrderInSn= wmsRawOrderInSnMapper.selectwmsRfidNotwo(wcsdto);
WmsOdsMateStorageNewsSn wmsOdsMateStorageNewsSn= wmsOdsMateStorageNewsSnMapper.selectwmsRfidNotwo(wcsdto);
//user_defined1='2'也就是查询的已经入库的托盘记录,再之后要进行标记备注5为1.不为空即是这,
// 或者直接在库存明细中查询这个托盘,然后后面对这条托盘明细进行标记处理,表示已经出库--用这个
//修改库存
//修改库存加库存数量storage_amount = IFNULL(storage_amount, 0) + #{amount},
WmsOdsEmStorageNews wmsOdsEmStorageNews=new WmsOdsEmStorageNews();
wmsOdsEmStorageNews.setWhCode(wmsRawOrderInSn.getWhCode());//仓库编码
wmsOdsEmStorageNews.setWlCode(wmsRawOrderInSn.getWlCode());//库位编码
wmsOdsEmStorageNews.setMaterialCode(wmsRawOrderInSn.getMaterialCode());
wmsOdsEmStorageNews.setAmount(wmsRawOrderInSn.getAmount());
wmsOdsEmStorageNews.setWhCode(wmsOdsMateStorageNewsSn.getWhCode());//仓库编码
wmsOdsEmStorageNews.setWlCode(wmsOdsMateStorageNewsSn.getWlCode());//库位编码
wmsOdsEmStorageNews.setMaterialCode(wmsOdsMateStorageNewsSn.getMaterialCode());
wmsOdsEmStorageNews.setAmount(wmsOdsMateStorageNewsSn.getAmount());
wmsOdsMateStorageNewsSnMapper.updatekdd(wmsOdsEmStorageNews);
wmsOdsMateStorageNewsSn.setUserDefined1("1");
wmsOdsMateStorageNewsSnMapper.updateWmsOdsMateStorageNewsSn(wmsOdsMateStorageNewsSn);
return wcsdto;
}

@ -210,7 +210,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{storageId}
</foreach>
</delete>
<select id="selectByWhCodeAndMate">
<select id="selectByWhCodeAndMate" resultMap="WmsOdsMateStorageNewsResult">
select storage_id, wh_code, region_code, wa_code, storage_type, wl_code, material_code, material_desc, amount, storage_amount, occupy_amount, lpn, product_batch, receive_date, product_date, user_defined1, user_defined2, user_defined3, user_defined4, user_defined5, user_defined6, user_defined7, user_defined8, user_defined9, user_defined10, create_by, gmt_create, last_modified_by, gmt_modified, active_flag, factory_code, sap_factory_code, wl_name from wms_ods_mate_storage_news
where wh_code=#{whCode} and wl_code=#{wlCode} and material_code=#{materialCode}
</select>
<select id="selectBaseProductByCode" resultMap="WmsOdsMateStorageNewsResult">
select DISTINCT material_desc,user_defined1
from wms_ods_mate_storage_news where material_code=#{sku}
</select>
</mapper>

@ -205,4 +205,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectWmsOdsMateStorageNewsSnVo"/>
where mate_order_in_sn_id = #{mateOrderInSnId}
</select>
<select id="selectwmsRfidNotwo" parameterType="WmsOdsMateStorageNewsSn" resultMap="WmsOdsMateStorageNewsSnResult">
<include refid="selectWmsOdsMateStorageNewsSnVo"/>
WHERE
sn =#{ rfidNo }
AND active_flag = '1'
AND User_Defined1 IS NULL
</select>
</mapper>

@ -193,18 +193,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
active_flag='1'
and user_defined1='1'
</select>
<select id="selectwmsRfidNotwo" parameterType="com.op.wms.domain.WmsToWCSDTO" resultMap="WmsRawOrderInSnResult">
<include refid="selectWmsRawOrderInSnVo"/>
where
sn=#{rfidNo}
and
active_flag='1'
and user_defined1='2'
</select>
<update id="updateU1Byid">
update wms_raw_order_in_sn
set
user_defined1 = '2'
where raw_order_in_sn_id=#{rawOrderInSnId}
</update>
</mapper>

Loading…
Cancel
Save