Merge remote-tracking branch 'origin/master'

# Conflicts:
#	op-modules/op-open/src/main/java/com/op/open/service/impl/OpenServiceImpl.java
master
Yangwl 1 year ago
commit 3b8717318b

@ -1,29 +1,58 @@
package com.op.system.api.domain.dto;
import com.op.system.api.domain.quality.QcCheckTaskDTO;
import java.util.List;
public class BoardDTO {
private String factory;
private String ymd;
private String equCode;
private String equName;
private Integer totalNum;
private String equTypeCode;
private String equTypeName;
private String shiftId;
private String factoryCode;
private String equipmentTypeCode;
private String planProduction;
private String actProduction;
private List<String> plans;
private List<String> acts;
private List<String> days;
private String startTime;
private String endTime;
private String productName;
private String productCode;
private String workorderCodeSap;
private String unit;
private String factory;
private String ymd;
private String equCode;
private String equName;
private Integer totalNum;
private String equTypeCode;
private String equTypeName;
private String shiftId;
private String factoryCode;
private String equipmentTypeCode;
private String planProduction;
private String actProduction;
private List<String> plans;
private List<String> acts;
private List<String> days;
private String startTime;
private String endTime;
private String productName;
private String productCode;
private String workorderCodeSap;
private String unit;
private String taskSampleNum;
private String taskNum;
private List<QcCheckTaskDTO> checkList;
public List<QcCheckTaskDTO> getCheckList() {
return checkList;
}
public void setCheckList(List<QcCheckTaskDTO> checkList) {
this.checkList = checkList;
}
public String getTaskSampleNum() {
return taskSampleNum;
}
public void setTaskSampleNum(String taskSampleNum) {
this.taskSampleNum = taskSampleNum;
}
public String getTaskNum() {
return taskNum;
}
public void setTaskNum(String taskNum) {
this.taskNum = taskNum;
}
public String getWorkorderCodeSap() {
return workorderCodeSap;

@ -50,6 +50,17 @@ public class wmsReportWork extends BaseEntity {
private String unit;
private String SAPstatus;
private String SAPmessage;
/** 生产工单编码 */
private String SAPquantity;
public String getSAPquantity() {
return SAPquantity;
}
public void setSAPquantity(String SAPquantity) {
this.SAPquantity = SAPquantity;
}
public String getSAPstatus() {
return SAPstatus;

@ -57,4 +57,17 @@ public class MesBoardController extends BaseController {
}
return success(iMesBoradService.getProductionLineInfo(mesBoard));
}
/**工单详情**/
@PostMapping("/getPorOrderList")
public AjaxResult getPorOrderList(@RequestBody BoardDTO mesBoard) {
if (StringUtils.isBlank(mesBoard.getFactoryCode())) {
return error("[factoryCode] 不能为空");
}
if (StringUtils.isBlank(mesBoard.getEquCode())) {
return error("[equCode] 不能为空");
}
return success(iMesBoradService.getPorOrderList(mesBoard));
}
}

@ -21,6 +21,7 @@ import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.datasource.creator.DynamicDatasourceCreator;
import com.op.mes.domain.*;
import com.op.mes.domain.dto.LineChartDto;
import com.op.mes.domain.dto.LineChartSeriesDto;
import com.op.mes.domain.dto.SysFactoryDto;
import com.op.system.api.domain.DataSourcePropertyDTO;
import com.op.system.api.domain.SysUser;
@ -249,12 +250,28 @@ public class MesReportWorkController extends BaseController {
return mesReportWorkService.getWorkcenterList(mesDailyReport);
}
/**首页柱状图**/
/**首页柱状图(产品太多了,有点乱,不用了)**/
@GetMapping("/getLineChartData")
public LineChartDto getLineChartData(MesReportProduction mesReportProduction) {
return mesReportWorkService.getLineChartData(mesReportProduction);
}
/**首页-各线体当日计划产量(横向柱状图)**/
@PostMapping("/getLineProData")
public List<MesReportWork> getLineProData(MesReportWork dto) {
return mesReportWorkService.getLineProData(dto);
}
/**当月各日实际产量(单折线图)**/
@GetMapping("/getMonthProData")
public LineChartDto getMonthProData(MesReportProduction mesReportProduction) {
return mesReportWorkService.getMonthProData(mesReportProduction);
}
/**首页-当日产品产量(饼图)**/
@PostMapping("/getProductProData")
public List<MesReportWork> getProductProData(MesReportWork dto) {
return mesReportWorkService.getProductProData(dto);
}
/**
*

@ -12,6 +12,15 @@ public class LineChartDto {
private List<String> seriesNames;
private List<String> xAxisDatas;
private List<LineChartSeriesDto> seriesDatas;
private List<String> yDatas;
public List<String> getyDatas() {
return yDatas;
}
public void setyDatas(List<String> yDatas) {
this.yDatas = yDatas;
}
public List<String> getSeriesNames() {
return seriesNames;

@ -3,6 +3,7 @@ package com.op.mes.mapper;
import com.op.common.core.domain.BaseFileData;
import com.op.mes.domain.MesBoard;
import com.op.mes.domain.MesReportWork;
import com.op.mes.domain.ProOrderWorkorder;
import com.op.mes.domain.dto.BaseEquipmentDto;
import com.op.mes.domain.dto.LGInfoDto;
import com.op.system.api.domain.SysDept;
@ -10,6 +11,7 @@ import com.op.system.api.domain.SysSapLog;
import com.op.system.api.domain.dto.BoardDTO;
import com.op.system.api.domain.dto.WCSDTO;
import com.op.system.api.domain.dto.WCSDataItemsDTO;
import com.op.system.api.domain.quality.QcCheckTaskDTO;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -83,4 +85,10 @@ public interface MesMapper {
BoardDTO getWorkOrder(BoardDTO boardDTO);
@MapKey("productDate")
Map<String, MesReportWork> getProduction15DaysAct(BoardDTO boardDTO);
QcCheckTaskDTO getTaskInfo(BoardDTO boardDTO);
List<QcCheckTaskDTO> getCheckList(BoardDTO boardDTO);
List<ProOrderWorkorder> getPorOrderList(BoardDTO boardDTO);
}

@ -5,6 +5,7 @@ import java.util.List;
import java.util.Map;
import com.op.mes.domain.*;
import com.op.mes.domain.dto.LineChartSeriesDto;
import com.op.mes.domain.dto.SysFactoryDto;
import com.op.system.api.domain.SysUser;
import com.op.system.api.domain.device.EquEquipmentDTO;
@ -88,6 +89,9 @@ public interface MesReportWorkMapper {
@MapKey("nameDate")
Map<String, MesReportProduction> getLineChartsDatas(MesReportProduction mesReportProduction);
@MapKey("name")
Map<String, MesReportProduction> getDayOfMonthDatas(MesReportProduction mesReportProduction);
List<String> getLineChartsNames(MesReportProduction mesReportProduction);
@MapKey("equCodeHour")
@ -147,4 +151,8 @@ public interface MesReportWorkMapper {
void updateReportRemark(@Param("list") List<MesReportWork> mesReportWork);
BigDecimal getReportRate(String productCode);
List<MesReportWork> getLineProData(MesReportWork dto);
List<MesReportWork> getProductProData(MesReportWork dto);
}

@ -1,6 +1,7 @@
package com.op.mes.service;
import com.op.common.core.web.domain.AjaxResult;
import com.op.mes.domain.ProOrderWorkorder;
import com.op.system.api.domain.dto.BoardDTO;
import java.util.List;
@ -13,4 +14,6 @@ public interface IMesBoradService {
public BoardDTO getProduction15Days(BoardDTO mesBoard);
public Map<String,BoardDTO> getProductionLineInfo(BoardDTO mesBoard);
public List<ProOrderWorkorder> getPorOrderList(BoardDTO mesBoard);
}

@ -7,6 +7,7 @@ import com.op.common.core.domain.R;
import com.op.common.core.web.domain.AjaxResult;
import com.op.mes.domain.*;
import com.op.mes.domain.dto.LineChartDto;
import com.op.mes.domain.dto.LineChartSeriesDto;
import com.op.mes.domain.dto.SysFactoryDto;
import com.op.system.api.domain.SysUser;
import com.op.system.api.domain.device.EquEquipmentDTO;
@ -115,4 +116,10 @@ public interface IMesReportWorkService {
int deleteBomRowNow(String id);
List<MesReportWorkConsume> getWarehouseList(MesReportWorkConsume workConsume);
List<MesReportWork> getLineProData(MesReportWork dto);
List<MesReportWork> getProductProData(MesReportWork dto);
LineChartDto getMonthProData(MesReportProduction mesReportProduction);
}

@ -358,6 +358,12 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
if(sHzWorks==null){
return R.fail("未查询到一层报工单");
}
//查询base_product的report_rate//单层项向sap报工的数量=上位机报工数量*报工汇率
BigDecimal reportRate = mesReportWorkMapper.getReportRate(workOrders.get(0).getProductCode());
if(reportRate != null){
BigDecimal newQuantity = sHzWorks.getQuantityFeedback().multiply(reportRate);
sHzWorks.setQuantityFeedback(newQuantity);
}
//机器=sum(工时数) 【设备开机时间】 Sac1
//人工 = sum每批的工时数*每批用人数) Sac2
//子工单报工

@ -1,15 +1,19 @@
package com.op.mes.service.impl;
import com.alibaba.fastjson2.JSONObject;
import com.alibaba.nacos.common.utils.CollectionUtils;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.StringUtils;
import com.op.common.core.web.domain.AjaxResult;
import com.op.mes.domain.MesReportWork;
import com.op.mes.domain.ProOrderWorkorder;
import com.op.mes.mapper.MesMapper;
import com.op.mes.service.IMesBoradService;
import com.op.system.api.domain.dto.BoardDTO;
import com.op.system.api.domain.mes.ProOrderWorkorderDTO;
import com.op.system.api.domain.quality.QcCheckTaskDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -103,11 +107,40 @@ public class MesBoradServiceImpl implements IMesBoradService {
BoardDTO workOrder = mesMapper.getWorkOrder(boardDTO);
dtoMap.put("workOrder",workOrder);
QcCheckTaskDTO taskDTO = mesMapper.getTaskInfo(boardDTO);
BoardDTO task2 = new BoardDTO();
if(taskDTO.getQuality() != null){
task2.setTaskNum(taskDTO.getQuality().toString());
}else{
task2.setTaskNum("0");
}
dtoMap.put("taskNum",task2);//巡检次数
BoardDTO task3 = new BoardDTO();
if(taskDTO.getSampleQuality() != null){
task3.setTaskSampleNum(taskDTO.getSampleQuality().toString());
}else{
task3.setTaskSampleNum("0");
}
dtoMap.put("taskSampleNum",task3);//巡检抽样数量
BoardDTO task4 = new BoardDTO();
List<QcCheckTaskDTO> checkList = mesMapper.getCheckList(boardDTO);
if(!CollectionUtils.isEmpty(checkList)){
task4.setCheckList(checkList);
}
dtoMap.put("piedata",task4);//巡检结果
return dtoMap;
}
@Override
public List<ProOrderWorkorder> getPorOrderList(BoardDTO boardDTO) {
DynamicDataSourceContextHolder.push(boardDTO.getFactoryCode());
List<ProOrderWorkorder> dtos = mesMapper.getPorOrderList(boardDTO);
return dtos;
}
//获取当前日期前几天
private List<String> getDays(int dayNum){
List<String> days = new ArrayList<>();

@ -356,8 +356,14 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService {
.setScale(2, BigDecimal.ROUND_HALF_UP);
dto.setCompleteRate(completeRate.toString()+"%");
//工时标准=盒量/标准数量
BigDecimal workTimeStandar = new BigDecimal(dto.getQuantityAct())
.divide(new BigDecimal(dto.getIei()),1, BigDecimal.ROUND_UP);
BigDecimal workTimeStandar = null;
if(StringUtils.isNotBlank(dto.getIei())){
workTimeStandar = new BigDecimal(dto.getQuantityAct())
.divide(new BigDecimal(dto.getIei()),1, BigDecimal.ROUND_UP);
}else{
workTimeStandar = new BigDecimal("0");
}
dto.setWorkTimeStandar(workTimeStandar.toString());
//工时产线效率=工时标准/工时实际
BigDecimal productivity = new BigDecimal(dto.getWorkTimeStandar())
@ -458,6 +464,54 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService {
lineChartDto.setSeriesDatas(seriesDatas);
return lineChartDto;
}
@Override
@DS("#header.poolName")
public List<MesReportWork> getLineProData(MesReportWork dto) {
List<MesReportWork> dtos = mesReportWorkMapper.getLineProData(dto);
return dtos;
}
@Override
@DS("#header.poolName")
public List<MesReportWork> getProductProData(MesReportWork dto) {
List<MesReportWork> dtos = mesReportWorkMapper.getProductProData(dto);
return dtos;
}
@Override
@DS("#header.poolName")
public LineChartDto getMonthProData(MesReportProduction mesReportProduction) {
LineChartDto lineChartDto = new LineChartDto();
Calendar calendar = Calendar.getInstance();
Date now = calendar.getTime();
calendar.set(Calendar.DAY_OF_MONTH, 1);
Date firstDayOfMonth = calendar.getTime();
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
String startTime = dateFormat.format(firstDayOfMonth);
String endTime = dateFormat.format(now);
mesReportProduction.setProductDateStart(startTime);
mesReportProduction.setProductDateEnd(endTime);
//日期名称数组
List<String> xAxisDatas = getDays(startTime,endTime);
lineChartDto.setxAxisDatas(xAxisDatas);
Map<String,MesReportProduction> productdatas = mesReportWorkMapper.getLineChartsDatas(mesReportProduction);
//值
List<String> datas = new ArrayList<>();
for(String dayStr:xAxisDatas) {
MesReportProduction data0 = productdatas.get(dayStr);
if (data0 != null) {
datas.add(data0.getQuantity());
} else {
datas.add("0");
}
}
lineChartDto.setyDatas(datas);
return lineChartDto;
}
@DS("#header.poolName")
@Override
public List<HashMap> getHourProductionList(MesHourReport mesHourReport) {

@ -301,6 +301,7 @@
where pow.del_flag='0'
and pow.workorder_name = #{equCode}
and CONVERT(DATE, pow.product_date) BETWEEN DATEADD(DAY, -15, CONVERT(DATE, GETDATE())) AND CONVERT(DATE, GETDATE())
and pow.parent_order='0'
group by pow.product_date
</select>
<select id="getProduction15DaysAct" resultType="com.op.mes.domain.MesReportWork">
@ -311,6 +312,7 @@
where mrw.del_flag='0' and pow.del_flag='0' and mrw.parent_order = '0'
and pow.workorder_name = #{equCode}
and CONVERT(DATE, pow.product_date) BETWEEN DATEADD(DAY, -15, CONVERT(DATE, GETDATE())) AND CONVERT(DATE, GETDATE())
and pow.parent_order='0'
group by pow.product_date
</select>
<select id="getWorkOrder" resultType="com.op.system.api.domain.dto.BoardDTO">
@ -328,5 +330,43 @@
and CONVERT ( DATE, pow.product_date ) = CONVERT ( DATE, GETDATE( ) )
and pow.parent_order = '0' and pow.del_flag='0'
</select>
<select id="getTaskInfo" resultType="com.op.system.api.domain.quality.QcCheckTaskDTO">
select count(0) quality,
sum(sample_quality) sampleQuality
from qc_check_task
where check_type = 'checkTypeSCXJ' and del_flag = '0'
and check_loc = #{equCode}
and CONVERT(varchar(10),create_time, 120) = CONVERT(varchar(10),GETDATE(), 120)
</select>
<select id="getCheckList" resultType="com.op.system.api.domain.quality.QcCheckTaskDTO">
select count(0) quality,
case when check_result='Y' then '合格'
when check_result='N' then '不合格'
else check_result end checkResult
from qc_check_task
where check_type = 'checkTypeSCXJ' and del_flag = '0'
and check_loc = #{equCode}
and CONVERT(varchar(10),create_time, 120) = CONVERT(varchar(10),GETDATE(), 120)
and check_result is not null
group by check_result
</select>
<select id="getPorOrderList" resultType="com.op.mes.domain.ProOrderWorkorder">
select pow.workorder_code_sap workorderCodeSap,
pow.product_name productName,
powb.batch_code batchCode,
powb.batch_quantity quantitySplit,
t.quantityFeedback quantityProduced
from pro_order_workorder pow
left join pro_order_workorder_batch powb on powb.workorder_id = pow.workorder_id
left join (
select workorder_code,batch,sum(quantity_feedback) quantityFeedback from mes_report_work
where CONVERT(varchar(10),feedback_time, 120) = CONVERT(varchar(10),GETDATE(), 120)
and del_flag = '0'
group by workorder_code,batch
)t on pow.workorder_code = t.workorder_code and powb.batch_code = t.batch
where pow.del_flag = '0' and CONVERT(varchar(10),pow.product_date, 120) = CONVERT(varchar(10),GETDATE(), 120)
and pow.workorder_name = #{equCode} and pow.parent_order ='0' and powb.del_flag = '0'
order by powb.batch_code
</select>
</mapper>

@ -294,7 +294,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sum(mrw.quantity) quantity
from(
select
product_name+CONVERT(varchar(10),feedback_time, 120) nameDate,
CONVERT(varchar(10),feedback_time, 120) nameDate,
product_code productCode,
product_name productName,
CONVERT(varchar(10),feedback_time, 120) feedbackTime,
@ -303,10 +303,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where
CONVERT(varchar(10),feedback_time, 120) >= #{productDateStart}
and #{productDateEnd} >= CONVERT(varchar(10),feedback_time, 120)
and parent_order = '0'
and parent_order = '0' and del_flag = '0'
)mrw
group by mrw.nameDate,mrw.productCode,mrw.productName,mrw.feedbackTime
</select>
<select id="getDayOfMonthDatas" resultType="com.op.mes.domain.MesReportProduction">
select mrw.nameDate,
mrw.feedbackTime,
sum(mrw.quantity) quantity
from(
select
CONVERT(varchar(10),feedback_time, 120) nameDate,
CONVERT(varchar(10),feedback_time, 120) feedbackTime,
quantity_feedback quantity
from mes_report_work
where
CONVERT(varchar(10),feedback_time, 120) >= #{productDateStart}
and #{productDateEnd} >= CONVERT(varchar(10),feedback_time, 120)
and parent_order = '0' and del_flag = '0'
)mrw
group by mrw.nameDate,mrw.feedbackTime
</select>
<select id="getLineChartsNames" resultType="java.lang.String">
select
distinct mrw.product_name productName
@ -529,7 +546,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
<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>
<if test="orderCode != null and orderCode != ''"> and pow.workorder_code_sap like concat('%', #{orderCode}, '%')</if>
<if test="workorderCode != null and workorderCode != ''"> and pow.workorder_code like concat('%', #{workorderCode}, '%')</if>
</where>
order by pow.product_date desc
</select>
@ -701,6 +719,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where product_code = #{productCode}
and del_flag = '0'
</select>
<select id="getLineProData" resultType="com.op.mes.domain.MesReportWork">
select * from(
select pow.workorder_name,
sum(pow.quantity_split) quantitySplit,
be.equipment_name machineName
from pro_order_workorder pow
left join base_equipment be on be.equipment_code = pow.workorder_name
where CONVERT(varchar(10),pow.product_date, 120) = #{productDate} and pow.parent_order = '0' and pow.del_flag='0' and pow.workorder_name is not null
GROUP BY pow.workorder_name,be.equipment_name
) t
order by t.quantitySplit desc
</select>
<select id="getProductProData" resultType="com.op.mes.domain.MesReportWork">
select pow.product_code productCode,
sum(pow.quantity_split) quantitySplit,
pow.product_name productName
from pro_order_workorder pow
where CONVERT(varchar(10),pow.product_date, 120) = CONVERT(DATE, GETDATE()) and pow.parent_order = '0' and pow.del_flag='0'
GROUP BY pow.product_code,pow.product_name
</select>
<insert id="insertMesReportWork" parameterType="MesReportWork">
insert into mes_report_work

@ -95,7 +95,6 @@ public class OpenController extends BaseController {
@PostMapping(value = "/createCheckProduceTask")
public AjaxResult createCheckProduceTask(@RequestBody QcCheckTaskProduceDTO qcCheckTaskProduce) {
if (StringUtils.isBlank(qcCheckTaskProduce.getOrderNo())) {
return error("[orderNo]不能为空");
}

@ -11,6 +11,7 @@ import com.op.system.api.domain.quality.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
/**
@ -82,5 +83,7 @@ public interface OpenMapper {
public int addCheckUsers(@Param("list") List<QcUserMaterialDTO> users);
String getSampNum(QcCheckTaskProduceDTO sampQua);
Date getLastTask(QcCheckTaskProduceDTO qcCheckTaskProduce);
}

@ -19,12 +19,6 @@ import com.op.system.api.domain.dto.WCSDataDTO;
import com.op.system.api.domain.mes.ProRfidProcessDetail;
import com.op.system.api.domain.quality.*;
import org.apache.commons.lang.StringUtils;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.time.LocalDateTime;
import java.time.Duration;
import org.slf4j.Logger;
@ -309,16 +303,12 @@ public class OpenServiceImpl implements OpenService {
public int insertQcCheckTaskProduce(QcCheckTaskProduceDTO qcCheckTaskProduce) {
DynamicDataSourceContextHolder.push("ds_" + qcCheckTaskProduce.getFactoryCode());
// 创建两个日期时间对象
// LocalDateTime dateTime1 = LocalDateTime.of(2023, 1, 1, 10, 30); // 2023年1月1日 10:30
// LocalDateTime dateTime2 = LocalDateTime.now(); // 2023年1月2日 11:45
// // 计算分钟差
// long minutesBetween = Duration.between(dateTime1, dateTime2).toMinutes();
// if(minutesBetween<=1){
// logger.info("++++++++++++检验任务1分钟内生成过不再重复创建++++++++++++++");
// return 0;
// }
// 1分钟不允许存在两条
Date lastData = openMapper.getLastTask(qcCheckTaskProduce);
if(this.oneMinHas(lastData)){
logger.info("【重复创建首检任务】orderNo:"+qcCheckTaskProduce.getOrderNo()+";"+"incomeBatchNo:"+qcCheckTaskProduce.getIncomeBatchNo());
return 0;
}
qcCheckTaskProduce.setCreateTime(DateUtils.getNowDate());
@ -428,11 +418,7 @@ public class OpenServiceImpl implements OpenService {
String requestName = paramMap.get("requestName").toString();
String workflowId = paramMap.get("workflowId").toString();
String mainObject = paramMap.get("mainObject").toString();
// String postData = "user=" + user +
// "&requestLevel=" + requestLevel +
// "&requestName=" + requestName +
// "&workflowId=" + workflowId +
// "&mainObject=" + mainObject;
// Building the postData string using StringBuilder
StringBuilder postDataBuilder = new StringBuilder();
@ -443,11 +429,10 @@ public class OpenServiceImpl implements OpenService {
.append("&mainObject=").append(URLEncoder.encode(mainObject, StandardCharsets.UTF_8.toString()));
if (Constants.WORKFLOWID_ZL0020.equals(workflowId)) {
String details = paramMap.get("details").toString();
// postData += "&details=" + details;
postDataBuilder.append("&details=").append(URLEncoder.encode(details, StandardCharsets.UTF_8.toString()));
}
String postData = postDataBuilder.toString();
String result=HttpUtils.sendPostOA(oa_url,postData);
String result = HttpUtils.sendPostOA(oa_url, postData);
logger.info(result);
//返回示例{"result":"0","info":"成功","requestid":"2193799"}
Map resultMap=JSONObject.parseObject(result);
@ -516,4 +501,35 @@ public class OpenServiceImpl implements OpenService {
}
}
protected Boolean oneMinHas(Date lastData){
if(lastData != null){
int year= Integer.parseInt(String.format("%tY", lastData));
int mon= Integer.parseInt(String .format("%tm", lastData));
int day= Integer.parseInt(String .format("%td", lastData));
int h= Integer.parseInt(String .format("%tH", lastData));
int m= Integer.parseInt(String .format("%tM", lastData));
LocalDateTime dateTime1 = LocalDateTime.of(year, mon, day, h, m); // 2023年1月1日 10:30
LocalDateTime dateTime2 = LocalDateTime.now(); // 2023年1月2日 11:45
// 计算分钟差
long minutesBetween = Duration.between(dateTime1, dateTime2).toMinutes();
if(minutesBetween<=1){
logger.info("++++++++++++检验任务1分钟内生成过不再重复创建++++++++++++++");
return true;
}
}
return false;
}
public static void main(String args[]){
// 创建两个日期时间对象
LocalDateTime dateTime1 = LocalDateTime.of(2024, 4, 18, 9, 33); // 2023年1月1日 10:30
LocalDateTime dateTime2 = LocalDateTime.now(); // 2023年1月2日 11:45
// 计算分钟差
long minutesBetween = Duration.between(dateTime1, dateTime2).toMinutes();
if(minutesBetween<=1){
System.out.println("++++++++++++检验任务1分钟内生成过不再重复创建++++++++++++++");
}
}
}

@ -207,6 +207,13 @@
where end_value>= #{quality} and #{quality}>=start_value and del_flag = '0'
and check_type = #{checkType}
</select>
<select id="getLastTask" resultType="java.util.Date">
select max(create_time) from qc_check_task
where check_type = #{checkType}
and order_no= #{orderNo}
and income_batch_no = #{incomeBatchNo}
and del_flag='0'
</select>
<insert id="insertEquRepairOrder" parameterType="DeviceRepairOrder">
insert into equ_repair_order

@ -285,19 +285,19 @@ public class ProOrderServiceImpl implements IProOrderService {
//20231127,加入belongWorkOrder概念
belongWorkOrder = workOrder.getWorkorderCode();
//推送sap订单更新信息
SapShopOrderQuery sapChange = new SapShopOrderQuery();
sapChange.setAufnr(proOrder.getOrderCode());//母订单号
BigDecimal newSapQuantityNum = new BigDecimal(proOrder.getQuantity())
.subtract(new BigDecimal(proOrder.getQuantitySplit()));
sapChange.setQuantity(newSapQuantityNum.toString());//母订单新数量
logger.info("【成品订单拆分】母订单"+proOrder.getOrderCode()+
"订单数量变更:修改前"+proOrder.getQuantity()+","+
",已拆数量"+proOrder.getQuantitySplit()+","+
"给sap汇报数量"+newSapQuantityNum.toString());
R rSapChange = remoteSapService.shopUpdateSync(sapChange);//sap只能同步指定日期的数据
logger.info("母订单"+proOrder.getOrderCode()+
"订单数量变更结果:"+rSapChange.getCode()+","+rSapChange.getMsg());
// //推送sap订单更新信息
// SapShopOrderQuery sapChange = new SapShopOrderQuery();
// sapChange.setAufnr(proOrder.getOrderCode());//母订单号
// BigDecimal newSapQuantityNum = new BigDecimal(proOrder.getQuantity())
// .subtract(new BigDecimal(proOrder.getQuantitySplit()));
// sapChange.setQuantity(newSapQuantityNum.toString());//母订单新数量
// logger.info("【成品订单拆分】母订单"+proOrder.getOrderCode()+
// "订单数量变更:修改前"+proOrder.getQuantity()+","+
// ",已拆数量"+proOrder.getQuantitySplit()+","+
// "给sap汇报数量"+newSapQuantityNum.toString());
// R rSapChange = remoteSapService.shopUpdateSync(sapChange);//sap只能同步指定日期的数据
// logger.info("母订单"+proOrder.getOrderCode()+
// "订单数量变更结果:"+rSapChange.getCode()+","+rSapChange.getMsg());
}
workOrder.setProductCode(productNameInfo.getProdCode());
workOrder.setProductName(productNameInfo.getProdDesc());

@ -82,14 +82,14 @@ public class QcCheckTaskIncomeController extends BaseController {
public TableDataInfo list(QcCheckTaskIncome qcCheckTaskIncome) {
//默认时间范围T 00:00:00~T+1 00:00:00
if (StringUtils.isEmpty(qcCheckTaskIncome.getIncomeTimeStart())) {
/*if (StringUtils.isEmpty(qcCheckTaskIncome.getIncomeTimeStart())) {
qcCheckTaskIncome.setIncomeTimeStart(DateUtils.getDate() + " 00:00:00");//start
LocalDate date = LocalDate.now();
LocalDate dateEnd = date.plusDays(1);
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
String dateEndStr = dtf.format(dateEnd) + " 00:00:00";
qcCheckTaskIncome.setIncomeTimeEnd(dateEndStr);//end
}
}*/
// if(StringUtils.isEmpty(qcCheckTaskIncome.getCheckTimeStart())){
// qcCheckTaskIncome.setCheckTimeStart(qcCheckTaskIncome.getIncomeTimeStart());//start
@ -110,14 +110,14 @@ public class QcCheckTaskIncomeController extends BaseController {
public void export(HttpServletResponse response, QcCheckTaskIncome qcCheckTaskIncome) {
//默认时间范围T 00:00:00~T+1 00:00:00
if (StringUtils.isEmpty(qcCheckTaskIncome.getIncomeTimeStart())) {
/*if (StringUtils.isEmpty(qcCheckTaskIncome.getIncomeTimeStart())) {
qcCheckTaskIncome.setIncomeTimeStart(DateUtils.getDate() + " 00:00:00");//start
LocalDate date = LocalDate.now();
LocalDate dateEnd = date.plusDays(1);
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
String dateEndStr = dtf.format(dateEnd) + " 00:00:00";
qcCheckTaskIncome.setIncomeTimeEnd(dateEndStr);//end
}
}*/
// if(StringUtils.isEmpty(qcCheckTaskIncome.getCheckTimeStart())){
// qcCheckTaskIncome.setCheckTimeStart(qcCheckTaskIncome.getIncomeTimeStart());//start

@ -46,14 +46,14 @@ public class QcCheckTaskInventoryController extends BaseController {
public TableDataInfo list(QcCheckTaskInventory qcCheckTaskInventory) {
//默认时间范围T 00:00:00~T+1 00:00:00
if (StringUtils.isEmpty(qcCheckTaskInventory.getIncomeTimeStart())) {
/*if (StringUtils.isEmpty(qcCheckTaskInventory.getIncomeTimeStart())) {
qcCheckTaskInventory.setIncomeTimeStart(DateUtils.getDate() + " 00:00:00");//start
LocalDate date = LocalDate.now();
LocalDate dateEnd = date.plusDays(1);
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
String dateEndStr = dtf.format(dateEnd) + " 00:00:00";
qcCheckTaskInventory.setIncomeTimeEnd(dateEndStr);//end
}
}*/
startPage();
List<QcCheckTaskInventory> list = qcCheckTaskInventoryService.selectQcCheckTaskInventoryList(qcCheckTaskInventory);
return getDataTable(list);

@ -39,14 +39,14 @@ public class QcCheckTaskMarketController extends BaseController {
public TableDataInfo list(QcCheckTaskMarket qcCheckTaskMarket) {
//默认时间范围T 00:00:00~T+1 00:00:00
if (StringUtils.isEmpty(qcCheckTaskMarket.getIncomeTimeStart())) {
/*if (StringUtils.isEmpty(qcCheckTaskMarket.getIncomeTimeStart())) {
qcCheckTaskMarket.setIncomeTimeStart(DateUtils.getDate() + " 00:00:00");//start
LocalDate date = LocalDate.now();
LocalDate dateEnd = date.plusDays(1);
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
String dateEndStr = dtf.format(dateEnd) + " 00:00:00";
qcCheckTaskMarket.setIncomeTimeEnd(dateEndStr);//end
}
}*/
startPage();
List<QcCheckTaskMarket> list = qcCheckTaskMarketService.selectQcCheckTaskMarketList(qcCheckTaskMarket);
return getDataTable(list);

@ -54,14 +54,14 @@ public class QcCheckTaskWarehousingController extends BaseController {
public TableDataInfo list(QcCheckTaskWarehousing qcCheckTaskWarehousing) {
startPage();
//默认时间范围T 00:00:00~T+1 00:00:00
if(StringUtils.isEmpty(qcCheckTaskWarehousing.getIncomeTimeStart())){
/*if(StringUtils.isEmpty(qcCheckTaskWarehousing.getIncomeTimeStart())){
qcCheckTaskWarehousing.setIncomeTimeStart(DateUtils.getDate()+" 00:00:00");//start
LocalDate date = LocalDate.now();
LocalDate dateEnd = date.plusDays(1);
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
String dateEndStr = dtf.format(dateEnd)+" 00:00:00";
qcCheckTaskWarehousing.setIncomeTimeEnd(dateEndStr);//end
}
}*/
List<QcCheckTaskWarehousing> list = qcCheckTaskWarehousingService.selectQcCheckTaskWarehousingList(qcCheckTaskWarehousing);
return getDataTable(list);
}
@ -74,14 +74,14 @@ public class QcCheckTaskWarehousingController extends BaseController {
@PostMapping("/export")
public void export(HttpServletResponse response, QcCheckTaskWarehousing qcCheckTaskWarehousing) {
//默认时间范围T 00:00:00~T+1 00:00:00
if(StringUtils.isEmpty(qcCheckTaskWarehousing.getIncomeTimeStart())){
/*if(StringUtils.isEmpty(qcCheckTaskWarehousing.getIncomeTimeStart())){
qcCheckTaskWarehousing.setIncomeTimeStart(DateUtils.getDate()+" 00:00:00");//start
LocalDate date = LocalDate.now();
LocalDate dateEnd = date.plusDays(1);
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
String dateEndStr = dtf.format(dateEnd)+" 00:00:00";
qcCheckTaskWarehousing.setIncomeTimeEnd(dateEndStr);//end
}
}*/
List<QcCheckTaskWarehousing> list = qcCheckTaskWarehousingService.selectQcCheckTaskWarehousingList(qcCheckTaskWarehousing);
ExcelUtil<QcCheckTaskWarehousing> util = new ExcelUtil<QcCheckTaskWarehousing>(QcCheckTaskWarehousing.class);
util.exportExcel(response, list, "成品入库检验任务数据");

@ -195,6 +195,9 @@ public class QuaController extends BaseController {
if(StringUtils.isBlank(qcCheckTaskIncome.getUpdateByName())){
return error("[updateByName]不能为空");
}
// if(StringUtils.isBlank(qcCheckTaskIncome.getCheckResult())){
// return error("[checkResult]不能为空");
// }
return toAjax(qcCheckTaskIncomeService.commitCheckResults(qcCheckTaskIncome));
}
/**

@ -29,6 +29,7 @@ public class QcCheckTaskIncome extends BaseEntity {
*/
@Excel(name = "检验任务编号")
private String checkNo;
private String orderCode;
private String workorderCode;
private String workorderCodeSap;
@ -196,6 +197,23 @@ public class QcCheckTaskIncome extends BaseEntity {
private String materialType;//来料类别
private String materialFrom;//物料来源
private String startOA;//发起oa 1是 0否
public String getOrderCode() {
return orderCode;
}
public void setOrderCode(String orderCode) {
this.orderCode = orderCode;
}
public String getStartOA() {
return startOA;
}
public void setStartOA(String startOA) {
this.startOA = startOA;
}
public String getOrderTypeDesc() {
return orderTypeDesc;

@ -110,6 +110,15 @@ public class QcCheckTypeProject extends BaseEntity {
private String checkTool;
private String checkMode;
private String unit;
private String weight;
public String getWeight() {
return weight;
}
public void setWeight(String weight) {
this.weight = weight;
}
public String getUnit() {
return unit;

@ -117,6 +117,69 @@ public class QcCheckUnqualified extends BaseEntity {
private Date startTime;
private String startOaStatus;
private String startOaMsg;
private String materialType;//来料类别
private String materialFrom;//物料来源
private String oaFactory;//oa厂区
private String czbjr;//仓储报检人
private String qczg;//QC主管
private String user;
private String sqr;
public String getSqr() {
return sqr;
}
public void setSqr(String sqr) {
this.sqr = sqr;
}
public String getUser() {
return user;
}
public void setUser(String user) {
this.user = user;
}
public String getQczg() {
return qczg;
}
public void setQczg(String qczg) {
this.qczg = qczg;
}
public String getCzbjr() {
return czbjr;
}
public void setCzbjr(String czbjr) {
this.czbjr = czbjr;
}
public String getOaFactory() {
return oaFactory;
}
public void setOaFactory(String oaFactory) {
this.oaFactory = oaFactory;
}
public String getMaterialType() {
return materialType;
}
public void setMaterialType(String materialType) {
this.materialType = materialType;
}
public String getMaterialFrom() {
return materialFrom;
}
public void setMaterialFrom(String materialFrom) {
this.materialFrom = materialFrom;
}
public String getStartOaMsg() {
return startOaMsg;

@ -5,6 +5,7 @@ import com.op.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
@ -75,6 +76,8 @@ public class QcDefectType extends BaseEntity {
private String createTimeEnd;
private String checkType;
private BigDecimal ratio;
public String getCheckType() {
return checkType;
}
@ -202,6 +205,14 @@ public class QcDefectType extends BaseEntity {
return delFlag;
}
public BigDecimal getRatio() {
return ratio;
}
public void setRatio(BigDecimal ratio) {
this.ratio = ratio;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -16,17 +16,13 @@ import com.op.common.core.web.domain.AjaxResult;
import com.op.common.security.utils.SecurityUtils;
import com.op.quality.domain.*;
import com.op.quality.mapper.*;
import com.op.quality.service.IQcCheckTaskDefectService;
import com.op.quality.service.IQcCheckTaskProduceService;
import com.op.quality.service.IQcCheckTaskUserService;
import com.op.system.api.RemoteOpenService;
import com.op.quality.service.*;
import com.op.system.api.domain.SysUser;
import com.op.system.api.domain.quality.QcUserMaterialDTO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.quality.service.IQcCheckTaskIncomeService;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.web.context.request.RequestContextHolder;
@ -70,8 +66,8 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
@Autowired
private IQcCheckTaskUserService qcCheckTaskUserService;
@Autowired
private RemoteOpenService remoteOpenService;
// @Autowired
// private RemoteOpenService remoteOpenService;
@Autowired
private QMSFileMapper qmsFileMapper;
@ -85,8 +81,8 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
@Autowired
private QcCheckTaskDefectMapper qcCheckTaskDefectMapper;
// @Autowired
// private QcCheckUnqualifiedService qcCheckUnqualifiedService;
@Autowired
private IQcCheckUnqualifiedService qcCheckUnqualifiedService;
/**
*
@ -447,11 +443,11 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
qcCheckTaskProduce.setCheckTime(DateUtils.getNowDate());
qcCheckTaskProduce.setCheckManCode(SecurityUtils.getUsername());
n = qcCheckTaskProduceMapper.updateQcCheckTaskProduce(qcCheckTaskProduce);
/**pro_order_workorder_batch-->qc_status->2**/
qcCheckTaskIncome.setStatus("2");
qcCheckUnqualifiedMapper.updateWorkOrderBatchStatus(qcCheckTaskIncome);
/**pro_order_workorder_batch-->首检qc_status->2**/
if("checkTypeSC".equals(qcCheckTaskIncome.getCheckType())){
qcCheckTaskIncome.setStatus("2");
qcCheckUnqualifiedMapper.updateWorkOrderBatchStatus(qcCheckTaskIncome);
}
}else if("product".equals(qcCheckTaskIncome.getTypeCode())){
QcCheckTaskWarehousing warehousing = new QcCheckTaskWarehousing();
warehousing.setCheckStatus("2");
@ -598,14 +594,22 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
String checkType = qcCheckTaskIncome.getCheckType();
qcCheckTaskIncome.setFactoryCode(qcCheckTaskIncome.getFactoryCode().replace("ds_",""));
//默认合格
String result = "Y";
for(QcCheckTaskDetail detail:details){
if("N".equals(detail.getStatus())){
result = "N";//不合格
break;
String result=null;
if(StringUtils.isBlank(qcCheckTaskIncome.getCheckResult())){
result = "Y";
for(QcCheckTaskDetail detail:details){
if("N".equals(detail.getStatus())){
result = "N";//不合格
break;
}
}
}else{
//有最终判定的情况
result = qcCheckTaskIncome.getCheckResult();
}
int n = 0;
QcCheckTaskIncome qcCheckTask = new QcCheckTaskIncome();
qcCheckTask.setUpdateBy(updateBy);
@ -613,6 +617,7 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
qcCheckTask.setCheckStatus("2");//检测状态0待检测1检测中2检测完成
qcCheckTask.setUpdateTime(nowTime);
qcCheckTask.setCheckTime(nowTime);
qcCheckTask.setRemark(qcCheckTaskIncome.getRemark());
qcCheckTask.setCheckResult(result);//检验结果Y合格 N不合格
qcCheckTask.setIncomeBatchNo(qcCheckTaskIncome.getIncomeBatchNo());
BigDecimal noOkQquality = new BigDecimal("0");
@ -690,6 +695,7 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
if("checkTypeSC".equals(qcCheckTaskIncome.getCheckType())){
/**pro_order_workorder_batch-->qc_status->2**/
qcCheckTaskIncome.setStatus("2");
qcCheckTaskIncome.setCheckResult(result);
qcCheckUnqualifiedMapper.updateWorkOrderBatchStatus(qcCheckTaskIncome);
}
if("checkTypeSC".equals(qcCheckTaskIncome.getCheckType())&&"N".equals(result)){
@ -732,8 +738,48 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
unqualified.setType(checkType);
n = qcCheckUnqualifiedMapper.insertQcCheckUnqualified(unqualified);
logger.info("qc_check_unqualified:" + n);
if("1".equals(qcCheckTaskIncome.getStartOA())){
//qcCheckUnqualifiedService.updateQcCheckUnqualified(qcCheckUnqualified);
unqualified.setTypeCode(qcCheckTaskIncome.getTypeCode());
//不合格描述
unqualified.setRemark(qcCheckTaskIncome.getRemark());
//厂区(小榄固定值)
unqualified.setOaFactory("0");
//来料类别
unqualified.setMaterialType(qcCheckTaskIncome.getMaterialType());
//物料来源
unqualified.setMaterialFrom(qcCheckTaskIncome.getMaterialFrom());
//物料编号
unqualified.setMaterialCode(qcCheckTaskIncome.getMaterialCode());
//物料名称
unqualified.setMaterialName(qcCheckTaskIncome.getMaterialName());
//供应商编码
unqualified.setSupplierCode(qcCheckTaskIncome.getSupplierCode());
//供应商名称
unqualified.setSupplierName(qcCheckTaskIncome.getSupplierName());
//供应商名称
unqualified.setSupplierName(qcCheckTaskIncome.getSupplierName());
//生产批号
unqualified.setIncomeBatchNo(qcCheckTaskIncome.getIncomeBatchNo());
//来料数量
unqualified.setQuality(qcCheckTaskIncome.getQuality().toString());
//来料单位
unqualified.setUnit(qcCheckTaskIncome.getUnit());
//检验编号
unqualified.setCheckNo(qcCheckTaskIncome.getCheckNo());
//仓储报检人-李爱娟
unqualified.setCzbjr("284");
//物料类别
unqualified.setMaterialType(qcCheckTaskIncome.getMaterialType());
//物料来源
unqualified.setMaterialFrom(qcCheckTaskIncome.getMaterialFrom());
//QC主管-朱继新
unqualified.setQczg("660");
//申请人-朱继新
unqualified.setSqr("660");
unqualified.setUser("660");
qcCheckUnqualifiedService.updateQcCheckUnqualified(unqualified);
}
}
return 1 ;
}

@ -106,7 +106,7 @@ public class QcCheckTaskWarehousingServiceImpl implements IQcCheckTaskWarehousin
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
//@Transactional(rollbackFor = Exception.class)不能加
public int insertQcCheckTaskWarehousing(QcCheckTaskWarehousing qcCheckTaskWarehousing) {
if(StringUtils.isNotBlank(qcCheckTaskWarehousing.getFactoryCode())){
@ -138,10 +138,12 @@ public class QcCheckTaskWarehousingServiceImpl implements IQcCheckTaskWarehousin
/**qc_material_group_detail**/
QcMaterialGroupDetail group = qcMaterialGroupDetailMapper.getGroupByMaterial(qcCheckTaskWarehousing.getMaterialCode());
if(group == null){
return 0;//没有找到检测项目
group = new QcMaterialGroupDetail();
group.setGroupId("3dc0655fea3449c59c76a01cc5b91565");//成品蚊香物料组
}
qctp.setGroupId(group.getGroupId());//共性
items = qcCheckTypeProjectMapper.getTPByTypeGroup(qctp);
List<QcCheckTaskDetail> itemsGG = qcCheckTypeProjectMapper.getTPByTypeGroup(qctp);
items.addAll(itemsGG);
}
/**qc_check_task_detail**/

@ -91,8 +91,9 @@ public class QcCheckUnqualifiedServiceImpl implements IQcCheckUnqualifiedService
//发起来料检验OA流程
AjaxResult oaR = new AjaxResult();
QcCheckUnqualified taskIfo = qcCheckUnqualifiedMapper.selectQcCheckUnqualifiedById(qcCheckUnqualified.getId());
taskIfo.setRemark(qcCheckUnqualified.getRemark());
QcCheckUnqualified taskIfo = qcCheckUnqualified;
// QcCheckUnqualified taskIfo = qcCheckUnqualifiedMapper.selectQcCheckUnqualifiedById(qcCheckUnqualified.getId());
// taskIfo.setRemark(qcCheckUnqualified.getRemark());
if("material".equals(taskIfo.getTypeCode())) {
//ZL0010-来料检验不合格控制流程
oaR = this.createLLOA(taskIfo);
@ -163,32 +164,45 @@ public class QcCheckUnqualifiedServiceImpl implements IQcCheckUnqualifiedService
}
/*OA
* CQ OEMCM LLLB 01MATNR MAKTX suppliernum
* supplier CHARG comeQty testDate JYBH
* SQR CQ OEMCM LLLB 01MATNR MAKTX suppliernum
* supplier CHARG comeQty DW testDate JYBH
* BJY OEMWLLY ZCF ZCOEMCM OEM
* memo PZGLBZG QC
* {"requestName":"ZL0010-来料检验不合格控制流程",
* "mainObject":"{\"SQR\":\"13127\",\"CQ\":0,\"LLLB\":0,\"MATNR\":\"000000040000015062\",
* \"MAKTX\":\"榄菊加大盘强力型蚊香(60装)现货纸箱(2201)\",\"suppliernum\":\"0000102951\",
* \"supplier\":\"广东高顺印刷包装有限公司\",\"CHARG\":\"null\",\"comeQty\":\"1117\",
* \"DW\":\"ST\",\"JYBH\":\"202404180042\",\"BJY\":\"202404180042\",\"WLLY\":\"2\",
* \"memo\":\"不合格\",\"PZGLBZG\":\"不合格\"}","user":"999999","requestLevel":0,"workflowId":26235}
*/
private AjaxResult createLLOA(QcCheckUnqualified task){
QcCheckTaskIncome detailInfo = qcCheckTaskIncomeMapper.getTaskInfo(task.getTaskId());
//QcCheckTaskIncome detailInfo = qcCheckTaskIncomeMapper.getTaskInfo(task.getTaskId());
//发起来料检验OA流程
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("user",SecurityUtils.getUsername());//提交人工号
paramMap.put("user",task.getUser());//提交人工号
paramMap.put("requestLevel",0);//流程紧急度
paramMap.put("requestName","ZL0010-来料检验不合格控制流程");//流程名称
paramMap.put("workflowId",26235);//该流程对应的唯- workFlowld
StringBuffer mainObject = new StringBuffer();
mainObject.append("{");
mainObject.append("\"CQ\":"+detailInfo.getFactoryCode());//厂区
mainObject.append(",\"LLLB\":"+0);//来料类别【0、1】
mainObject.append(",\"MATNR\":"+"\""+detailInfo.getMaterialCode()+"\"");//物料编码
mainObject.append(",\"MAKTX\":"+"\""+detailInfo.getMaterialName()+"\"");//物料名称
mainObject.append(",\"suppliernum\":"+"\""+detailInfo.getSupplierCode()+"\"");//供应商编码
mainObject.append(",\"supplier\":"+"\""+detailInfo.getSupplierName()+"\"");//供应商名称
mainObject.append(",\"CHARG\":"+"\""+detailInfo.getIncomeBatchNo()+"\"");//生产批号
mainObject.append(",\"comeQty\":"+"\""+detailInfo.getQuality()+"\"");//来料数量
mainObject.append(",\"memo\":"+"\""+task.getRemark()+"\"");//不合格情况描述
mainObject.append("\"SQR\":"+"\""+task.getSqr()+"\"");//申请人
mainObject.append(",\"CQ\":"+task.getOaFactory());//厂区
mainObject.append(",\"LLLB\":"+task.getMaterialType());//来料类别【0、1】
mainObject.append(",\"MATNR\":"+"\""+task.getMaterialCode()+"\"");//物料编码
mainObject.append(",\"MAKTX\":"+"\""+task.getMaterialName()+"\"");//物料名称
mainObject.append(",\"suppliernum\":"+"\""+task.getSupplierCode()+"\"");//供应商编码
mainObject.append(",\"supplier\":"+"\""+task.getSupplierName()+"\"");//供应商名称
mainObject.append(",\"CHARG\":"+"\""+task.getIncomeBatchNo()+"\"");//生产批号
mainObject.append(",\"comeQty\":"+"\""+task.getQuality()+"\"");//来料数量
mainObject.append(",\"DW\":"+"\""+task.getUnit()+"\"");//来料单位
mainObject.append(",\"JYBH\":"+"\""+task.getCheckNo()+"\"");//检验编码
mainObject.append(",\"BJY\":"+"\""+task.getCzbjr()+"\"");//仓储报检人
mainObject.append(",\"WLLY\":"+"\""+task.getMaterialFrom()+"\"");//物料来源
mainObject.append(",\"memo\":"+"\""+task.getRemark()+"\"");//不合格描述
mainObject.append(",\"PZGLBZG\":"+"\""+task.getQczg()+"\"");//qc主管
mainObject.append("}");
paramMap.put("mainObject",mainObject.toString());

@ -138,7 +138,7 @@ public class QcProCheckServiceImpl implements QcProCheckService {
@Override
public QcCheckTaskIncome getCheckTaskDetailList(QcCheckTaskDetail qcCheckTaskDetail) {
DynamicDataSourceContextHolder.push(qcCheckTaskDetail.getFactoryCode());
QcCheckTaskIncome dto = new QcCheckTaskIncome();
QcCheckTaskIncome dto = qcCheckTaskIncomeMapper.getTaskInfo(qcCheckTaskDetail.getBelongTo());
List<QcCheckTaskDetail> qcCheckTaskDetails = qcCheckTaskIncomeMapper.getCkeckProjectList(qcCheckTaskDetail);
/**qc_check_task_defect**/
Map<String,QcCheckTaskDefect> defectMap = qcCheckTaskDefectMapper.getDefectMap(qcCheckTaskDetail);

@ -304,6 +304,7 @@
<if test="bNoOkquality != null">bNoOkquality = #{bNoOkquality},</if>
<if test="cNoOkquality != null">cNoOkquality = #{cNoOkquality},</if>
<if test="incomeBatchNo != null">income_batch_no = #{incomeBatchNo},</if>
<if test="remark != null">remark = #{remark},</if>
check_result = #{checkResult},
update_by = #{updateBy},
update_time = #{updateTime}
@ -398,7 +399,8 @@
qct.check_time checkTime,
qct.check_result checkResult,
qct.income_time incomeTime,
qct.check_loc checkLoc
qct.check_loc checkLoc,
qct.remark
from qc_check_task qct
left join pro_order_workorder pow on pow.workorder_code = qct.order_no
where qct.record_id = #{recordId}

@ -434,8 +434,8 @@
left join base_equipment be on be.equipment_code = pow.workorder_name and be.equipment_type_code = 'equ_type_bzx'
where pow.del_flag = '0'
and pow.status = 'w2' and pow.parent_order = '0'
and (pow.product_date = CONVERT(varchar(10),GETDATE(), 120)
or pow.product_date = CONVERT(varchar(10),DATEADD(DAY, -1, GETDATE()), 120))
<!--and (pow.product_date = CONVERT(varchar(10),GETDATE(), 120)
or pow.product_date = CONVERT(varchar(10),DATEADD(DAY, -1, GETDATE()), 120))-->
</select>
<select id="getLastXJTask" resultType="com.op.quality.domain.QcCheckTaskProduce">
select top 1

@ -50,6 +50,10 @@
left join qc_check_type qc on qct.check_type = qc.order_code
left join qc_check_task_user qctu on qctu.belong_to = qct.record_id
where qct.check_status = '0' and qctu.check_man_code = #{checkManCode}
and (
CONVERT(varchar(10),qct.create_time, 120) = CONVERT(varchar(10),GETDATE(), 120)
or CONVERT(varchar(10),qct.create_time, 120) = CONVERT(varchar(10),DATEADD(DAY, -1, GETDATE()), 120)
)
group by qct.check_type,qc.check_name
union all
select '','',
@ -58,6 +62,10 @@
from qc_check_unqualified qcu
left join qc_check_task qct on qcu.task_id = qct.record_id
where qcu.status != '2' and qct.check_man_code = #{checkManCode}
and (
CONVERT(varchar(10),qct.create_time, 120) = CONVERT(varchar(10),GETDATE(), 120)
or CONVERT(varchar(10),qct.create_time, 120) = CONVERT(varchar(10),DATEADD(DAY, -1, GETDATE()), 120)
)
</select>
<insert id="insertQcCheckType" parameterType="QcCheckType">
insert into qc_check_type

@ -28,6 +28,7 @@
<result property="ruleName" column="rule_name"/>
<result property="sort" column="sort"/>
<result property="projectNo" column="project_no"/>
<result property="weight" column="weight"/>
</resultMap>
@ -40,28 +41,11 @@
<select id="selectQcCheckTypeProjectList" parameterType="QcCheckTypeProject" resultMap="QcCheckTypeProjectResult">
SELECT
ctp.id,
ctp.project_no,
ctp.project_id,
cp.rule_name,
cp.property_code,
cp.unit_code unit,
ctp.type_id,
ctp.standard_value,
ctp.upper_diff,
ctp.down_diff,
ctp.sample,
ctp.status,
ctp.create_by,
ctp.create_time,
ctp.update_by,
ctp.update_time,
ctp.factory_code,
ctp.del_flag,
ctp.group_id,
ctp.material_code,
ctp.sample_num,
ctp.sort
ctp.id,ctp.project_no,ctp.project_id,
cp.rule_name,cp.property_code,cp.unit_code unit,ctp.type_id,
ctp.standard_value,ctp.upper_diff,ctp.down_diff,ctp.sample,ctp.status,
ctp.create_by, ctp.create_time,ctp.update_by,ctp.update_time,
ctp.factory_code, ctp.del_flag,ctp.group_id,ctp.material_code,ctp.sample_num,ctp.sort
FROM qc_check_type_project ctp
LEFT JOIN qc_check_project cp ON ctp.project_id = cp.id
<where>
@ -85,26 +69,16 @@
<select id="selectQcCheckTypeProjectById" parameterType="String" resultMap="QcCheckTypeProjectResult">
SELECT
ctp.id,
ctp.project_id,
cp.rule_name,
cp.property_code,
ctp.type_id,
ctp.standard_value,
ctp.upper_diff,
ctp.down_diff,
ctp.sample,
ctp.status,
ctp.create_by,
ctp.create_time,
ctp.update_by,
ctp.update_time,
ctp.factory_code,
ctp.del_flag,
ctp.group_id,
ctp.material_code,
ctp.sample_num,
ctp.sort
ctp.id,ctp.project_id,
cp.rule_name,cp.property_code,
ctp.type_id,ctp.standard_value,
ctp.upper_diff,ctp.down_diff,
ctp.sample,ctp.status,
ctp.create_by,ctp.create_time,
ctp.update_by,ctp.update_time,
ctp.factory_code,ctp.del_flag,
ctp.group_id,ctp.material_code,
ctp.sample_num,ctp.sort,ctp.weight
FROM qc_check_type_project ctp
LEFT JOIN qc_check_project cp ON ctp.project_id = cp.id AND cp.del_flag = '0'
WHERE ctp.del_flag ='0' AND ctp.id = #{id}
@ -279,6 +253,7 @@
<if test="unit != null">unit = #{unit},</if>
<if test="propertyCode != null">property_code = #{propertyCode},</if>
<if test="sort != null">sort = #{sort},</if>
<if test="weight != null">weight = #{weight},</if>
</trim>
where id = #{id}
</update>

@ -284,7 +284,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where order_no = #{orderNo}
</update>
<update id="updateWorkOrderBatchStatus">
update pro_order_workorder_batch set qc_status = #{status} where batch_code = #{incomeBatchNo}
update pro_order_workorder_batch
set qc_status = #{status}
<if test="checkResult != null">
,qc_result = #{checkResult}
</if>
where batch_code = #{incomeBatchNo} and del_flag ='0'
and workorder_id in(select workorder_id from pro_order_workorder pow
where pow.belong_work_order = #{orderCode} and del_flag = '0')
</update>
<update id="updatePutStatus">
update wms_product_put set check_status = #{status} where batch_number = #{incomeBatchNo}

@ -19,12 +19,13 @@
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="ratio" column="ratio" />
</resultMap>
<sql id="selectQcDefectTypeVo">
select defect_id, defect_code, defect_type, defect_subclass, defect_remark,
factory_code, attr1, attr2, attr3,
del_flag, create_by, create_time, update_by, update_time
del_flag, create_by, create_time, update_by, update_time,ratio
from qc_defect_type
</sql>
@ -83,6 +84,7 @@
<if test="createTime != null">create_time,</if>
<if test="updateBy != null and updateBy != ''">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="ratio != null">ratio,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="defectId != null">#{defectId},</if>
@ -99,6 +101,7 @@
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="ratio != null">#{ratio},</if>
</trim>
</insert>
@ -118,12 +121,13 @@
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="ratio != null">ratio = #{ratio},</if>
</trim>
where defect_id = #{defectId} and del_flag = '0'
</update>
<delete id="deleteQcDefectTypeByDefectId" parameterType="String">
delete qc_defect_type set del_flag = '1' where defect_id = #{defectId}
update qc_defect_type set del_flag = '1' where defect_id = #{defectId}
</delete>
<delete id="deleteQcDefectTypeByDefectIds" parameterType="String">

@ -103,7 +103,7 @@ public class SysDatasourceServiceImpl implements ISysDatasourceService {
sysDatasource.setUrl(mysqlPrev + sysDatasource.getIpPort().split("/")[0]
+ mysqlAffter + sysDatasource.getIpPort().split("/")[1]);
}
if (sysDatasource.getDeptId() != null) {
if (sysDatasource.getDeptId() != null && StringUtils.isEmpty(sysDatasource.getPoolName())) {
sysDatasource.setPoolName(poolNamePrev + "_" + sysDatasource.getDeptId());

@ -0,0 +1,116 @@
package com.op.wms.controller;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.StringUtils;
import com.op.common.core.utils.poi.ExcelUtil;
import com.op.common.core.web.controller.BaseController;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.core.web.page.TableDataInfo;
import com.op.common.log.annotation.Log;
import com.op.common.log.enums.BusinessType;
import com.op.common.security.annotation.RequiresPermissions;
import com.op.common.security.utils.SecurityUtils;
import com.op.system.api.domain.SysDictData;
import com.op.wms.service.IBaseDictDataService;
import com.op.wms.service.IBaseDictTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
/**
*
*
* @author OP
*/
@RestController
@RequestMapping("/dict/data")
public class BaseDictDataController extends BaseController {
@Autowired
private IBaseDictDataService dictDataService;
@Autowired
private IBaseDictTypeService dictTypeService;
@RequiresPermissions("factory:dict:list")
@GetMapping("/list")
@DS("#header.poolName")
public TableDataInfo list(SysDictData dictData) {
startPage();
List<SysDictData> list = dictDataService.selectDictDataList(dictData);
return getDataTable(list);
}
@Log(title = "字典数据", businessType = BusinessType.EXPORT)
@RequiresPermissions("factory:dict:export")
@PostMapping("/export")
@DS("#header.poolName")
public void export(HttpServletResponse response, SysDictData dictData) {
List<SysDictData> list = dictDataService.selectDictDataList(dictData);
ExcelUtil<SysDictData> util = new ExcelUtil<SysDictData>(SysDictData.class);
util.exportExcel(response, list, "字典数据");
}
/**
*
*/
@RequiresPermissions("factory:dict:query")
@GetMapping(value = "/{dictCode}")
@DS("#header.poolName")
public AjaxResult getInfo(@PathVariable Long dictCode) {
return success(dictDataService.selectDictDataById(dictCode));
}
/**
*
*/
@GetMapping(value = "/type/{dictType}")
@DS("#header.poolName")
public AjaxResult dictType(@PathVariable String dictType) {
List<SysDictData> data = dictTypeService.selectDictDataByType(dictType);
if (StringUtils.isNull(data)) {
data = new ArrayList<SysDictData>();
}
return success(data);
}
/**
*
*/
@RequiresPermissions("factory:dict:add")
@Log(title = "字典数据", businessType = BusinessType.INSERT)
@PostMapping
@DS("#header.poolName")
public AjaxResult add(@Validated @RequestBody SysDictData dict) {
dict.setCreateBy(SecurityUtils.getUsername());
return toAjax(dictDataService.insertDictData(dict));
}
/**
*
*/
@RequiresPermissions("factory:dict:edit")
@Log(title = "字典数据", businessType = BusinessType.UPDATE)
@PutMapping
@DS("#header.poolName")
public AjaxResult edit(@Validated @RequestBody SysDictData dict) {
dict.setUpdateBy(SecurityUtils.getUsername());
return toAjax(dictDataService.updateDictData(dict));
}
/**
*
*/
@RequiresPermissions("factory:dict:remove")
@Log(title = "字典类型", businessType = BusinessType.DELETE)
@DeleteMapping("/{dictCodes}")
@DS("#header.poolName")
public AjaxResult remove(@PathVariable Long[] dictCodes) {
dictDataService.deleteDictDataByIds(dictCodes);
return success();
}
}

@ -0,0 +1,125 @@
package com.op.wms.controller;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.poi.ExcelUtil;
import com.op.common.core.web.controller.BaseController;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.core.web.page.TableDataInfo;
import com.op.common.log.annotation.Log;
import com.op.common.log.enums.BusinessType;
import com.op.common.security.annotation.RequiresPermissions;
import com.op.common.security.utils.SecurityUtils;
import com.op.system.api.domain.SysDictType;
import com.op.wms.service.IBaseDictTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
*
*
* @author OP
*/
@RestController
@RequestMapping("/dict/type")
public class BaseDictTypeController extends BaseController {
@Autowired
private IBaseDictTypeService dictTypeService;
@RequiresPermissions("factory:dict:list")
@GetMapping("/list")
@DS("#header.poolName")
public TableDataInfo list(SysDictType dictType) {
startPage();
List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
return getDataTable(list);
}
@Log(title = "字典类型", businessType = BusinessType.EXPORT)
@RequiresPermissions("factory:dict:export")
@PostMapping("/export")
@DS("#header.poolName")
public void export(HttpServletResponse response, SysDictType dictType) {
List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
ExcelUtil<SysDictType> util = new ExcelUtil<SysDictType>(SysDictType.class);
util.exportExcel(response, list, "字典类型");
}
/**
*
*/
@RequiresPermissions("factory:dict:query")
@GetMapping(value = "/{dictId}")
@DS("#header.poolName")
public AjaxResult getInfo(@PathVariable Long dictId) {
return success(dictTypeService.selectDictTypeById(dictId));
}
/**
*
*/
@RequiresPermissions("factory:dict:add")
@Log(title = "字典类型", businessType = BusinessType.INSERT)
@PostMapping
@DS("#header.poolName")
public AjaxResult add(@Validated @RequestBody SysDictType dict) {
if (!dictTypeService.checkDictTypeUnique(dict)) {
return error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在");
}
dict.setCreateBy(SecurityUtils.getUsername());
return toAjax(dictTypeService.insertDictType(dict));
}
/**
*
*/
@RequiresPermissions("factory:dict:edit")
@Log(title = "字典类型", businessType = BusinessType.UPDATE)
@PutMapping
@DS("#header.poolName")
public AjaxResult edit(@Validated @RequestBody SysDictType dict) {
if (!dictTypeService.checkDictTypeUnique(dict)) {
return error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在");
}
dict.setUpdateBy(SecurityUtils.getUsername());
return toAjax(dictTypeService.updateDictType(dict));
}
/**
*
*/
@RequiresPermissions("factory:dict:remove")
@Log(title = "字典类型", businessType = BusinessType.DELETE)
@DeleteMapping("/{dictIds}")
@DS("#header.poolName")
public AjaxResult remove(@PathVariable Long[] dictIds) {
dictTypeService.deleteDictTypeByIds(dictIds);
return success();
}
/**
*
*/
@RequiresPermissions("factory:dict:remove")
@Log(title = "字典类型", businessType = BusinessType.CLEAN)
@DeleteMapping("/refreshCache")
@DS("#header.poolName")
public AjaxResult refreshCache() {
dictTypeService.resetDictCache();
return success();
}
/**
*
*/
@GetMapping("/optionselect")
@DS("#header.poolName")
public AjaxResult optionselect() {
List<SysDictType> dictTypes = dictTypeService.selectDictTypeAll();
return success(dictTypes);
}
}

@ -4,6 +4,7 @@ import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.op.wms.domain.OdsProductEmbryoInventory;
import com.op.wms.domain.OdsProductEmbryoInventoryCorrelation;
import com.op.wms.service.IOdsProductEmbryoInventoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@ -76,6 +77,16 @@ public class OdsProductEmbryoInventoryController extends BaseController {
return toAjax(odsProductEmbryoInventoryService.insertOdsProductEmbryoInventory(odsProductEmbryoInventory));
}
/**
*
*/
@PostMapping("/addOdsProductEmbryoInventory")
public AjaxResult addOdsProductEmbryoInventory(@RequestBody OdsProductEmbryoInventory odsProductEmbryoInventory) {
return success(odsProductEmbryoInventoryService.addOdsProductEmbryoInventory(odsProductEmbryoInventory));
}
/**
*
*/

@ -32,6 +32,8 @@ public class WmsToWCSmissionController {
private IBaseWarehouseService baseWarehouseService;
@Autowired
private IOdsWhiteEmbryoService iOdsWhiteEmbryoService;
@Autowired
private IOdsProductEmbryoInventoryService odsProductEmbryoInventoryService;
/**
* ---
*
@ -453,4 +455,88 @@ public class WmsToWCSmissionController {
String result= iOdsWhiteEmbryoService.WhiteBilletReturnConfir(wmsOdsEmStorageNewsSn);
return success(result);
}
/**
*
*/
/**
* =
* @param odsProductEmbryoInventory
* @return
*/
@PostMapping("/selectOdsProductEmbryoInventory")
public AjaxResult selectOdsProductEmbryoInventory(@RequestBody OdsProductEmbryoInventory odsProductEmbryoInventory) {
return success(odsProductEmbryoInventoryService.selectOdsProductEmbryoInventory(odsProductEmbryoInventory));
}
/**
*
*/
/**
*
* @param odsProductEmbryoInventory
* @return
*/
@PostMapping("/selectScanningTray")
public AjaxResult selectScanningTray(@RequestBody OdsProductEmbryoInventory odsProductEmbryoInventory) {
OdsProductEmbryoInventoryCorrelation odsProductEmbryoInventoryCorrelation= odsProductEmbryoInventoryService.selectScanningTray(odsProductEmbryoInventory);
if (odsProductEmbryoInventoryCorrelation==null){
return success("托盘扫码错误");
}
return success(odsProductEmbryoInventoryCorrelation);
}
/**
* -
*/
/**
*
* @param odsProductEmbryoInventory
* @return
*/
@PostMapping("/confirmInventory")
public AjaxResult confirmInventory(@RequestBody OdsProductEmbryoInventory odsProductEmbryoInventory) {
String result= odsProductEmbryoInventoryService.confirmInventory(odsProductEmbryoInventory);
return success(result);
}
/**
* ---
*/
/**
*
* @param odsProductEmbryoInventory
* @return
*/
@PostMapping("/cancelInventory")
public AjaxResult cancelInventory(@RequestBody OdsProductEmbryoInventory odsProductEmbryoInventory) {
String result= odsProductEmbryoInventoryService.cancelInventory(odsProductEmbryoInventory);
return success(result);
}
/**
* ---
*/
/**
*=
* @param odsProductEmbryoInventory
* @return
*/
@PostMapping("/confirmCompletion")
public AjaxResult confirmCompletion(@RequestBody OdsProductEmbryoInventory odsProductEmbryoInventory) {
String result= odsProductEmbryoInventoryService.confirmCompletion(odsProductEmbryoInventory);
return success(result);
}
//
/**
*
* @param odsProductEmbryoInventory
* @return
*/
@PostMapping("/selectOdsProductEmbryoInventoryCorrelation")
public AjaxResult selectOdsProductEmbryoInventoryCorrelation(@RequestBody OdsProductEmbryoInventory odsProductEmbryoInventory) {
List<OdsProductEmbryoInventoryCorrelation> odsProductEmbryoInventoryCorrelationList= odsProductEmbryoInventoryService.selectOdsProductEmbryoInventoryCorrelation(odsProductEmbryoInventory);
return success(odsProductEmbryoInventoryCorrelationList);
}
}

@ -2,6 +2,8 @@ package com.op.wms.domain;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
@ -17,6 +19,17 @@ import com.op.common.core.web.domain.BaseEntity;
public class OdsProductEmbryoInventory extends BaseEntity {
private static final long serialVersionUID=1L;
private List<OdsProductEmbryoInventoryCorrelation> odsProductEmbryoInventoryCorrelationList;
public List<OdsProductEmbryoInventoryCorrelation> getOdsProductEmbryoInventoryCorrelationList() {
return odsProductEmbryoInventoryCorrelationList;
}
public void setOdsProductEmbryoInventoryCorrelationList(List<OdsProductEmbryoInventoryCorrelation> odsProductEmbryoInventoryCorrelationList) {
this.odsProductEmbryoInventoryCorrelationList = odsProductEmbryoInventoryCorrelationList;
}
/** 工厂编码 */
@Excel(name = "工厂编码")
private String siteCode;
@ -27,6 +40,16 @@ private static final long serialVersionUID=1L;
/** 盘点单号 */
@Excel(name = "盘点单号")
private String orderCode;
@Excel(name = "托盘")
private String sn;
public String getSn() {
return sn;
}
public void setSn(String sn) {
this.sn = sn;
}
/** 型号编码 */
@Excel(name = "型号编码")

@ -0,0 +1,428 @@
package com.op.wms.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal;
import java.util.Date;
/**
* ods_product_embryo_inventory
*
* @author Open Platform
* @date 2024-04-10
*/
public class OdsProductEmbryoInventoryCorrelation extends BaseEntity {
private static final long serialVersionUID=1L;
/** 工厂编码 */
@Excel(name = "工厂编码")
private String siteCode;
private String amount;
public String getAmount() {
return amount;
}
public void setAmount(String amount) {
this.amount = amount;
}
/** ID */
private String ID;
/** 盘点单号 */
@Excel(name = "关联的盘点单号")
private String orderCode;
private String wlCode;
public String getWlCode() {
return wlCode;
}
public void setWlCode(String wlCode) {
this.wlCode = wlCode;
}
/** 型号编码 */
@Excel(name = "型号编码")
private String materialCode;
/** 型号编码 */
@Excel(name = "备注")
private String Remark;
@Excel(name = "托盘")
private String sn;
private String productCode;
private String productName;
public String getProductCode() {
return productCode;
}
public void setProductCode(String productCode) {
this.productCode = productCode;
}
public String getProductName() {
return productName;
}
public void setProductName(String productName) {
this.productName = productName;
}
public String getSn() {
return sn;
}
public void setSn(String sn) {
this.sn = sn;
}
@Override
public String getRemark() {
return Remark;
}
@Override
public void setRemark(String remark) {
Remark = remark;
}
/** 型号名称 */
@Excel(name = "型号名称")
private String materialDesc;
/** 计划日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "计划日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date planDate;
/** 库存数量 */
@Excel(name = "应盘数量")
private BigDecimal locNumber;
/** 单位 */
@Excel(name = "单位")
private String unit;
/** 实际数量 */
@Excel(name = "实际数量")
private BigDecimal realityNumber;
/** 订单状态 */
@Excel(name = "状态0是未盘。1是盘了")
private String orderStatus;
/** 用户自定义属性2 */
@Excel(name = "用户自定义属性2")
private String userDefined1;
/** 库位 */
@Excel(name = "库位")
private String locCode;
/** 用户自定义属性2 */
@Excel(name = "用户自定义属性2")
private String userDefined2;
/** 用户自定义属性3 */
@Excel(name = "用户自定义属性3")
private String userDefined3;
/** 用户自定义属性4 */
@Excel(name = "用户自定义属性4")
private String userDefined4;
/** 用户自定义属性5 */
@Excel(name = "用户自定义属性5")
private String userDefined5;
/** 用户自定义属性6 */
@Excel(name = "用户自定义属性6")
private String userDefined6;
/** 用户自定义属性7 */
@Excel(name = "用户自定义属性7")
private String userDefined7;
/** 用户自定义属性8 */
@Excel(name = "用户自定义属性8")
private String userDefined8;
/** 用户自定义属性9 */
@Excel(name = "用户自定义属性9")
private String userDefined9;
/** 用户自定义属性10 */
@Excel(name = "用户自定义属性10")
private String userDefined10;
/** 用户自定义属性11 */
@Excel(name = "用户自定义属性11")
private String userDefined11;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date createDate;
/** 最后更新人 */
@Excel(name = "最后更新人")
private String lastUpdateBy;
/** 最后更新时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "最后更新时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date lastUpdateDate;
/** 可用标识 */
@Excel(name = "可用标识")
private String Active;
/** 企业主键 */
@Excel(name = "企业主键")
private String enterpriseId;
/** 企业编码 */
@Excel(name = "企业编码")
private String enterpriseCode;
public void setSiteCode(String siteCode){
this.siteCode = siteCode;
}
public String getSiteCode(){
return siteCode;
}
public void setID(String ID){
this.ID = ID;
}
public String getID(){
return ID;
}
public void setOrderCode(String orderCode){
this.orderCode = orderCode;
}
public String getOrderCode(){
return orderCode;
}
public void setMaterialCode(String materialCode){
this.materialCode = materialCode;
}
public String getMaterialCode(){
return materialCode;
}
public void setMaterialDesc(String materialDesc){
this.materialDesc = materialDesc;
}
public String getMaterialDesc(){
return materialDesc;
}
public void setPlanDate(Date planDate){
this.planDate = planDate;
}
public Date getPlanDate(){
return planDate;
}
public void setLocNumber(BigDecimal locNumber){
this.locNumber = locNumber;
}
public BigDecimal getLocNumber(){
return locNumber;
}
public void setUnit(String unit){
this.unit = unit;
}
public String getUnit(){
return unit;
}
public void setRealityNumber(BigDecimal realityNumber){
this.realityNumber = realityNumber;
}
public BigDecimal getRealityNumber(){
return realityNumber;
}
public void setOrderStatus(String orderStatus){
this.orderStatus = orderStatus;
}
public String getOrderStatus(){
return orderStatus;
}
public void setUserDefined1(String userDefined1){
this.userDefined1 = userDefined1;
}
public String getUserDefined1(){
return userDefined1;
}
public void setLocCode(String locCode){
this.locCode = locCode;
}
public String getLocCode(){
return locCode;
}
public void setUserDefined2(String userDefined2){
this.userDefined2 = userDefined2;
}
public String getUserDefined2(){
return userDefined2;
}
public void setUserDefined3(String userDefined3){
this.userDefined3 = userDefined3;
}
public String getUserDefined3(){
return userDefined3;
}
public void setUserDefined4(String userDefined4){
this.userDefined4 = userDefined4;
}
public String getUserDefined4(){
return userDefined4;
}
public void setUserDefined5(String userDefined5){
this.userDefined5 = userDefined5;
}
public String getUserDefined5(){
return userDefined5;
}
public void setUserDefined6(String userDefined6){
this.userDefined6 = userDefined6;
}
public String getUserDefined6(){
return userDefined6;
}
public void setUserDefined7(String userDefined7){
this.userDefined7 = userDefined7;
}
public String getUserDefined7(){
return userDefined7;
}
public void setUserDefined8(String userDefined8){
this.userDefined8 = userDefined8;
}
public String getUserDefined8(){
return userDefined8;
}
public void setUserDefined9(String userDefined9){
this.userDefined9 = userDefined9;
}
public String getUserDefined9(){
return userDefined9;
}
public void setUserDefined10(String userDefined10){
this.userDefined10 = userDefined10;
}
public String getUserDefined10(){
return userDefined10;
}
public void setUserDefined11(String userDefined11){
this.userDefined11 = userDefined11;
}
public String getUserDefined11(){
return userDefined11;
}
public void setCreateDate(Date createDate){
this.createDate = createDate;
}
public Date getCreateDate(){
return createDate;
}
public void setLastUpdateBy(String lastUpdateBy){
this.lastUpdateBy = lastUpdateBy;
}
public String getLastUpdateBy(){
return lastUpdateBy;
}
public void setLastUpdateDate(Date lastUpdateDate){
this.lastUpdateDate = lastUpdateDate;
}
public Date getLastUpdateDate(){
return lastUpdateDate;
}
public void setActive(String Active){
this.Active = Active;
}
public String getActive(){
return Active;
}
public void setEnterpriseId(String enterpriseId){
this.enterpriseId = enterpriseId;
}
public String getEnterpriseId(){
return enterpriseId;
}
public void setEnterpriseCode(String enterpriseCode){
this.enterpriseCode = enterpriseCode;
}
public String getEnterpriseCode(){
return enterpriseCode;
}
@Override
public String toString(){
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("siteCode",getSiteCode())
.append("ID",getID())
.append("orderCode",getOrderCode())
.append("materialCode",getMaterialCode())
.append("materialDesc",getMaterialDesc())
.append("planDate",getPlanDate())
.append("locNumber",getLocNumber())
.append("unit",getUnit())
.append("realityNumber",getRealityNumber())
.append("orderStatus",getOrderStatus())
.append("userDefined1",getUserDefined1())
.append("locCode",getLocCode())
.append("userDefined2",getUserDefined2())
.append("userDefined3",getUserDefined3())
.append("userDefined4",getUserDefined4())
.append("userDefined5",getUserDefined5())
.append("userDefined6",getUserDefined6())
.append("userDefined7",getUserDefined7())
.append("userDefined8",getUserDefined8())
.append("userDefined9",getUserDefined9())
.append("userDefined10",getUserDefined10())
.append("userDefined11",getUserDefined11())
.append("Remark",getRemark())
.append("createBy",getCreateBy())
.append("createDate",getCreateDate())
.append("lastUpdateBy",getLastUpdateBy())
.append("lastUpdateDate",getLastUpdateDate())
.append("Active",getActive())
.append("enterpriseId",getEnterpriseId())
.append("enterpriseCode",getEnterpriseCode())
.toString();
}
}

@ -0,0 +1,95 @@
package com.op.wms.mapper;
import com.op.system.api.domain.SysDictData;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
*
*
* @author OP
*/
public interface BaseDictDataMapper {
/**
*
*
* @param dictData
* @return
*/
public List<SysDictData> selectDictDataList(SysDictData dictData);
/**
*
*
* @param dictType
* @return
*/
public List<SysDictData> selectDictDataByType(String dictType);
/**
*
*
* @param dictType
* @param dictValue
* @return
*/
public String selectDictLabel(@Param("dictType") String dictType, @Param("dictValue") String dictValue);
/**
* ID
*
* @param dictCode ID
* @return
*/
public SysDictData selectDictDataById(Long dictCode);
/**
*
*
* @param dictType
* @return
*/
public int countDictDataByType(String dictType);
/**
* ID
*
* @param dictCode ID
* @return
*/
public int deleteDictDataById(Long dictCode);
/**
*
*
* @param dictCodes ID
* @return
*/
public int deleteDictDataByIds(Long[] dictCodes);
/**
*
*
* @param dictData
* @return
*/
public int insertDictData(SysDictData dictData);
/**
*
*
* @param dictData
* @return
*/
public int updateDictData(SysDictData dictData);
/**
*
*
* @param oldDictType
* @param newDictType
* @return
*/
public int updateDictDataType(@Param("oldDictType") String oldDictType, @Param("newDictType") String newDictType);
}

@ -0,0 +1,83 @@
package com.op.wms.mapper;
import com.op.system.api.domain.SysDictType;
import java.util.List;
/**
*
*
* @author OP
*/
public interface BaseDictTypeMapper {
/**
*
*
* @param dictType
* @return
*/
public List<SysDictType> selectDictTypeList(SysDictType dictType);
/**
*
*
* @return
*/
public List<SysDictType> selectDictTypeAll();
/**
* ID
*
* @param dictId ID
* @return
*/
public SysDictType selectDictTypeById(Long dictId);
/**
*
*
* @param dictType
* @return
*/
public SysDictType selectDictTypeByType(String dictType);
/**
* ID
*
* @param dictId ID
* @return
*/
public int deleteDictTypeById(Long dictId);
/**
*
*
* @param dictIds ID
* @return
*/
public int deleteDictTypeByIds(Long[] dictIds);
/**
*
*
* @param dictType
* @return
*/
public int insertDictType(SysDictType dictType);
/**
*
*
* @param dictType
* @return
*/
public int updateDictType(SysDictType dictType);
/**
*
*
* @param dictType
* @return
*/
public SysDictType checkDictTypeUnique(String dictType);
}

@ -3,6 +3,7 @@ package com.op.wms.mapper;
import java.util.List;
import com.op.wms.domain.OdsProductEmbryoInventory;
import com.op.wms.domain.OdsProductEmbryoInventoryCorrelation;
/**
* Mapper
@ -58,4 +59,10 @@ public interface OdsProductEmbryoInventoryMapper {
* @return
*/
public int deleteOdsProductEmbryoInventoryByIDs(String[] IDs);
void insertOdsProductEmbryoInventoryCorrelation(OdsProductEmbryoInventoryCorrelation odsProductEmbryoInventoryCorrelation1);
List<OdsProductEmbryoInventoryCorrelation> selectOdsProductEmbryoInventoryCorrelationList(OdsProductEmbryoInventory odsProductEmbryoInventory2);
public int updateOdsProductEmbryoInventoryCorrelation(OdsProductEmbryoInventory odsProductEmbryoInventory1);
}

@ -0,0 +1,61 @@
package com.op.wms.service;
import com.op.system.api.domain.SysDictData;
import java.util.List;
/**
*
*
* @author OP
*/
public interface IBaseDictDataService {
/**
*
*
* @param dictData
* @return
*/
public List<SysDictData> selectDictDataList(SysDictData dictData);
/**
*
*
* @param dictType
* @param dictValue
* @return
*/
public String selectDictLabel(String dictType, String dictValue);
/**
* ID
*
* @param dictCode ID
* @return
*/
public SysDictData selectDictDataById(Long dictCode);
/**
*
*
* @param dictCodes ID
*/
public void deleteDictDataByIds(Long[] dictCodes);
/**
*
*
* @param dictData
* @return
*/
public int insertDictData(SysDictData dictData);
/**
*
*
* @param dictData
* @return
*/
public int updateDictData(SysDictData dictData);
}

@ -0,0 +1,99 @@
package com.op.wms.service;
import com.op.system.api.domain.SysDictData;
import com.op.system.api.domain.SysDictType;
import java.util.List;
/**
*
*
* @author OP
*/
public interface IBaseDictTypeService {
/**
*
*
* @param dictType
* @return
*/
public List<SysDictType> selectDictTypeList(SysDictType dictType);
/**
*
*
* @return
*/
public List<SysDictType> selectDictTypeAll();
/**
*
*
* @param dictType
* @return
*/
public List<SysDictData> selectDictDataByType(String dictType);
/**
* ID
*
* @param dictId ID
* @return
*/
public SysDictType selectDictTypeById(Long dictId);
/**
*
*
* @param dictType
* @return
*/
public SysDictType selectDictTypeByType(String dictType);
/**
*
*
* @param dictIds ID
*/
public void deleteDictTypeByIds(Long[] dictIds);
/**
*
*/
public void loadingDictCache();
/**
*
*/
public void clearDictCache();
/**
*
*/
public void resetDictCache();
/**
*
*
* @param dictType
* @return
*/
public int insertDictType(SysDictType dictType);
/**
*
*
* @param dictType
* @return
*/
public int updateDictType(SysDictType dictType);
/**
*
*
* @param dictType
* @return
*/
public boolean checkDictTypeUnique(SysDictType dictType);
}

@ -3,6 +3,7 @@ package com.op.wms.service;
import java.util.List;
import com.op.wms.domain.OdsProductEmbryoInventory;
import com.op.wms.domain.OdsProductEmbryoInventoryCorrelation;
/**
* Service
@ -58,4 +59,18 @@ public interface IOdsProductEmbryoInventoryService {
* @return
*/
public int deleteOdsProductEmbryoInventoryByID(String ID);
String addOdsProductEmbryoInventory(OdsProductEmbryoInventory odsProductEmbryoInventory);
OdsProductEmbryoInventory selectOdsProductEmbryoInventory(OdsProductEmbryoInventory odsProductEmbryoInventory);
OdsProductEmbryoInventoryCorrelation selectScanningTray(OdsProductEmbryoInventory odsProductEmbryoInventory);
String confirmInventory(OdsProductEmbryoInventory odsProductEmbryoInventory);
String cancelInventory(OdsProductEmbryoInventory odsProductEmbryoInventory);
String confirmCompletion(OdsProductEmbryoInventory odsProductEmbryoInventory);
List<OdsProductEmbryoInventoryCorrelation> selectOdsProductEmbryoInventoryCorrelation(OdsProductEmbryoInventory odsProductEmbryoInventory);
}

@ -0,0 +1,102 @@
package com.op.wms.service.impl;
import com.op.common.security.utils.DictUtils;
import com.op.system.api.domain.SysDictData;
import com.op.wms.mapper.BaseDictDataMapper;
import com.op.wms.service.IBaseDictDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
*
*
* @author OP
*/
@Service
public class BaseDictDataServiceImpl implements IBaseDictDataService {
@Autowired
private BaseDictDataMapper dictDataMapper;
/**
*
*
* @param dictData
* @return
*/
@Override
public List<SysDictData> selectDictDataList(SysDictData dictData) {
return dictDataMapper.selectDictDataList(dictData);
}
/**
*
*
* @param dictType
* @param dictValue
* @return
*/
@Override
public String selectDictLabel(String dictType, String dictValue) {
return dictDataMapper.selectDictLabel(dictType, dictValue);
}
/**
* ID
*
* @param dictCode ID
* @return
*/
@Override
public SysDictData selectDictDataById(Long dictCode) {
return dictDataMapper.selectDictDataById(dictCode);
}
/**
*
*
* @param dictCodes ID
*/
@Override
public void deleteDictDataByIds(Long[] dictCodes) {
for (Long dictCode : dictCodes) {
SysDictData data = selectDictDataById(dictCode);
dictDataMapper.deleteDictDataById(dictCode);
List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(data.getDictType());
DictUtils.setDictCache(data.getDictType(), dictDatas);
}
}
/**
*
*
* @param data
* @return
*/
@Override
public int insertDictData(SysDictData data) {
int row = dictDataMapper.insertDictData(data);
if (row > 0) {
List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(data.getDictType());
DictUtils.setDictCache(data.getDictType(), dictDatas);
}
return row;
}
/**
*
*
* @param data
* @return
*/
@Override
public int updateDictData(SysDictData data) {
int row = dictDataMapper.updateDictData(data);
if (row > 0) {
List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(data.getDictType());
DictUtils.setDictCache(data.getDictType(), dictDatas);
}
return row;
}
}

@ -0,0 +1,205 @@
package com.op.wms.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.constant.UserConstants;
import com.op.common.core.exception.ServiceException;
import com.op.common.core.utils.StringUtils;
import com.op.common.security.utils.DictUtils;
import com.op.system.api.domain.SysDictData;
import com.op.system.api.domain.SysDictType;
import com.op.wms.mapper.BaseDictDataMapper;
import com.op.wms.mapper.BaseDictTypeMapper;
import com.op.wms.service.IBaseDictTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
*
*
* @author OP
*/
@Service
public class BaseDictTypeServiceImpl implements IBaseDictTypeService {
@Autowired
private BaseDictTypeMapper dictTypeMapper;
@Autowired
private BaseDictDataMapper dictDataMapper;
/**
*
*/
/*@PostConstruct
public void init() {
loadingDictCache();
}
*/
/**
*
*
* @param dictType
* @return
*/
@Override
public List<SysDictType> selectDictTypeList(SysDictType dictType) {
return dictTypeMapper.selectDictTypeList(dictType);
}
/**
*
*
* @return
*/
@Override
public List<SysDictType> selectDictTypeAll() {
return dictTypeMapper.selectDictTypeAll();
}
/**
*
*
* @param dictType
* @return
*/
@Override
public List<SysDictData> selectDictDataByType(String dictType) {
List<SysDictData> dictDatas = DictUtils.getDictCache(dictType);
if (StringUtils.isNotEmpty(dictDatas)) {
return dictDatas;
}
dictDatas = dictDataMapper.selectDictDataByType(dictType);
if (StringUtils.isNotEmpty(dictDatas)) {
DictUtils.setDictCache(dictType, dictDatas);
return dictDatas;
}
return null;
}
/**
* ID
*
* @param dictId ID
* @return
*/
@Override
public SysDictType selectDictTypeById(Long dictId) {
return dictTypeMapper.selectDictTypeById(dictId);
}
/**
*
*
* @param dictType
* @return
*/
@Override
public SysDictType selectDictTypeByType(String dictType) {
return dictTypeMapper.selectDictTypeByType(dictType);
}
/**
*
*
* @param dictIds ID
*/
@Override
public void deleteDictTypeByIds(Long[] dictIds) {
for (Long dictId : dictIds) {
SysDictType dictType = selectDictTypeById(dictId);
if (dictDataMapper.countDictDataByType(dictType.getDictType()) > 0) {
throw new ServiceException(String.format("%1$s已分配,不能删除", dictType.getDictName()));
}
dictTypeMapper.deleteDictTypeById(dictId);
DictUtils.removeDictCache(dictType.getDictType());
}
}
/**
*
*/
@Override
@DS("#header.poolName")
public void loadingDictCache() {
SysDictData dictData = new SysDictData();
dictData.setStatus("0");
Map<String, List<SysDictData>> dictDataMap = dictDataMapper.selectDictDataList(dictData).stream()
.collect(Collectors.groupingBy(SysDictData::getDictType));
for (Map.Entry<String, List<SysDictData>> entry : dictDataMap.entrySet()) {
DictUtils.setDictCache(entry.getKey(), entry.getValue().stream()
.sorted(Comparator.comparing(SysDictData::getDictSort)).collect(Collectors.toList()));
}
}
/**
*
*/
@Override
public void clearDictCache() {
DictUtils.clearDictCache();
}
/**
*
*/
@Override
public void resetDictCache() {
clearDictCache();
loadingDictCache();
}
/**
*
*
* @param dict
* @return
*/
@Override
public int insertDictType(SysDictType dict) {
int row = dictTypeMapper.insertDictType(dict);
if (row > 0) {
DictUtils.setDictCache(dict.getDictType(), null);
}
return row;
}
/**
*
*
* @param dict
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public int updateDictType(SysDictType dict) {
SysDictType oldDict = dictTypeMapper.selectDictTypeById(dict.getDictId());
dictDataMapper.updateDictDataType(oldDict.getDictType(), dict.getDictType());
int row = dictTypeMapper.updateDictType(dict);
if (row > 0) {
List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(dict.getDictType());
DictUtils.setDictCache(dict.getDictType(), dictDatas);
}
return row;
}
/**
*
*
* @param dict
* @return
*/
@Override
public boolean checkDictTypeUnique(SysDictType dict) {
Long dictId = StringUtils.isNull(dict.getDictId()) ? -1L : dict.getDictId();
SysDictType dictType = dictTypeMapper.checkDictTypeUnique(dict.getDictType());
if (StringUtils.isNotNull(dictType) && dictType.getDictId().longValue() != dictId.longValue()) {
return UserConstants.NOT_UNIQUE;
}
return UserConstants.UNIQUE;
}
}

@ -1,10 +1,20 @@
package com.op.wms.service.impl;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
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.common.security.utils.SecurityUtils;
import com.op.wms.domain.OdsProductEmbryoInventory;
import com.op.wms.domain.OdsProductEmbryoInventoryCorrelation;
import com.op.wms.domain.Purcode;
import com.op.wms.mapper.OdsProductEmbryoInventoryMapper;
import com.op.wms.mapper.PurcodeMapper;
import com.op.wms.service.IOdsProductEmbryoInventoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -21,6 +31,8 @@ public class OdsProductEmbryoInventoryServiceImpl implements IOdsProductEmbryoIn
@Autowired
private OdsProductEmbryoInventoryMapper odsProductEmbryoInventoryMapper;
@Autowired
private PurcodeMapper purcodeMapper;
/**
*
*
@ -92,4 +104,203 @@ public class OdsProductEmbryoInventoryServiceImpl implements IOdsProductEmbryoIn
public int deleteOdsProductEmbryoInventoryByID(String ID) {
return odsProductEmbryoInventoryMapper.deleteOdsProductEmbryoInventoryByID(ID);
}
@Override
@DS("#header.poolName")
public String addOdsProductEmbryoInventory(OdsProductEmbryoInventory odsProductEmbryoInventory) {
String ruslt="创建成功";
//插入盘点表
String orderCode = getPurcode(null, "PD");
OdsProductEmbryoInventory odsProductEmbryoInventory1=new OdsProductEmbryoInventory();
odsProductEmbryoInventory1.setID(IdUtils.fastSimpleUUID());
odsProductEmbryoInventory1.setActive("1");
odsProductEmbryoInventory1.setSiteCode(odsProductEmbryoInventory.getSiteCode());
odsProductEmbryoInventory1.setOrderCode(orderCode);//自动生成
odsProductEmbryoInventory1.setOrderStatus("0");
// odsProductEmbryoInventory1.setMaterialCode(odsProductEmbryoInventory.getMaterialCode());
// odsProductEmbryoInventory1.setMaterialDesc(odsProductEmbryoInventory.getMaterialDesc());
// odsProductEmbryoInventory1.setLocNumber();
odsProductEmbryoInventory1.setUnit(odsProductEmbryoInventory.getUnit());
odsProductEmbryoInventory1.setUserDefined1(odsProductEmbryoInventory.getUserDefined1());//盘点仓库
odsProductEmbryoInventory1.setUserDefined3(odsProductEmbryoInventory.getUserDefined3());//盘点类型
odsProductEmbryoInventory1.setUserDefined10(odsProductEmbryoInventory.getUserDefined10());//盘点策略
odsProductEmbryoInventory1.setUserDefined11(odsProductEmbryoInventory.getUserDefined11());//产品状态
odsProductEmbryoInventory1.setRemark(odsProductEmbryoInventory.getRemark());
odsProductEmbryoInventory1.setCreateBy(SecurityUtils.getUsername());
odsProductEmbryoInventory1.setCreateDate(new Date());
odsProductEmbryoInventoryMapper.insertOdsProductEmbryoInventory(odsProductEmbryoInventory1);
//插入对应的关联明细
List<OdsProductEmbryoInventoryCorrelation> odsProductEmbryoInventoryCorrelationList= odsProductEmbryoInventory.getOdsProductEmbryoInventoryCorrelationList();
for (OdsProductEmbryoInventoryCorrelation odsProductEmbryoInventoryCorrelation:
odsProductEmbryoInventoryCorrelationList ) {
OdsProductEmbryoInventoryCorrelation odsProductEmbryoInventoryCorrelation1=new OdsProductEmbryoInventoryCorrelation();
odsProductEmbryoInventoryCorrelation1.setID(IdUtils.fastSimpleUUID());
odsProductEmbryoInventoryCorrelation1.setActive("1");
odsProductEmbryoInventoryCorrelation1.setSiteCode(odsProductEmbryoInventory.getSiteCode());
odsProductEmbryoInventoryCorrelation1.setOrderCode(orderCode);
odsProductEmbryoInventoryCorrelation1.setOrderStatus("0");
odsProductEmbryoInventoryCorrelation1.setMaterialCode(odsProductEmbryoInventoryCorrelation.getProductCode());
odsProductEmbryoInventoryCorrelation1.setMaterialDesc(odsProductEmbryoInventoryCorrelation.getProductName());
odsProductEmbryoInventoryCorrelation1.setLocNumber(new BigDecimal(odsProductEmbryoInventoryCorrelation.getAmount()));//应盘
odsProductEmbryoInventoryCorrelation1.setLocCode(odsProductEmbryoInventoryCorrelation.getWlCode());//库位
odsProductEmbryoInventoryCorrelation1.setUserDefined2(odsProductEmbryoInventoryCorrelation.getSn());//sn
odsProductEmbryoInventoryCorrelation1.setUnit(odsProductEmbryoInventoryCorrelation.getUnit());
odsProductEmbryoInventoryCorrelation1.setUserDefined1(odsProductEmbryoInventory.getUserDefined1());//盘点仓库
odsProductEmbryoInventoryCorrelation1.setUserDefined3(odsProductEmbryoInventory.getUserDefined3());//盘点类型
odsProductEmbryoInventoryCorrelation1.setUserDefined10(odsProductEmbryoInventory.getUserDefined10());//盘点策略
odsProductEmbryoInventoryCorrelation1.setUserDefined11(odsProductEmbryoInventory.getUserDefined11());//产品状态
odsProductEmbryoInventoryCorrelation1.setRemark(odsProductEmbryoInventory.getRemark());
odsProductEmbryoInventoryCorrelation1.setCreateBy(SecurityUtils.getUsername());
odsProductEmbryoInventoryCorrelation1.setCreateDate(new Date());
odsProductEmbryoInventoryMapper.insertOdsProductEmbryoInventoryCorrelation(odsProductEmbryoInventoryCorrelation1);
}
return ruslt;
}
@Override
public OdsProductEmbryoInventory selectOdsProductEmbryoInventory(OdsProductEmbryoInventory odsProductEmbryoInventory) {
OdsProductEmbryoInventory odsProductEmbryoInventorytwm=new OdsProductEmbryoInventory();
DynamicDataSourceContextHolder.push("ds_" + odsProductEmbryoInventory.getSiteCode());
List<OdsProductEmbryoInventoryCorrelation> odsProductEmbryoInventoryCorrelationList=new ArrayList<>();
OdsProductEmbryoInventory odsProductEmbryoInventory1=new OdsProductEmbryoInventory();
odsProductEmbryoInventory1.setOrderCode(odsProductEmbryoInventory.getOrderCode());
odsProductEmbryoInventory1.setActive("1");
odsProductEmbryoInventory1.setOrderStatus("0");//带盘点
List<OdsProductEmbryoInventory> odsProductEmbryoInventoryList=odsProductEmbryoInventoryMapper.selectOdsProductEmbryoInventoryList(odsProductEmbryoInventory1);
if (odsProductEmbryoInventoryList.size()>0){
odsProductEmbryoInventorytwm= odsProductEmbryoInventoryList.get(0);
OdsProductEmbryoInventory odsProductEmbryoInventory3=new OdsProductEmbryoInventory();
odsProductEmbryoInventory3.setOrderCode(odsProductEmbryoInventorytwm.getOrderCode());
odsProductEmbryoInventory3.setActive("1");
odsProductEmbryoInventoryCorrelationList =odsProductEmbryoInventoryMapper.selectOdsProductEmbryoInventoryCorrelationList(odsProductEmbryoInventory3);
}
odsProductEmbryoInventorytwm.setOdsProductEmbryoInventoryCorrelationList(odsProductEmbryoInventoryCorrelationList);
return odsProductEmbryoInventorytwm;
}
@Override
public OdsProductEmbryoInventoryCorrelation selectScanningTray(OdsProductEmbryoInventory odsProductEmbryoInventory) {
DynamicDataSourceContextHolder.push("ds_" + odsProductEmbryoInventory.getSiteCode());
OdsProductEmbryoInventory odsProductEmbryoInventory1=new OdsProductEmbryoInventory();
odsProductEmbryoInventory1.setOrderCode(odsProductEmbryoInventory.getOrderCode());
odsProductEmbryoInventory1.setUserDefined2(odsProductEmbryoInventory.getSn());
List<OdsProductEmbryoInventoryCorrelation> odsProductEmbryoInventoryCorrelationList= odsProductEmbryoInventoryMapper.selectOdsProductEmbryoInventoryCorrelationList(odsProductEmbryoInventory1);
if (odsProductEmbryoInventoryCorrelationList.size()>0){
return odsProductEmbryoInventoryCorrelationList.get(0);
}
return null;
}
@Override
public String confirmInventory(OdsProductEmbryoInventory odsProductEmbryoInventory) {
String ruslt="成功";
DynamicDataSourceContextHolder.push("ds_" + odsProductEmbryoInventory.getSiteCode());
OdsProductEmbryoInventory odsProductEmbryoInventory1=new OdsProductEmbryoInventory();
odsProductEmbryoInventory1.setID(odsProductEmbryoInventory.getID());
odsProductEmbryoInventory1.setOrderStatus("1");
// odsProductEmbryoInventory1.setUserDefined2(odsProductEmbryoInventory.getUserDefined2());
odsProductEmbryoInventory1.setRealityNumber(odsProductEmbryoInventory.getRealityNumber());
odsProductEmbryoInventoryMapper.updateOdsProductEmbryoInventoryCorrelation(odsProductEmbryoInventory1);
return ruslt;
}
@Override
public String cancelInventory(OdsProductEmbryoInventory odsProductEmbryoInventory) {
String ruslt="成功";
DynamicDataSourceContextHolder.push("ds_" + odsProductEmbryoInventory.getSiteCode());
OdsProductEmbryoInventory odsProductEmbryoInventory1=new OdsProductEmbryoInventory();
odsProductEmbryoInventory1.setID(odsProductEmbryoInventory.getID());
odsProductEmbryoInventory1.setOrderStatus("0");
//odsProductEmbryoInventory1.setUserDefined2(odsProductEmbryoInventory.getUserDefined2());
odsProductEmbryoInventory1.setRealityNumber(new BigDecimal("0"));
odsProductEmbryoInventoryMapper.updateOdsProductEmbryoInventoryCorrelation(odsProductEmbryoInventory1);
return ruslt;
}
/**
* =
* @param odsProductEmbryoInventory
* @return
*/
@Override
public String confirmCompletion(OdsProductEmbryoInventory odsProductEmbryoInventory) {
String ruslt="成功";
DynamicDataSourceContextHolder.push("ds_" + odsProductEmbryoInventory.getSiteCode());
BigDecimal realityNumber= odsProductEmbryoInventory.getRealityNumber();
BigDecimal locNumber= odsProductEmbryoInventory.getLocNumber();
// 获取当前时间
Date currentDate = new Date();
// 使用SimpleDateFormat格式化时间
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// 将当前时间格式化为字符串
String date = dateFormat.format(currentDate);
if (realityNumber.compareTo(locNumber) == 0) { // 如果实际数量等于库存地点数量
// 更新状态为已完成---3
OdsProductEmbryoInventory odsProductEmbryoInventory1=new OdsProductEmbryoInventory();
odsProductEmbryoInventory1.setID(odsProductEmbryoInventory.getID());
odsProductEmbryoInventory1.setOrderStatus("3");
odsProductEmbryoInventory1.setUserDefined2(odsProductEmbryoInventory.getCreateBy());
odsProductEmbryoInventory1.setUserDefined5(date);
odsProductEmbryoInventoryMapper.updateOdsProductEmbryoInventory(odsProductEmbryoInventory1);
} else {
// 更新状态为待调整--1
OdsProductEmbryoInventory odsProductEmbryoInventory1=new OdsProductEmbryoInventory();
odsProductEmbryoInventory1.setID(odsProductEmbryoInventory.getID());
odsProductEmbryoInventory1.setOrderStatus("1");
odsProductEmbryoInventory1.setUserDefined5(date);//盘点时间
odsProductEmbryoInventory1.setUserDefined2(odsProductEmbryoInventory.getCreateBy());//盘点人
odsProductEmbryoInventoryMapper.updateOdsProductEmbryoInventory(odsProductEmbryoInventory1);
}
return ruslt;
}
@Override
public List<OdsProductEmbryoInventoryCorrelation> selectOdsProductEmbryoInventoryCorrelation(OdsProductEmbryoInventory odsProductEmbryoInventory) {
DynamicDataSourceContextHolder.push("ds_" + odsProductEmbryoInventory.getSiteCode());
OdsProductEmbryoInventory odsProductEmbryoInventory1=new OdsProductEmbryoInventory();
odsProductEmbryoInventory1.setOrderStatus("1");
odsProductEmbryoInventory1.setOrderCode(odsProductEmbryoInventory.getOrderCode());
odsProductEmbryoInventory1.setActive("1");
List<OdsProductEmbryoInventoryCorrelation> odsProductEmbryoInventoryCorrelationList= odsProductEmbryoInventoryMapper.selectOdsProductEmbryoInventoryCorrelationList(odsProductEmbryoInventory1);
return odsProductEmbryoInventoryCorrelationList;
}
@DS("#header.poolName")
private String getPurcode(String factorycode, String orderType) {
String purcode = "";
String curDate = new SimpleDateFormat("yyyyMMdd").format(new Date());
Integer vaule = purcodeMapper.queryCurValue(orderType, curDate);
if (vaule == null) {
Purcode purcodeO = new Purcode();
purcodeO.setCurDate(curDate);
purcodeO.setOrderType(orderType);
purcodeO.setValue(1);
int count = purcodeMapper.insert(purcodeO);
if (count != 1) {
return "";
}
if (factorycode != null && !factorycode.equals("")) {
purcode = orderType + factorycode + curDate.substring(2) + String.format("%04d", 1);
} else {
purcode = orderType + curDate.substring(2) + String.format("%04d", 1);
}
} else {
int count = purcodeMapper.updateCurValue(orderType, curDate, vaule);
if (count != 1) {
return "";
}
if (factorycode != null && !factorycode.equals("")) {
purcode = orderType + factorycode + curDate.substring(2) + String.format("%04d", vaule + 1);
} else {
purcode = orderType + curDate.substring(2) + String.format("%04d", vaule + 1);
}
}
return purcode;
}
}

@ -11,6 +11,8 @@ import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import com.op.common.core.domain.R;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.security.utils.SecurityUtils;
import com.op.system.api.RemoteQualityService;
import com.op.system.api.domain.quality.QcCheckTaskWarehousingDTO;
import com.op.system.api.domain.wms.wmsReportWork;
@ -321,7 +323,12 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
@DS("#header.poolName")
public List<wmsReportWork> getReportList(wmsReportWork mesReportWork) {
List<wmsReportWork> rlist = wmsProductPutMapper.getReportList(mesReportWork);
;
// //加上已经过账的数量reportCode work_order batch_number batch
// for (wmsReportWork wmsReportWork:
// rlist) {
// String SAPquantity= wmsProductPutMapper.selectWmsProductPutNum(wmsReportWork);
// wmsReportWork.setSAPquantity(SAPquantity);
// }
return rlist;
}
@ -333,6 +340,7 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
String formattedDate = dateFormat.format(date);//批次
//List<WmsProductPut> wmsProductPutList= new ArrayList<>();
List<wmsReportWork> wmsReportWorkList = new ArrayList<>();
List<wmsReportWork> wmsReportWorkListTWO = new ArrayList<>();
List<wmsReportWork> wmsReportWorkListRk = new ArrayList<>();
List<wmsReportWork> wmsReportWorkListagain = new ArrayList<>();
//获取当前所选工厂
@ -355,16 +363,36 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
wmsProductPutk.setStatus("1");
wmsProductPutk.setUnitOfMeasure(mesReportWork.getUnit());
wmsProductPutk.setBatchNumber(mesReportWork.getBatch());//
//wmsProductPutk.setSapStatus("2");
// wmsProductPutk.setSapStatus("2");//过账失败的
List<WmsProductPut> wmsProductPutList = wmsProductPutMapper.selectWmsProductPutList(wmsProductPutk);
if (wmsProductPutList.size() > 0) {
String id = wmsProductPutList.get(0).getId();
mesReportWork.setId(id);
wmsReportWorkList.add(mesReportWork);
wmsReportWorkList.add(mesReportWork);//已经插入
} else {
wmsReportWorkListRk.add(mesReportWork);
wmsReportWorkListRk.add(mesReportWork);//第一次的
}
}
for (wmsReportWork mesReportWork :
wmsReportWorkListRk) {
// WmsProductPut wmsProductPutk = new WmsProductPut();
// wmsProductPutk.setWorkOrder(mesReportWork.getReportCode());
// wmsProductPutk.setFactoryCode(factoryCode);
// wmsProductPutk.setWhCode(mesReportWork.getWhCode());//仓库编码
// wmsProductPutk.setProductName(mesReportWork.getProductName());
// wmsProductPutk.setProductCode(mesReportWork.getProductCode());
// wmsProductPutk.setProductOrder(mesReportWork.getWorkorderCodeSap());
// wmsProductPutk.setPlanQuantity(mesReportWork.getQuantityFeedback());
// wmsProductPutk.setPutQuantity(mesReportWork.getQuantityQualified());
// wmsProductPutk.setStatus("1");
// wmsProductPutk.setUnitOfMeasure(mesReportWork.getUnit());
// wmsProductPutk.setBatchNumber(mesReportWork.getBatch());//
// wmsProductPutk.setSapStatus("2");
// List<WmsProductPut> wmsProductPutList = wmsProductPutMapper.selectWmsProductPutList(wmsProductPutk);
// if (wmsProductPutList.size() > 0) {//已经插入
wmsReportWorkListagain.add(mesReportWork);//
// }
}
for (wmsReportWork mesReportWork :
wmsReportWorkList) {
WmsProductPut wmsProductPutk = new WmsProductPut();
@ -381,10 +409,12 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
wmsProductPutk.setBatchNumber(mesReportWork.getBatch());//
wmsProductPutk.setSapStatus("2");
List<WmsProductPut> wmsProductPutList = wmsProductPutMapper.selectWmsProductPutList(wmsProductPutk);
if (wmsProductPutList.size() > 0) {
wmsReportWorkListagain.add(mesReportWork);//再次过账
if (wmsProductPutList.size() > 0) {//已经插入且失败的
wmsReportWorkListTWO.add(mesReportWork);//
}
}
//先屏蔽起来
for (wmsReportWork mesReportWork :
wmsReportWorkListRk) {
@ -406,7 +436,7 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
//List<WmsProductPut> wmsProductPutList= wmsProductPutMapper.selectWmsProductPutList(wmsProductPutk);
wmsProductPutk.setAttr3(formattedDate);//
wmsProductPutk.setCreateBy(mesReportWork.getCreateBy());
wmsProductPutk.setCreateBy(SecurityUtils.getUsername());
wmsProductPutk.setCreateTime(new Date());
wmsProductPutk.setProductDate(mesReportWork.getProductDate());
@ -422,7 +452,7 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
wmsProductPutRecords.setWhCode(mesReportWork.getWhCode());//仓库编码
wmsProductPutRecords.setId(IdUtils.fastSimpleUUID());
wmsProductPutRecords.setNumber(mesReportWork.getQuantityQualified().toString());
wmsProductPutRecords.setCreateBy(mesReportWork.getCreateBy());
wmsProductPutRecords.setCreateBy(SecurityUtils.getUsername());
wmsProductPutRecords.setCreateTime(new Date());
wmsProductPutRecordsMapper.insertWmsProductPutRecords(wmsProductPutRecords);
@ -440,7 +470,7 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
List<WmsFpStorageNews> wmsFpStorageNewsList = wmsFpStorageNewsMapper.selectWmsFpStorageNewsList(wmsFpStorageNews);
wmsFpStorageNews.setStorageId(IdUtils.fastSimpleUUID());
wmsFpStorageNews.setAmount(mesReportWork.getQuantityQualified());
wmsFpStorageNews.setCreateBy(mesReportWork.getCreateBy());
wmsFpStorageNews.setCreateBy(SecurityUtils.getUsername());
wmsFpStorageNews.setCreateTime(new Date());
if (wmsFpStorageNewsList.size() > 0) {
WmsFpStorageNews wmsFpStorageNews1 = wmsFpStorageNewsList.get(0);
@ -462,8 +492,12 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
map.put("LGORT", mesReportWork.getWhCode());
map.put("QUANTITY", mesReportWork.getQuantityQualified());
map.put("ERFME", mesReportWork.getUnit());
String batch = mesReportWork.getBatch().substring(12);
map.put("BATCH", batch);
if (mesReportWork.getBatch().length()>12){
String batch = mesReportWork.getBatch().substring(12);
map.put("BATCH", batch);
}else {
map.put("BATCH", mesReportWork.getBatch());
}
String formattedsDate = mesReportWork.getProductDate().replace("-", "");
map.put("HSDAT", formattedsDate);
mapList.add(map);
@ -487,10 +521,10 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
wmsProductPutMapper.updateWmsProductPut(wmsProductPut2);
}
}
if (wmsReportWorkListagain.size() > 0) {
if (wmsReportWorkListTWO.size() > 0) {
List<Map<String, Object>> mapList = new ArrayList<>();
for (wmsReportWork mesReportWork :
wmsReportWorkListagain) {
wmsReportWorkListTWO) {
Map<String, Object> map = new HashMap<>();
map.put("AUFNR", mesReportWork.getWorkorderCodeSap());
map.put("WERKS", factoryCode);
@ -508,7 +542,7 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
int code = result.getCode();
String msg = result.getMsg();
for (wmsReportWork mesReportWork :
wmsReportWorkListagain) {
wmsReportWorkListTWO) {
WmsProductPut wmsProductPut2 = new WmsProductPut();
wmsProductPut2.setId(mesReportWork.getId());
wmsProductPut2.setSapMessage(msg);
@ -522,7 +556,7 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
wmsProductPutMapper.updateWmsProductPut(wmsProductPut2);
}
}
//
// for (wmsReportWork wmsReportWork:
// wmsReportWorkListagain) {
// QcCheckTaskWarehousingDTO qcCheckTaskWarehousingDTO = new QcCheckTaskWarehousingDTO();
@ -541,7 +575,8 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
// Date productDate = simpleDateFormat.parse(wmsReportWork.getProductDate());
// qcCheckTaskWarehousingDTO.setIncomeTime(productDate);
// //qcCheckTaskWarehousingDTO.
// remoteQualityService.createProductTask(qcCheckTaskWarehousingDTO);
// R productTask= remoteQualityService.createProductTask(qcCheckTaskWarehousingDTO);
// productTask.getData();
// }
String SUCCESS = "操作完成";

@ -0,0 +1,124 @@
<?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.wms.mapper.BaseDictDataMapper">
<resultMap type="SysDictData" id="SysDictTypeResult">
<id property="dictCode" column="dict_code"/>
<result property="dictSort" column="dict_sort"/>
<result property="dictLabel" column="dict_label"/>
<result property="dictValue" column="dict_value"/>
<result property="dictType" column="dict_type"/>
<result property="cssClass" column="css_class"/>
<result property="listClass" column="list_class"/>
<result property="isDefault" column="is_default"/>
<result property="status" column="status"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<sql id="selectDictDataVo">
select dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark
from base_dict_data
</sql>
<select id="selectDictDataList" parameterType="SysDictType" resultMap="SysDictTypeResult">
<include refid="selectDictDataVo"/>
<where>
<if test="dictType != null and dictType != ''">
AND dict_type = #{dictType}
</if>
<if test="dictLabel != null and dictLabel != ''">
AND dict_label like concat('%', #{dictLabel}, '%')
</if>
<if test="status != null and status != ''">
AND status = #{status}
</if>
</where>
order by dict_sort asc
</select>
<select id="selectDictDataByType" parameterType="SysDictType" resultMap="SysDictTypeResult">
<include refid="selectDictDataVo"/>
where status = '0' and dict_type = #{dictType} order by dict_sort asc
</select>
<select id="selectDictLabel" resultType="String">
select dict_label from base_dict_data
where dict_type = #{dictType} and dict_value = #{dictValue}
</select>
<select id="selectDictDataById" parameterType="Long" resultMap="SysDictTypeResult">
<include refid="selectDictDataVo"/>
where dict_code = #{dictCode}
</select>
<select id="countDictDataByType" resultType="Integer">
select count(1) from base_dict_data where dict_type=#{dictType}
</select>
<delete id="deleteDictDataById" parameterType="Long">
delete from base_dict_data where dict_code = #{dictCode}
</delete>
<delete id="deleteDictDataByIds" parameterType="Long">
delete from base_dict_data where dict_code in
<foreach collection="array" item="dictCode" open="(" separator="," close=")">
#{dictCode}
</foreach>
</delete>
<update id="updateDictData" parameterType="SysDictType">
update base_dict_data
<set>
<if test="dictSort != null">dict_sort = #{dictSort},</if>
<if test="dictLabel != null and dictLabel != ''">dict_label = #{dictLabel},</if>
<if test="dictValue != null and dictValue != ''">dict_value = #{dictValue},</if>
<if test="dictType != null and dictType != ''">dict_type = #{dictType},</if>
<if test="cssClass != null">css_class = #{cssClass},</if>
<if test="listClass != null">list_class = #{listClass},</if>
<if test="isDefault != null and isDefault != ''">is_default = #{isDefault},</if>
<if test="status != null">status = #{status},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = GETDATE()
</set>
where dict_code = #{dictCode}
</update>
<update id="updateDictDataType" parameterType="String">
update base_dict_data set dict_type = #{newDictType} where dict_type = #{oldDictType}
</update>
<insert id="insertDictData" parameterType="SysDictType">
insert into base_dict_data(
<if test="dictSort != null">dict_sort,</if>
<if test="dictLabel != null and dictLabel != ''">dict_label,</if>
<if test="dictValue != null and dictValue != ''">dict_value,</if>
<if test="dictType != null and dictType != ''">dict_type,</if>
<if test="cssClass != null and cssClass != ''">css_class,</if>
<if test="listClass != null and listClass != ''">list_class,</if>
<if test="isDefault != null and isDefault != ''">is_default,</if>
<if test="status != null">status,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
create_time
)values(
<if test="dictSort != null">#{dictSort},</if>
<if test="dictLabel != null and dictLabel != ''">#{dictLabel},</if>
<if test="dictValue != null and dictValue != ''">#{dictValue},</if>
<if test="dictType != null and dictType != ''">#{dictType},</if>
<if test="cssClass != null and cssClass != ''">#{cssClass},</if>
<if test="listClass != null and listClass != ''">#{listClass},</if>
<if test="isDefault != null and isDefault != ''">#{isDefault},</if>
<if test="status != null">#{status},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
GETDATE()
)
</insert>
</mapper>

@ -0,0 +1,106 @@
<?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.wms.mapper.BaseDictTypeMapper">
<resultMap type="SysDictType" id="SysDictTypeResult">
<id property="dictId" column="dict_id"/>
<result property="dictName" column="dict_name"/>
<result property="dictType" column="dict_type"/>
<result property="status" column="status"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<sql id="selectDictTypeVo">
select dict_id, dict_name, dict_type, status, create_by, create_time, remark
from base_dict_type
</sql>
<select id="selectDictTypeList" parameterType="SysDictType" resultMap="SysDictTypeResult">
<include refid="selectDictTypeVo"/>
<where>
<if test="dictName != null and dictName != ''">
AND dict_name like concat('%', #{dictName}, '%')
</if>
<if test="status != null and status != ''">
AND status = #{status}
</if>
<if test="dictType != null and dictType != ''">
AND dict_type like concat('%', #{dictType}, '%')
</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
and date_format(create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
</if>
</where>
</select>
<select id="selectDictTypeAll" resultMap="SysDictTypeResult">
<include refid="selectDictTypeVo"/>
</select>
<select id="selectDictTypeById" parameterType="Long" resultMap="SysDictTypeResult">
<include refid="selectDictTypeVo"/>
where dict_id = #{dictId}
</select>
<select id="selectDictTypeByType" parameterType="String" resultMap="SysDictTypeResult">
<include refid="selectDictTypeVo"/>
where dict_type = #{dictType}
</select>
<select id="checkDictTypeUnique" parameterType="String" resultMap="SysDictTypeResult">
select top 1 dict_id, dict_name, dict_type, status, create_by, create_time, remark
from base_dict_type
where dict_type = #{dictType}
</select>
<delete id="deleteDictTypeById" parameterType="Long">
delete from base_dict_type where dict_id = #{dictId}
</delete>
<delete id="deleteDictTypeByIds" parameterType="Long">
delete from base_dict_type where dict_id in
<foreach collection="array" item="dictId" open="(" separator="," close=")">
#{dictId}
</foreach>
</delete>
<update id="updateDictType" parameterType="SysDictType">
update base_dict_type
<set>
<if test="dictName != null and dictName != ''">dict_name = #{dictName},</if>
<if test="dictType != null and dictType != ''">dict_type = #{dictType},</if>
<if test="status != null">status = #{status},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = GETDATE()
</set>
where dict_id = #{dictId}
</update>
<insert id="insertDictType" parameterType="SysDictType">
insert into base_dict_type(
<if test="dictName != null and dictName != ''">dict_name,</if>
<if test="dictType != null and dictType != ''">dict_type,</if>
<if test="status != null">status,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
create_time
)values(
<if test="dictName != null and dictName != ''">#{dictName},</if>
<if test="dictType != null and dictType != ''">#{dictType},</if>
<if test="status != null">#{status},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
GETDATE()
)
</insert>
</mapper>

@ -37,6 +37,38 @@
<result property="enterpriseCode" column="Enterprise_Code"/>
</resultMap>
<resultMap type="OdsProductEmbryoInventoryCorrelation" id="OdsProductEmbryoInventoryCorrelationResult">
<result property="siteCode" column="Site_code"/>
<result property="ID" column="ID"/>
<result property="orderCode" column="Order_Code"/>
<result property="materialCode" column="Material_Code"/>
<result property="materialDesc" column="Material_Desc"/>
<result property="planDate" column="Plan_Date"/>
<result property="locNumber" column="Loc_Number"/>
<result property="unit" column="Unit"/>
<result property="realityNumber" column="Reality_Number"/>
<result property="orderStatus" column="Order_Status"/>
<result property="userDefined1" column="User_Defined1"/>
<result property="locCode" column="Loc_Code"/>
<result property="userDefined2" column="User_Defined2"/>
<result property="userDefined3" column="User_Defined3"/>
<result property="userDefined4" column="User_Defined4"/>
<result property="userDefined5" column="User_Defined5"/>
<result property="userDefined6" column="User_Defined6"/>
<result property="userDefined7" column="User_Defined7"/>
<result property="userDefined8" column="User_Defined8"/>
<result property="userDefined9" column="User_Defined9"/>
<result property="userDefined10" column="User_Defined10"/>
<result property="userDefined11" column="User_Defined11"/>
<result property="Remark" column="Remark"/>
<result property="createBy" column="Create_By"/>
<result property="createDate" column="Create_Date"/>
<result property="lastUpdateBy" column="Last_Update_By"/>
<result property="lastUpdateDate" column="Last_Update_Date"/>
<result property="Active" column="Active"/>
<result property="enterpriseId" column="Enterprise_Id"/>
<result property="enterpriseCode" column="Enterprise_Code"/>
</resultMap>
<sql id="selectOdsProductEmbryoInventoryVo">
select Site_code, ID, Order_Code, Material_Code, Material_Desc, Plan_Date, Loc_Number, Unit, Reality_Number, Order_Status, User_Defined1, Loc_Code, User_Defined2, User_Defined3, User_Defined4, User_Defined5, User_Defined6, User_Defined7, User_Defined8, User_Defined9, User_Defined10, User_Defined11, Remark, Create_By, Create_Date, Last_Update_By, Last_Update_Date, Active, Enterprise_Id, Enterprise_Code from ods_product_embryo_inventory
</sql>
@ -139,6 +171,133 @@
<include refid="selectOdsProductEmbryoInventoryVo"/>
where ID = #{ID}
</select>
<insert id="insertOdsProductEmbryoInventoryCorrelation" parameterType="OdsProductEmbryoInventoryCorrelation">
insert into ods_product_embryo_Inventory_correlation
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="siteCode != null">Site_code,
</if>
<if test="ID != null">ID,
</if>
<if test="orderCode != null">Order_Code,
</if>
<if test="materialCode != null">Material_Code,
</if>
<if test="materialDesc != null">Material_Desc,
</if>
<if test="planDate != null">Plan_Date,
</if>
<if test="locNumber != null">Loc_Number,
</if>
<if test="unit != null">Unit,
</if>
<if test="realityNumber != null">Reality_Number,
</if>
<if test="orderStatus != null">Order_Status,
</if>
<if test="userDefined1 != null">User_Defined1,
</if>
<if test="locCode != null">Loc_Code,
</if>
<if test="userDefined2 != null">User_Defined2,
</if>
<if test="userDefined3 != null">User_Defined3,
</if>
<if test="userDefined4 != null">User_Defined4,
</if>
<if test="userDefined5 != null">User_Defined5,
</if>
<if test="userDefined6 != null">User_Defined6,
</if>
<if test="userDefined7 != null">User_Defined7,
</if>
<if test="userDefined8 != null">User_Defined8,
</if>
<if test="userDefined9 != null">User_Defined9,
</if>
<if test="userDefined10 != null">User_Defined10,
</if>
<if test="userDefined11 != null">User_Defined11,
</if>
<if test="Remark != null">Remark,
</if>
<if test="createBy != null">Create_By,
</if>
<if test="createDate != null">Create_Date,
</if>
<if test="lastUpdateBy != null">Last_Update_By,
</if>
<if test="lastUpdateDate != null">Last_Update_Date,
</if>
<if test="Active != null">Active,
</if>
<if test="enterpriseId != null">Enterprise_Id,
</if>
<if test="enterpriseCode != null">Enterprise_Code,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="siteCode != null">#{siteCode},
</if>
<if test="ID != null">#{ID},
</if>
<if test="orderCode != null">#{orderCode},
</if>
<if test="materialCode != null">#{materialCode},
</if>
<if test="materialDesc != null">#{materialDesc},
</if>
<if test="planDate != null">#{planDate},
</if>
<if test="locNumber != null">#{locNumber},
</if>
<if test="unit != null">#{unit},
</if>
<if test="realityNumber != null">#{realityNumber},
</if>
<if test="orderStatus != null">#{orderStatus},
</if>
<if test="userDefined1 != null">#{userDefined1},
</if>
<if test="locCode != null">#{locCode},
</if>
<if test="userDefined2 != null">#{userDefined2},
</if>
<if test="userDefined3 != null">#{userDefined3},
</if>
<if test="userDefined4 != null">#{userDefined4},
</if>
<if test="userDefined5 != null">#{userDefined5},
</if>
<if test="userDefined6 != null">#{userDefined6},
</if>
<if test="userDefined7 != null">#{userDefined7},
</if>
<if test="userDefined8 != null">#{userDefined8},
</if>
<if test="userDefined9 != null">#{userDefined9},
</if>
<if test="userDefined10 != null">#{userDefined10},
</if>
<if test="userDefined11 != null">#{userDefined11},
</if>
<if test="Remark != null">#{Remark},
</if>
<if test="createBy != null">#{createBy},
</if>
<if test="createDate != null">#{createDate},
</if>
<if test="lastUpdateBy != null">#{lastUpdateBy},
</if>
<if test="lastUpdateDate != null">#{lastUpdateDate},
</if>
<if test="Active != null">#{Active},
</if>
<if test="enterpriseId != null">#{enterpriseId},
</if>
<if test="enterpriseCode != null">#{enterpriseCode},
</if>
</trim>
</insert>
<insert id="insertOdsProductEmbryoInventory" parameterType="OdsProductEmbryoInventory">
insert into ods_product_embryo_inventory
@ -372,4 +531,221 @@
#{ID}
</foreach>
</delete>
<select id="selectOdsProductEmbryoInventoryCorrelationList" parameterType="OdsProductEmbryoInventory" resultMap="OdsProductEmbryoInventoryCorrelationResult">
SELECT
Site_code,
ID,
Order_Code,
Material_Code,
Material_Desc,
Plan_Date,
Loc_Number,
Unit,
Reality_Number,
Order_Status,
User_Defined1,
Loc_Code,
User_Defined2,
User_Defined3,
User_Defined4,
User_Defined5,
User_Defined6,
User_Defined7,
User_Defined8,
User_Defined9,
User_Defined10,
User_Defined11,
Remark,
Create_By,
Create_Date,
Last_Update_By,
Last_Update_Date,
Active,
Enterprise_Id,
Enterprise_Code
FROM
ods_product_embryo_Inventory_correlation
<where>
<if test="siteCode != null and siteCode != ''">
and Site_code = #{siteCode}
</if>
<if test="orderCode != null and orderCode != ''">
and Order_Code = #{orderCode}
</if>
<if test="materialCode != null and materialCode != ''">
and Material_Code = #{materialCode}
</if>
<if test="materialDesc != null and materialDesc != ''">
and Material_Desc = #{materialDesc}
</if>
<if test="planDate != null ">
and Plan_Date = #{planDate}
</if>
<if test="locNumber != null ">
and Loc_Number = #{locNumber}
</if>
<if test="unit != null and unit != ''">
and Unit = #{unit}
</if>
<if test="realityNumber != null ">
and Reality_Number = #{realityNumber}
</if>
<if test="orderStatus != null and orderStatus != ''">
and Order_Status = #{orderStatus}
</if>
<if test="userDefined1 != null and userDefined1 != ''">
and User_Defined1 = #{userDefined1}
</if>
<if test="locCode != null and locCode != ''">
and Loc_Code = #{locCode}
</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="userDefined11 != null and userDefined11 != ''">
and User_Defined11 = #{userDefined11}
</if>
<if test="Remark != null and Remark != ''">
and Remark = #{Remark}
</if>
<if test="createBy != null and createBy != ''">
and Create_By = #{createBy}
</if>
<if test="createDate != null ">
and Create_Date = #{createDate}
</if>
<if test="lastUpdateBy != null and lastUpdateBy != ''">
and Last_Update_By = #{lastUpdateBy}
</if>
<if test="lastUpdateDate != null ">
and Last_Update_Date = #{lastUpdateDate}
</if>
<if test="Active != null and Active != ''">
and Active = #{Active}
</if>
<if test="enterpriseId != null and enterpriseId != ''">
and Enterprise_Id = #{enterpriseId}
</if>
<if test="enterpriseCode != null and enterpriseCode != ''">
and Enterprise_Code = #{enterpriseCode}
</if>
</where>
</select>
<update id="updateOdsProductEmbryoInventoryCorrelation" parameterType="OdsProductEmbryoInventory">
update ods_product_embryo_Inventory_correlation
<trim prefix="SET" suffixOverrides=",">
<if test="siteCode != null">Site_code =
#{siteCode},
</if>
<if test="orderCode != null">Order_Code =
#{orderCode},
</if>
<if test="materialCode != null">Material_Code =
#{materialCode},
</if>
<if test="materialDesc != null">Material_Desc =
#{materialDesc},
</if>
<if test="planDate != null">Plan_Date =
#{planDate},
</if>
<if test="locNumber != null">Loc_Number =
#{locNumber},
</if>
<if test="Unit != null">Unit =
#{Unit},
</if>
<if test="realityNumber != null">Reality_Number =
#{realityNumber},
</if>
<if test="orderStatus != null">Order_Status =
#{orderStatus},
</if>
<if test="userDefined1 != null">User_Defined1 =
#{userDefined1},
</if>
<if test="locCode != null">Loc_Code =
#{locCode},
</if>
<if test="userDefined2 != null">User_Defined2 =
#{userDefined2},
</if>
<if test="userDefined3 != null">User_Defined3 =
#{userDefined3},
</if>
<if test="userDefined4 != null">User_Defined4 =
#{userDefined4},
</if>
<if test="userDefined5 != null">User_Defined5 =
#{userDefined5},
</if>
<if test="userDefined6 != null">User_Defined6 =
#{userDefined6},
</if>
<if test="userDefined7 != null">User_Defined7 =
#{userDefined7},
</if>
<if test="userDefined8 != null">User_Defined8 =
#{userDefined8},
</if>
<if test="userDefined9 != null">User_Defined9 =
#{userDefined9},
</if>
<if test="userDefined10 != null">User_Defined10 =
#{userDefined10},
</if>
<if test="userDefined11 != null">User_Defined11 =
#{userDefined11},
</if>
<if test="Remark != null">Remark =
#{Remark},
</if>
<if test="createBy != null">Create_By =
#{createBy},
</if>
<if test="createDate != null">Create_Date =
#{createDate},
</if>
<if test="lastUpdateBy != null">Last_Update_By =
#{lastUpdateBy},
</if>
<if test="lastUpdateDate != null">Last_Update_Date =
#{lastUpdateDate},
</if>
<if test="Active != null">Active =
#{Active},
</if>
<if test="enterpriseId != null">Enterprise_Id =
#{enterpriseId},
</if>
<if test="enterpriseCode != null">Enterprise_Code =
#{enterpriseCode},
</if>
</trim>
where ID = #{ID}
</update>
</mapper>

@ -81,6 +81,7 @@
<if test="attr9 != null and attr9 != ''">and attr9 = #{attr9}</if>
<if test="attr10 != null and attr10 != ''">and attr10 = #{attr10}</if>
</where>
ORDER BY create_time DESC
</select>
<select id="selectWmsProductPutById" parameterType="String" resultMap="WmsProductPutResult">
@ -325,6 +326,10 @@
mes_report_work.end_report
</select>
<!-- <select id="selectWmsProductPutNum" resultType="java.lang.String">-->
<!-- </select>-->
<select id="selectWmsProductPutSAPByProDuct" parameterType="String" resultMap="WmsProductPutResult">
SELECT DISTINCT
wms_product_put.id,
@ -379,4 +384,5 @@
#{item.id}
</foreach>
</update>
</mapper>

Loading…
Cancel
Save