change - BOM名称、质量报表、定时任务

master
yinq 11 months ago
parent 3086181053
commit fe2795192e

@ -5,6 +5,8 @@ import com.aucma.api.domain.dto.SAPPortDto;
import com.aucma.api.domain.dto.WERKSDto;
import com.aucma.api.service.ISAPPortService;
import com.aucma.common.utils.DateUtils;
import com.aucma.production.domain.BaseBomInfo;
import com.aucma.production.service.IBaseBomInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@ -22,42 +24,53 @@ public class SAPTask {
@Autowired
private ISAPPortService portService;
@Autowired
private IBaseBomInfoService baseBomInfoService;
/**
* SAP
*
* @param days
* @param factoryCode
* @param startDays
* @param endDays
*/
public void SAPMaterialDataTask(String factoryCode, Long days) {
SAPPortDto sapPortDto = this.SAPRequestDataAssembly(factoryCode, days);
public void SAPMaterialDataTask(String factoryCode, Long startDays, Long endDays) {
SAPPortDto sapPortDto = this.SAPRequestDataAssembly(factoryCode, startDays, endDays);
portService.getSAPMaterialData(sapPortDto);
}
/**
*
*
* @param days
* @param factoryCode
* @param startDays
* @param endDays
*/
public void SAPProduceWorkTicketsDataTask(String factoryCode, Long days) {
SAPPortDto sapPortDto = this.SAPRequestDataAssembly(factoryCode, days);
public void SAPProduceWorkTicketsDataTask(String factoryCode, Long startDays, Long endDays) {
SAPPortDto sapPortDto = this.SAPRequestDataAssembly(factoryCode, startDays, endDays);
portService.getSapBaseOrderInfo(sapPortDto);
}
/**
*
*
* @param days
* @param factoryCode
* @param startDays
* @param endDays
*/
public void SAPDeviceLedgerDataTask(String factoryCode, Long days) {
SAPPortDto sapPortDto = this.SAPRequestDataAssembly(factoryCode, days);
public void SAPDeviceLedgerDataTask(String factoryCode, Long startDays, Long endDays) {
SAPPortDto sapPortDto = this.SAPRequestDataAssembly(factoryCode, startDays, endDays);
portService.getSapDeviceLedgers(sapPortDto);
}
/**
* bom
*
* @param days
* @param factoryCode
* @param startDays
* @param endDays
*/
public void SAPBaseBomInfoDataTask(String factoryCode, Long days) {
SAPPortDto sapPortDto = this.SAPRequestDataAssembly(factoryCode, days);
public void SAPBaseBomInfoDataTask(String factoryCode, Long startDays, Long endDays) {
SAPPortDto sapPortDto = this.SAPRequestDataAssembly(factoryCode, startDays, endDays);
SAPBOMPortDto sapbomPortDto = new SAPBOMPortDto();
sapbomPortDto.setStartDate(sapPortDto.getStartDate());
sapbomPortDto.setEndDate(sapPortDto.getEndDate());
@ -66,15 +79,25 @@ public class SAPTask {
}
/**
* BOM
*
*/
public void automaticSynchronizationBOM() {
baseBomInfoService.addAutomaticSynchronizationBOM(new BaseBomInfo());
}
/**
* SAP
* @param factoryCode
* @param days
* @param startDays
* @param endDays
* @return
*/
public SAPPortDto SAPRequestDataAssembly(String factoryCode, Long days) {
String startDate = DateUtils.convertDaysToDateString(days);
String endDate = DateUtils.getDate();
public SAPPortDto SAPRequestDataAssembly(String factoryCode, Long startDays, Long endDays) {
String startDate = DateUtils.convertDaysToDateString(startDays,0);
String endDate = DateUtils.convertDaysToDateString(endDays,1);
SAPPortDto sapPortDto = new SAPPortDto();
WERKSDto werksDto = new WERKSDto();
List<HashMap<String, String>> factoryList = new ArrayList<>();

@ -115,7 +115,7 @@
<if test="objId != null">#{objId},</if>
<if test="bomCode != null">#{bomCode},</if>
<if test="materialCode != null">#{materialCode},</if>
<if test="materialName != null">#{materialName},</if>
<if test="materialName != null">#{materialName,jdbcType=NVARCHAR},</if>
<if test="materialType != null">#{materialType},</if>
<if test="standardAmount != null">#{standardAmount},</if>
<if test="parentId != null">#{parentId},</if>
@ -137,7 +137,7 @@
<trim prefix="SET" suffixOverrides=",">
<if test="bomCode != null">bom_code = #{bomCode},</if>
<if test="materialCode != null">material_code = #{materialCode},</if>
<if test="materialName != null">material_name = #{materialName},</if>
<if test="materialName != null">material_name = #{materialName,jdbcType=NVARCHAR},</if>
<if test="materialType != null">material_type = #{materialType},</if>
<if test="standardAmount != null">standard_amount = #{standardAmount},</if>
<if test="parentId != null">parent_id = #{parentId},</if>

@ -191,16 +191,21 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
}
/**
* days
* daystype
* type: 0-1-
* @param days
* @return
*/
public static String convertDaysToDateString(Long days) {
public static String convertDaysToDateString(Long days, Integer type) {
// 获取当前日期
LocalDate currentDate = LocalDate.now();
LocalDate targetDate = null;
// 减去相应的天数
LocalDate targetDate = currentDate.minusDays(days);
if (type.equals(0)){
targetDate = currentDate.minusDays(days);
}else {
targetDate = currentDate.plusDays(days);
}
// 创建DateTimeFormatter对象指定日期格式
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");

@ -1,6 +1,7 @@
package com.aucma.production.service.impl;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import com.aucma.base.domain.BaseMaterialInfo;
@ -54,9 +55,44 @@ public class BaseBomInfoServiceImpl implements IBaseBomInfoService {
*/
@Override
public List<BaseBomInfo> selectBaseBomInfoList(BaseBomInfo baseBomInfo) {
List<BaseBomInfo> baseBomInfos = new ArrayList<>();
//测试查看全部BOM关系
if (StringUtils.isNotEmpty(baseBomInfo.getAncestors()) && baseBomInfo.getAncestors().equals("0")){
baseBomInfo.setMaterialCode(baseBomInfo.getMaterialCode());
baseBomInfo.setAncestors(null);
List<BaseBomInfo> baseBomInfos = baseBomInfoMapper.selectBaseBomInfoList(baseBomInfo);
baseBomInfos = baseBomInfoMapper.selectBaseBomInfoList(baseBomInfo);
return baseBomInfos;
}
//筛选子集BOM
if (StringUtils.isNotEmpty(baseBomInfo.getAncestors()) && baseBomInfo.getAncestors().startsWith("900")){
BaseBomInfo baseBomInfo1 = new BaseBomInfo();
baseBomInfo1.setParentId(baseBomInfo.getAncestors());
List<BaseBomInfo> baseBomInfos1 = baseBomInfoMapper.selectBaseBomInfoList(baseBomInfo1);
baseBomInfos.addAll(baseBomInfos1);
for (BaseBomInfo bomInfo : baseBomInfos1) {
BaseBomInfo baseBomInfo2 = new BaseBomInfo();
baseBomInfo2.setParentId(bomInfo.getMaterialCode());
List<BaseBomInfo> baseBomInfos2 = baseBomInfoMapper.selectBaseBomInfoList(baseBomInfo2);
baseBomInfos.addAll(baseBomInfos2);
for (BaseBomInfo info : baseBomInfos2) {
BaseBomInfo baseBomInfo4 = new BaseBomInfo();
baseBomInfo4.setParentId(info.getMaterialCode());
List<BaseBomInfo> baseBomInfos4 = baseBomInfoMapper.selectBaseBomInfoList(baseBomInfo4);
baseBomInfos.addAll(baseBomInfos4);
}
}
BaseBomInfo baseBomInfo3 = new BaseBomInfo();
baseBomInfo3.setMaterialCode(baseBomInfo.getAncestors());
List<BaseBomInfo> baseBomInfos3 = baseBomInfoMapper.selectBaseBomInfoList(baseBomInfo3);
baseBomInfos.addAll(baseBomInfos3);
return baseBomInfos;
}
if (StringUtils.isNotEmpty(baseBomInfo.getMaterialCode()) || StringUtils.isEmpty(baseBomInfo.getAncestors())){
baseBomInfo.setMaterialCode(baseBomInfo.getMaterialCode());
baseBomInfo.setAncestors(null);
baseBomInfos = baseBomInfoMapper.selectBaseBomInfoList(baseBomInfo);
return baseBomInfos;
}
return baseBomInfos;
}

@ -115,7 +115,7 @@
<if test="objId != null">#{objId},</if>
<if test="bomCode != null">#{bomCode},</if>
<if test="materialCode != null">#{materialCode},</if>
<if test="materialName != null">#{materialName},</if>
<if test="materialName != null">#{materialName,jdbcType=NVARCHAR},</if>
<if test="materialType != null">#{materialType},</if>
<if test="standardAmount != null">#{standardAmount},</if>
<if test="parentId != null">#{parentId},</if>
@ -135,7 +135,7 @@
<trim prefix="SET" suffixOverrides=",">
<if test="bomCode != null">bom_code = #{bomCode},</if>
<if test="materialCode != null">material_code = #{materialCode},</if>
<if test="materialName != null">material_name = #{materialName},</if>
<if test="materialName != null">material_name = #{materialName,jdbcType=NVARCHAR},</if>
<if test="materialType != null">material_type = #{materialType},</if>
<if test="standardAmount != null">standard_amount = #{standardAmount},</if>
<if test="parentId != null">parent_id = #{parentId},</if>

@ -71,4 +71,26 @@ public class QualityReportController extends BaseController {
return success(list);
}
/**
*
* @param hashMap
* @return
*/
@GetMapping("/temperatureRecordReportList")
public AjaxResult temperatureRecordReportList(@RequestParam(required = false) Map hashMap) {
List<HashMap<String, Object>> list = qualityReportService.temperatureRecordReportList(hashMap);
return success(list);
}
/**
*
* @param hashMap
* @return
*/
@GetMapping("/pourRecordReportList")
public AjaxResult pourRecordReportList(@RequestParam(required = false) Map hashMap) {
List<HashMap<String, Object>> list = qualityReportService.pourRecordReportList(hashMap);
return success(list);
}
}

@ -71,4 +71,18 @@ public interface GeneralReportMapper {
* @return
*/
List<HashMap<String, Object>> ScanOfflineRecordReportList(Map hashMap);
/**
*
* @param hashMap
* @return
*/
List<HashMap<String, Object>> temperatureRecordReportList(Map hashMap);
/**
*
* @param hashMap
* @return
*/
List<HashMap<String, Object>> pourRecordReportList(Map hashMap);
}

@ -41,4 +41,18 @@ public interface IQualityReportService
* @return
*/
List<HashMap<String, Object>> productTraceabilityReportList(Map hashMap);
/**
*
* @param hashMap
* @return
*/
List<HashMap<String, Object>> temperatureRecordReportList(Map hashMap);
/**
*
* @param hashMap
* @return
*/
List<HashMap<String, Object>> pourRecordReportList(Map hashMap);
}

@ -62,4 +62,24 @@ public class QualityReportServiceImpl implements IQualityReportService {
return reportMapper.productTraceabilityReportList(hashMap);
}
/**
*
* @param hashMap
* @return
*/
@Override
public List<HashMap<String, Object>> temperatureRecordReportList(Map hashMap) {
return reportMapper.temperatureRecordReportList(hashMap);
}
/**
*
* @param hashMap
* @return
*/
@Override
public List<HashMap<String, Object>> pourRecordReportList(Map hashMap) {
return reportMapper.pourRecordReportList(hashMap);
}
}

@ -66,6 +66,14 @@
SELECT *
FROM VIEW_PRODUCT_OFFLINE
</select>
<select id="temperatureRecordReportList" resultType="java.util.HashMap">
SELECT *
FROM VIEW_RECORD_TEMPERATURE
</select>
<select id="pourRecordReportList" resultType="java.util.HashMap">
SELECT *
FROM VIEW_PERFUSION_RECORD
</select>
</mapper>

Loading…
Cancel
Save