Commit b81cf180 by 李儒

test

parent b350c086
2024-05-15 23:08:51
2024-05-16 10:12:37
......@@ -17,22 +17,6 @@ public interface MobileRechargeService extends BaseService<MobileRecharge> {
List<MobileRecharge> findByExample(Specification<MobileRecharge> specification, RequestPage page);
List<MobileRecharge> findBySlingCode(String slingCode);
/**
* 根据载具编号获取最近灌料信息
*
* @param code
* @return
*/
MobileRecharge findLastBySlingCode(String code);
List<Map<String, Object>> rechargeDetail(String startTime, String endTime,Long start, Integer rows);
List<Map<String, Object>> rechargeDetailCount(String startTime, String endTime);
void create(MobileRecharge recharge) throws RuntimeException;
void backoff(Long id, BigDecimal backoffWeight, String backoffReason);
}
......@@ -37,18 +37,10 @@ public class MonitorEquipmentRechargeServiceImpl extends BaseServiceImpl<Monitor
this.monitorEquipmentRechargeDAO = monitorEquipmentRechargeDAO;
super.setBaseDao(monitorEquipmentRechargeDAO);
}
//
// @Autowired
// private TaskLogService taskLogService;
@Autowired
private EquipmentService equipmentService;
// @Autowired
// private EquipmentStateService equipmentStateService;
//
// @Autowired
// private AgvRequestService agvRequestService;
@Autowired
private RechargeArtBagItemService artBagItemService;
......@@ -182,92 +174,6 @@ public class MonitorEquipmentRechargeServiceImpl extends BaseServiceImpl<Monitor
}
}
// @Override
// public void initRechargeWeight(RechargeWeightDto dto) throws Exception {
//
// String deviceNo = dto.getDeviceNo();
// BigDecimal weight = dto.getWeight();
//
// MonitorEquipmentRecharge recharge = getByName(deviceNo);
//
// if (recharge == null) {
// recharge = new MonitorEquipmentRecharge();
// recharge.setName(deviceNo);
// recharge.initNum();
// recharge.setRechargeType(IPCRequest.TYPE_CHARGE);
// recharge.setPreSlingTime(dto.getPreSlingTime());
// recharge.setPareWeight(dto.getPareWeight().doubleValue());
// recharge.setState(1);
// recharge.setMixTime(null);
// recharge.setTechBom("");
// recharge.setTechBomItem("");
//
// EquipmentState state = equipmentStateService.getByCode(deviceNo);
// if (state != null) {
// recharge.setArea(state.getArea());
// recharge.setLotNo(state.getLotno());
// } else {
// recharge.setLotNo("");
// Equipment equipment = equipmentService.findByCode(deviceNo);
// if (equipment == null) {
// throw new Exception("编号[" + deviceNo + "]设备信息不存在!");
// }
// recharge.setArea(equipment.getArea());
// }
// } else {
// recharge.setPreSlingTime(dto.getPreSlingTime());
// recharge.setPareWeight(dto.getPareWeight().doubleValue());
// }
//
// if (StringUtils.isNotBlank(dto.getLotNo())) {
// recharge.setLotNo(dto.getLotNo());
// }
//
// int recount = 1;
// if (weight.compareTo(new BigDecimal(70)) >= 0) {
// recount = (int) Math.ceil(weight.doubleValue() / 70);
// recharge.setRechargeNum(recount);
// } else {
// recharge.setRechargeNum(recount);
// }
// recharge.setRechargeWeight(weight.doubleValue());
// recharge.setSlingState(IPCRequest.FUTOUHUJIAO);
// saveOrUpdate(recharge);
// }
// @Override
// public List<RechargeInfoDto> findPadSend(String userIp, String deviceCode) {
// if (StringUtils.isNotBlank(userIp)) {
// List<Map<String, Object>> mapList;
// if (StringUtils.isBlank(deviceCode)) {
// mapList = monitorEquipmentRechargeDAO.findPadSend(userIp);
// } else {
// mapList = monitorEquipmentRechargeDAO.findPadSend(userIp, deviceCode);
// }
// List<RechargeInfoDto> list = new ArrayList<>();
// if (mapList != null && mapList.size() > 0) {
// for (Map<String, Object> map : mapList) {
// if (map.containsKey("name")) {
// RechargeInfoDto dto = new RechargeInfoDto();
// dto.setName((String) map.get("name"));
// if (map.containsKey("preSlingTime")) {
// dto.setPreSlingTime((Date) map.get("preSlingTime"));
// }
// if (map.containsKey("rechargeType")) {
// dto.setRechargeType((String) map.get("rechargeType"));
// }
// list.add(dto);
// }
// }
// }
// return list;
// } else {
// if (StringUtils.isBlank(deviceCode))
// return monitorEquipmentRechargeDAO.findPadSend();
// return monitorEquipmentRechargeDAO.findPadSendByName(deviceCode);
// }
// }
@Override
public List<MonitorEquipmentRecharge> findByInitWeightAndPreSlingTime() {
return monitorEquipmentRechargeDAO.findByInitWeightAndPreSlingTime();
......@@ -292,53 +198,6 @@ public class MonitorEquipmentRechargeServiceImpl extends BaseServiceImpl<Monitor
}
}
// Double maxWeight = 70d;
// Double minWeight = 20d;
// List<String> items = dictionaryItemService.findItemValueByThemeValue("rechargeRange", true);
// if (items != null && items.size() > 0) {
// String item = items.get(0);
// String[] values = item.split("-");
// if (values.length == 2) {
// if (NumberUtil.isNumeric(values[0])) {
// minWeight = Double.valueOf(values[0]);
// }
// if (NumberUtil.isNumeric(values[1])) {
// maxWeight = Double.valueOf(values[1]);
// }
// }
// }
//
// handleSpcUrl();
// List<Equipment> equipmentList = equipmentService.findByDeviceId(3L);
//
// Map<String, Object> taskMap;
// String deviceNo;
// MonitorEquipmentRecharge recharge;
// for (Equipment item : equipmentList) {
// deviceNo = item.getCode();
// if (rechargeMap.containsKey(deviceNo)) {
//// taskMap = getSpcInfo(rechargeMap.get(deviceNo), maxWeight, minWeight);
// recharge = rechargeMap.remove(deviceNo);
// if (recharge.getSending() == null || !recharge.getSending()) {
// recharge.setSending(true);
// saveOrUpdate(recharge);
// continue;
// }
// }
// taskMap = new HashMap<>();
// taskMap.put("MES201", 0);
// taskMap.put("MES202", 0);
// taskMap.put("MES203", -1);
// taskMap.put("MES204", 0);
// taskMap.put("MES205", 0);
//
// try {
// taskLogService.task(deviceNo, taskMap);
// } catch (Exception ignored) {
// }
// }
}
@Override
......@@ -351,20 +210,9 @@ public class MonitorEquipmentRechargeServiceImpl extends BaseServiceImpl<Monitor
int recount = 1;
if (weight.compareTo(new BigDecimal(70)) >= 0) {
recount = (int) Math.ceil(weight.doubleValue() / 70);
// Integer count = (recount + 1) / 2;
// try {
// agvRequestService.agvStatus(deviceNo, deviceNo, 26, count, 1);
// } catch (Exception e) {
// throw new Exception(e.getMessage());
// }
recharge.setRechargeNum(recount);
} else {
// try {
// agvRequestService.agvStatus(deviceNo, deviceNo, 26, 1, 1);
// } catch (Exception e) {
// throw new Exception(e.getMessage());
// }
recharge.setRechargeNum(recount);
}
......@@ -416,9 +264,7 @@ public class MonitorEquipmentRechargeServiceImpl extends BaseServiceImpl<Monitor
}
}
// if (itemEntity.getCount() == null) {
itemEntity.setCount(BigDecimal.ZERO);
// }
itemEntity.setCreateTime(new Date());
itemEntity.setDeviceNo(deviceNo);
......
......@@ -56,187 +56,6 @@ public class RechargeArtBagServiceImpl extends BaseServiceImpl<RechargeArtBag> i
return record;
}
// @Autowired
// private StoreInputBillService storeInputBillService;
//
// @Autowired
// private StoreLocationService storeLocationService;
// @Override
// public void backOff(Long[] ids) throws Exception {
// StoreLocation storeLocation = storeLocationService.findByName("原料库");
// if (storeLocation == null) {
// throw new Exception("原料库库位不存在!");
// }
//
// createBill(ids, storeLocation);
// }
// public void createBill(Long[] ids, StoreLocation storeLocation) {
// StoreInputBillDto inputBill = new StoreInputBillDto();
// inputBill.setCode("GLTL-" + DateUtil.formatDate(new Date(), "yyyyMMdd") + (int) ((Math.random() * 9 + 1) * 100000));
// inputBill.setInputTypeDictId(null);
// inputBill.setInputTypeDictName("退料入库");
// inputBill.setCreateUserId(BaseContextHandler.getUserID());
// inputBill.setCreateUserName(BaseContextHandler.getUsername());
//
// List<StoreInputItemDto> itemDtos = new ArrayList<>();
//
// List<RechargeArtBagItemRecord> records = itemRecordService.findByRechargeIds(Arrays.asList(ids));
//
// for (RechargeArtBagItemRecord id : records) {
//
// StoreInputItemDto item = new StoreInputItemDto();
// item.setCount(id.getCount());
// MaterialModel model = id.getMaterialModel();
// if (model != null) {
// item.setGoodsCode(model.getCode());
// item.setMaterialModelId(model.getId());
// } else {
// item.setGoodsCode("");
// item.setMaterialModelId(0);
// }
//
// item.setRemark("");
// item.setGoodsNo(DateUtil.formatDate(new Date(), "yyyyMMddHHmmssSSS"));
// item.setStoreLocationId(storeLocation.getId());
// item.setProperties("");
//
// itemDtos.add(item);
// }
//
// inputBill.setStoreInputItemDtoDtos(itemDtos);
//
// // 入库
// storeInputBillService.backOff(inputBill);
// }
@Autowired
private MobileRechargeService mobileRechargeService;
// @Override
// public void backOff(RechargeBackoffDto dto) throws RuntimeException {
// StoreLocation storeLocation = storeLocationService.findByName("原料库");
// if (storeLocation == null) {
// throw new RuntimeException("原料库库位不存在!");
// }
// RechargeArtBag artBag = get(dto.getId());
// if (artBag == null) {
// throw new RuntimeException("物料搭配方案不存在!");
// }
//
// StoreInputBillDto inputBill = new StoreInputBillDto();
// inputBill.setCode("GLTL-" + DateUtil.formatDate(new Date(), "yyyyMMdd") + (int) ((Math.random() * 9 + 1) * 100000));
// inputBill.setInputTypeDictId(null);
// inputBill.setInputTypeDictName("退料入库");
// inputBill.setCreateUserId(BaseContextHandler.getUserID());
// inputBill.setCreateUserName(BaseContextHandler.getUsername());
//
// List<StoreInputItemDto> itemDtos = new ArrayList<>();
//
// List<RechargeBackoffItemDto> dtos = dto.getItemDtos();
// Map<Integer, RechargeBackoffItemDto> map = new HashMap<>();
// for (RechargeBackoffItemDto item: dtos) {
// if (item.getBackoffWeight() == null
// || item.getBackoffWeight().compareTo(BigDecimal.ZERO) <= 0) {
// throw new RuntimeException("物料" + item.getGoodsCode() + "退料重量异常!");
// }
// map.put(item.getId(), item);
// }
//
// List<RechargeArtBagItemRecord> records = itemRecordService.findByRechargeId(dto.getId());
//
// RechargeBackoffItemDto tempDto;
// BigDecimal backoffWeight = BigDecimal.ZERO;
// BigDecimal tempWeight;
// StringBuilder str = new StringBuilder();
// for (RechargeArtBagItemRecord record : records) {
//
// MaterialModel model = record.getMaterialModel();
// if (map.containsKey(record.getId())) {
// tempDto = map.get(record.getId());
// tempWeight = tempDto.getBackoffWeight();
//
// StoreInputItemDto item = new StoreInputItemDto();
//
// if (tempWeight.compareTo(record.getDosage()) > 0) {
// throw new RuntimeException("物料" + tempDto.getGoodsCode() + "退料重量大于搭配重量!");
// }
//
// item.setCount(tempWeight);
//
// backoffWeight = backoffWeight.add(tempWeight);
//
// if (model != null) {
// item.setGoodsCode(model.getCode());
// item.setMaterialModelId(model.getId());
// } else {
// item.setGoodsCode("");
// item.setMaterialModelId(0);
// }
//
// item.setRemark("");
// item.setGoodsNo(DateUtil.formatDate(new Date(), "yyyyMMddHHmmssSSS"));
// item.setStoreLocationId(storeLocation.getId());
// item.setProperties("");
//
// itemDtos.add(item);
//
// if (record.getBackoffWeight() == null) {
// record.setBackoffWeight(tempWeight);
// } else {
// record.setBackoffWeight(record.getBackoffWeight().add(tempWeight));
// }
//
// record.setDosage(record.getDosage().subtract(tempWeight));
//
//// artBag.setPareWeight(artBag.getPareWeight() - tempWeight.doubleValue());
// }
//
// if (model != null) {
// str.append(model.getCode()).append("-")
// .append(model.getName()).append("-")
// .append(model.getSupplier()).append("-")
// .append(record.getDosage());
// if (model.getUnit() != null) {
// str.append(model.getUnit().getName()).append(";");
// } else {
// str.append("KG").append(";");
// }
// }
//
// }
//
// inputBill.setStoreInputItemDtoDtos(itemDtos);
//
// // 入库
// storeInputBillService.backOff(inputBill);
//
// if (artBag.getBackoffWeight() == null || artBag.getBackoffWeight().compareTo(BigDecimal.ZERO) <= 0) {
// artBag.setBackoffWeight(backoffWeight);
// } else {
// artBag.setBackoffWeight(artBag.getBackoffWeight().add(backoffWeight));
// }
//
// if (StringUtils.isBlank(artBag.getBackoffReason())) {
// artBag.setBackoffReason(dto.getBackoffReason());
// } else {
// artBag.setBackoffReason(artBag.getBackoffReason() + "," + dto.getBackoffReason());
// }
//
// artBag.setTechBomItem(str.toString());
//
// saveOrUpdate(artBag);
//
// for (RechargeArtBagItemRecord record : records) {
// itemRecordService.saveOrUpdate(record);
// }
//
// mobileRechargeService.backoff(artBag.getId(), backoffWeight, dto.getBackoffReason());
// }
@Override
public RechargeArtBag getOneByDeviceNo(String deviceNo) {
return dao.getOneByDeviceNo(deviceNo);
......
......@@ -18,6 +18,7 @@ import com.sw.mes.core.entity.CrystalLossRecord;
import com.sw.mes.core.enums.EnumValuesFactory;
import com.sw.mes.core.enums.SectionIndexRangeEnum;
import com.sw.mes.core.enums.SeedMassageEnum;
import com.sw.mes.core.exception.BusinessException;
import com.sw.mes.core.response.ResponsePage;
import com.sw.mes.core.response.Result;
import com.sw.mes.core.response.ResultGenerator;
......@@ -168,7 +169,7 @@ public class YbInspectDataController {
}
EasyExcelUtils.write(response, YbInspectDataDto.class, "导出圆棒检验数据库", "导出圆棒检验数据库", dtos);
} catch (Exception e) {
throw new RuntimeException("方棒拼棒记录导出失败,错误信息:" + e.getMessage());
throw new BusinessException("方棒拼棒记录导出失败,错误信息:" + e.getMessage());
}
}
......@@ -456,11 +457,11 @@ public class YbInspectDataController {
@PostMapping("/getLongCrystalBySectionNo")
public Result<LongCrystal> getLongCrystal(@RequestBody @ApiParam(value = "晶段编号") MCSQuerryParam mcsQuerryParam) {
if (mcsQuerryParam == null || StringUtils.isEmpty(mcsQuerryParam.getSectionNo())) {
throw new RuntimeException("晶段编号不能为空!");
throw new BusinessException("晶段编号不能为空!");
}
String sectionNo = StringUtils.trim(mcsQuerryParam.getSectionNo());
if (sectionNo.length() < 13) {
throw new RuntimeException("晶段编号格式不正确!");
throw new BusinessException("晶段编号格式不正确!");
}
LongCrystal longCrystal = null;
String fromMark = sectionNo.substring(SectionIndexRangeEnum.基地追溯产品类型.getBeginIndex(), SectionIndexRangeEnum.基地追溯产品类型.getEndIndex());
......
package com.sw.mes.issue.controller;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
......@@ -126,36 +125,6 @@ public class YbIssueController {
return ResultGenerator.success(responsePage);
}
// /**
// * 联表查询
// * @param
// * @param requestPage
// * @return
// */
// @ApiOperation(value = "分页查询圆棒发料列表")
// @ApiImplicitParams({ @ApiImplicitParam(name = "rows", value = "行数", dataType = "integer", paramType = "query"),
// @ApiImplicitParam(name = "page", value = "页码", dataType = "integer", paramType = "query"),
// @ApiImplicitParam(name = "search_EQ_trayNo", value = "托号", dataType = "string", paramType = "query"),
// @ApiImplicitParam(name = "search_EQ_status", value = "状态", dataType = "integer", paramType = "query"),
// @ApiImplicitParam(name = "search_EQ_crystalNo", value = "单晶编号", dataType = "String", paramType = "query"),
// @ApiImplicitParam(name = "search_GTE_time", value = "开始时间", dataType = "Date", paramType = "query"),
// @ApiImplicitParam(name = "search_LTE_time", value = "结束时间", dataType = "Date", paramType = "query"),})
// @GetMapping("/listByPage")
// public Result<ResponsePage<YbIssueDto>> listByPage(String search_EQ_trayNo, Integer search_EQ_status, String search_GTE_time, String search_LTE_time,String search_EQ_crystalNo, @ApiIgnore RequestPage requestPage) {
// requestPage.setOrderField(null);
// if (StringUtils.isBlank(search_EQ_trayNo)) search_EQ_trayNo = null;
// if (StringUtils.isBlank(search_EQ_crystalNo)) search_EQ_crystalNo = null;
// if (StringUtils.isBlank(search_GTE_time)) search_GTE_time = null;
// if (StringUtils.isBlank(search_LTE_time)) search_LTE_time = null;
//
// ResponsePage<YbIssueDto> pageList = ybIssueService.getPageList(search_EQ_trayNo, search_EQ_status, search_GTE_time, search_LTE_time, search_EQ_crystalNo, PageUtil.createPageable(requestPage));
// return ResultGenerator.success(pageList);
// }
@ApiOperation(value = "导出圆棒发料记录接口")
@ApiImplicitParams({ @ApiImplicitParam(name = "trayNo", value = "托号", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "search_GTE_time", value = "开始时间", dataType = "String", paramType = "query"),
......
......@@ -133,15 +133,9 @@ public class YbIssueServiceImpl extends BaseServiceImpl<YbIssue> implements YbIs
// 等级为A1,A2的才能新增
YbInspectData bySectionNo = ybInspectDataService.findBySectionNo(dto.getCrystalNo());
if (null != bySectionNo) {
// if(null == bySectionNo.getProductType() || !bySectionNo.getGradeType().equals("正常"))
// {
// throw new RuntimeException("该单晶编号:" +dto.getCrystalNo() + "圆棒未评级");
// }
if (null == bySectionNo.getProductType() || null == bySectionNo.getProductLevel()) {
throw new RuntimeException("该单晶编号:" + dto.getCrystalNo() + "圆棒未评级");
}
//========================
// 增加卡控 ,防止晶棒类型(回收料、非回收料)与发料去向不匹配
if (StringUtils.isEmpty(bySectionNo.getGradeType())){
throw new RuntimeException("圆棒评级分类为空!");
......@@ -155,7 +149,6 @@ public class YbIssueServiceImpl extends BaseServiceImpl<YbIssue> implements YbIs
throw new RuntimeException(dto.getCrystalNo()+":该晶棒评级分类为:"+bySectionNo.getProductLevel()+",请选择去向:回收料");
}
}
//===========================
}
// 所有单晶编号
String crystalNo = ybIssueDetialService.findByCrystalNoAndIssueId(dto.getCrystalNo());
......@@ -365,12 +358,6 @@ public class YbIssueServiceImpl extends BaseServiceImpl<YbIssue> implements YbIs
EnumValuesFactory.WipStorageStatus.待进站.getKey());
// 单晶状态改为加工中
updatePlanProcessingOrder1(section);
// YbIssueDetial byIssueIdByCrystalNo = ybIssueDetialService.findByIssueIdByCrystalNo(section);
// YbIssue entity = new YbIssue();
// entity.setId(byIssueIdByCrystalNo.getIssueId());
// entity.setStatus(3);
// updateIssueStatus(entity);
}
public String trayNo() {
......
package com.sw.mes.kanban.controller;
import com.sw.mes.core.context.BaseContextHandler;
import com.sw.mes.core.response.ResponsePage;
import com.sw.mes.core.response.Result;
import com.sw.mes.core.response.ResultGenerator;
......@@ -25,8 +24,6 @@ import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.ServletRequest;
import javax.validation.Valid;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
......
......@@ -4,9 +4,6 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.*;
import javax.validation.constraints.*;
import java.math.BigDecimal;
import java.util.Date;
......
......@@ -4,9 +4,6 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.*;
import javax.validation.constraints.*;
import java.util.Date;
......
......@@ -4,8 +4,6 @@ import com.sw.mes.core.base.BaseService;
import com.sw.mes.kanban.dto.TotalProductionDto;
import com.sw.mes.kanban.entity.DailyProductionRecord;
import java.text.ParseException;
import java.util.Date;
import java.util.List;
import java.util.Map;
......
......@@ -5,22 +5,18 @@ import cn.hutool.core.collection.CollectionUtil;
import com.sw.mes.core.base.BaseServiceImpl;
import com.sw.mes.core.exception.BusinessException;
import com.sw.mes.core.utils.DateUtil;
import com.sw.mes.issue.entity.YbIssueRecord;
import com.sw.mes.kanban.dao.DailyProductionRecordDao;
import com.sw.mes.kanban.dto.TotalProductionDto;
import com.sw.mes.kanban.entity.DailyProductionRecord;
import com.sw.mes.kanban.service.DailyProductionRecordService;
import com.sw.mes.sap.reconciliation.sap.dao.SAPNativeSQL;
import com.sw.mes.utils.StringUtils;
import com.sw.mes.yb.production.entity.ProductionCircleRecipeDetail;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.SneakyThrows;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.LocalTime;
......@@ -134,7 +130,6 @@ public class DailyProductionRecordServiceImpl extends BaseServiceImpl<DailyProdu
public List<TotalProductionDto> findProductionByTime(String startTime, String endTime) {
List<TotalProductionDto> dtos = new ArrayList<>();
// Map<String, Object> map1 = dao.countByTypeAndTime(startTime,endTime,1);
TotalProductionDto dto1 = new TotalProductionDto();
dto1.setType(1);
//单晶收货
......@@ -147,7 +142,6 @@ public class DailyProductionRecordServiceImpl extends BaseServiceImpl<DailyProdu
}
dtos.add(dto1);
// Map<String, Object> map2 = dao.countByTypeAndTime(startTime,endTime,2);
TotalProductionDto dto2 = new TotalProductionDto();
dto2.setType(2);
//截断收货
......@@ -160,7 +154,6 @@ public class DailyProductionRecordServiceImpl extends BaseServiceImpl<DailyProdu
}
dtos.add(dto2);
// Map<String, Object> map3 = dao.countByTypeAndTime(startTime,endTime,3);
TotalProductionDto dto3 = new TotalProductionDto();
dto3.setType(3);
//刀剖收货
......@@ -193,19 +186,6 @@ public class DailyProductionRecordServiceImpl extends BaseServiceImpl<DailyProdu
Map.Entry::getValue,
(oldValue, newValue) -> oldValue, LinkedHashMap::new));
// List<DailyProductionRecord> records = dao.findByTypeAndTime(startTime,endTime);
// Map<Date,List<DailyProductionRecord>> maps = new LinkedHashMap<>();
// if(CollectionUtil.isNotEmpty(records)){
// maps = records.stream().collect(Collectors.groupingBy(DailyProductionRecord::getDate));
// }
// Map<Date, List<DailyProductionRecord>> sortedMap = maps.entrySet().stream()
// .sorted(Map.Entry.comparingByKey())
// .collect(Collectors.toMap(
// Map.Entry::getKey,
// Map.Entry::getValue,
// (oldValue, newValue) -> oldValue, LinkedHashMap::new));
return sortedMap;
}
......@@ -222,16 +202,6 @@ public class DailyProductionRecordServiceImpl extends BaseServiceImpl<DailyProdu
}
// public static void main(String[] args) {
// List<String> timeIntervals = splitTimeIntoDailyIntervals("2024-04-01 08:29:00", "2024-04-20 08:29:59");
// for(String date : timeIntervals){
// String[] s = date.split("to");
// System.out.println(s[0] + "到" +s[1]);
// }
//
// }
private static List<String> splitTimeIntoDailyIntervals(String start, String end) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
LocalDateTime startTime = LocalDateTime.parse(start, formatter);
......
......@@ -334,22 +334,6 @@ public class MMcsInterfaceServiceImpl implements MMcsInterfaceService {
if(key.equals("0"))
continue;
for (ProductionCircleWeightDetail _detail : infos) {
//TODO 实际业务要修改
// if(_detail.getRecipeKind().equals("ddl")) {//打底料
// dto.setBottomingWeight(convertBigDecimal(_detail.getWeight()));
// }else if(_detail.getRecipeKind().equals("dj")) {//多晶
// dto.setPolycrystalWeight(convertBigDecimal(_detail.getWeight()));
// }else if(_detail.getRecipeKind().equals("hsl")) {//回收料
// dto.setMonocrystalWeight(convertBigDecimal(_detail.getWeight()));
// }else if(_detail.getRecipeKind().equals("xzl")) {//小种类
// dto.setSmallsizeWeight(convertBigDecimal(_detail.getWeight()));
// }
//
// //重复设置 没关系
// dto.setTotalWeight(convertBigDecimal(_detail.getGross()));
}
}
dtos.add(dto);
......@@ -412,7 +396,6 @@ public class MMcsInterfaceServiceImpl implements MMcsInterfaceService {
dto.setFurnaceNo(task.getEquipmentCode());
dto.setPriority(convertBigDecimal(20));
dto.setMonocrystalTime(task.getEtTime());
//dto.setWeight(task.getWeight()!=null?task.getWeight():null);
try {
List<ProductionCircleWeightDtoVo> weightDtoVos = productionCircleWeightDetailService.getRecipeWeightDetailById(task.getWeigthId());
......@@ -513,50 +496,6 @@ public class MMcsInterfaceServiceImpl implements MMcsInterfaceService {
}
}
// else if(obj instanceof AgainTask) {//灌料任务 - 复投
// IssueMoDto dto = new IssueMoDto();
// AgainTask task = (AgainTask)obj;
// dto.setOrderNo(task.getRawType()+"-"+task.getId());
// dto.setOrderName(task.getEquipmentCode()+"-"+task.getLotNo()+"-"+task.getRawType());
// dto.setOrderType(task.getRawType()+"");
// dto.setCreateBy(task.getUserName());
// dto.setCreateTime(task.getGmtCreate());
// dto.setFormulaNo(task.getRecipeId()+"");
// dto.setSchemeNo(task.getWeigthId()+"");
// dto.setModuleNo(task.getArea());
// dto.setFurnaceSeries(task.getSeries());
// dto.setFurnaceNo(task.getEquipmentCode());
// dto.setPriority(convertBigDecimal(20));
// dto.setMonocrystalTime(task.getEtTime());
// dto.setWeight(task.getAgainWeigth()!=null?task.getAgainWeigth():null);
//
// List<IssueMoDto> dtos = new ArrayList<IssueMoDto>();
// dtos.add(dto);
//
// McsReturnResult result = MMCSHttpUtil.post(dic.getValue() + "/mes/api/issueMoInterface", dtos, 30000);
//
// try {
// SysLog syslog = new SysLog();
// syslog.setCreateTime(new Date());
// syslog.setType("info");
// syslog.setCreateUserId(BaseContextHandler.getUserID());
// syslog.setCreateUserName("MMCS");
// syslog.setContent(JSON.toJSONString(dtos));
// syslog.setResult(JSON.toJSONString(result));
// syslog.setCreateUserId(-1);
// syslog.setMethodName("issueMoInterface()");
// syslog.setStatus(1);
// syslog.setName("MES->MMCS下发生产任务接口");
// String serverAddr = dic.getValue() + "/mes/api/issueMoInterface";
// syslog.setServerAddr(serverAddr);
// syslog.setReqType("HTTP");
// syslog.setReqIp(IpUtils.getLocalIP());
// sysLogService.save(syslog);
// } catch (Exception e) {
// e.printStackTrace();
// }
// }
}catch (Exception e) {
// TODO: handle exception
}
......@@ -795,8 +734,6 @@ public class MMcsInterfaceServiceImpl implements MMcsInterfaceService {
child.setPailNum("0");
child.setNum(0);
//child.setAgainPailNum(tongNum);
//child.setPreDetailId(preDetailId);
child.setAgainWeigth(task.getAgainWeigth());
child.setAgainTime(task.getReportTime());//预计复投时间
child.setRawStatus(task.getRawStatus());
......
......@@ -2,7 +2,6 @@ package com.sw.mes.press;
import com.sw.mes.base.system.entity.InventoryManageInfo;
import com.sw.mes.base.system.service.InventoryManageInfoService;
import com.sw.mes.core.dto.mes.pc.yb.YbInspectDataDto;
import com.sw.mes.core.response.Result;
import com.sw.mes.core.response.ResultGenerator;
import com.sw.mes.inspect.dto.YbInspectDataCUDto;
......@@ -14,16 +13,13 @@ import com.sw.mes.yb.production.entity.AgainTaskDetail;
import com.sw.mes.yb.production.entity.LongCrystal;
import com.sw.mes.yb.production.service.AgainTaskDetailService;
import com.sw.mes.yb.production.service.LongCrystalService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal;
import java.util.List;
/**
......
......@@ -22,7 +22,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.excel.util.DateUtils;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.sw.mes.core.annotation.Jinko;
......
......@@ -10,6 +10,7 @@ import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import com.sw.mes.core.exception.BusinessException;
import org.modelmapper.ModelMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
......@@ -91,19 +92,7 @@ public class ReportSapGoodsmvtController
ResponsePage responsePage = new ResponsePage(dtos, page.getTotalElements());
return ResultGenerator.success(responsePage);
}
// @ApiOperation(value = "统计分析")
// @GetMapping("/statistics")
// public Result statistics(ServletRequest request) {
// Specification<ReportSapGoodsmvt> specification = DynamicSpecifications.bySearchFilter(request, ReportSapGoodsmvt.class);
// List<ReportSapGoodsmvt> reportSapGoodsmvts = reportSapGoodsmvtService.statistics(specification);
// List<ReportSapGoodsmvtDto> reportSapGoodsmvtDtos = reportSapGoodsmvts.stream()
// .map(reportSapGoodsmvt -> toLazyDto(reportSapGoodsmvt))
// .collect(Collectors.toList());
// return ResultGenerator.success(reportSapGoodsmvtDtos);
// }
@ApiOperation(value = "获取所有数据")
@GetMapping("/listAll")
......@@ -255,7 +244,7 @@ public class ReportSapGoodsmvtController
.collect(Collectors.toList());
EasyExcelUtils.write(response, ReportSapGoodsmvtDto.class, "导出报工列表", "导出报工列表", reportSapGoodsmvtsDtos);
} catch (IOException e) {
throw new RuntimeException("导出报工列表失败,错误信息:" + e.getMessage());
throw new BusinessException("导出报工列表失败,错误信息:" + e.getMessage());
}
}
......@@ -303,11 +292,11 @@ public class ReportSapGoodsmvtController
@PostMapping("/djshStatistics")
public List<Map<Object,Object>> djshStatistics(@RequestBody StatisticsDto dto) {
if(dto.getStartDate()==null) {
throw new RuntimeException("必选时间范围");
throw new BusinessException("必选时间范围");
}
if(dto.getEndDate()==null) {
throw new RuntimeException("必选时间范围");
throw new BusinessException("必选时间范围");
}
return reportSapGoodsmvtService.djshStatistics(dto);
......@@ -317,11 +306,11 @@ public class ReportSapGoodsmvtController
@PostMapping("/jdxhStatistics")
public List<Map<Object,Object>> jdxhStatistics(@RequestBody StatisticsDto dto) {
if(dto.getStartDate()==null) {
throw new RuntimeException("必选时间范围");
throw new BusinessException("必选时间范围");
}
if(dto.getEndDate()==null) {
throw new RuntimeException("必选时间范围");
throw new BusinessException("必选时间范围");
}
return reportSapGoodsmvtService.jdxhStatistics(dto);
......@@ -332,11 +321,11 @@ public class ReportSapGoodsmvtController
@PostMapping("/jdshStatistics")
public List<Map<Object,Object>> jdshStatistics(@RequestBody StatisticsDto dto) {
if(dto.getStartDate()==null) {
throw new RuntimeException("必选时间范围");
throw new BusinessException("必选时间范围");
}
if(dto.getEndDate()==null) {
throw new RuntimeException("必选时间范围");
throw new BusinessException("必选时间范围");
}
return reportSapGoodsmvtService.jdshStatistics(dto);
......@@ -347,11 +336,11 @@ public class ReportSapGoodsmvtController
@PostMapping("/dpxhStatistics")
public List<Map<Object,Object>> dpxhStatistics(@RequestBody StatisticsDto dto) {
if(dto.getStartDate()==null) {
throw new RuntimeException("必选时间范围");
throw new BusinessException("必选时间范围");
}
if(dto.getEndDate()==null) {
throw new RuntimeException("必选时间范围");
throw new BusinessException("必选时间范围");
}
return reportSapGoodsmvtService.dpxhStatistics(dto);
......@@ -369,7 +358,7 @@ public class ReportSapGoodsmvtController
Integer status = (Integer) map.get("status");
List<String> crystalNoList = (List<String>) map.get("crystalNoList");
if (!StringUtils.equals(procName,"刀剖消耗")){
throw new RuntimeException("非刀剖消耗,禁止修改!");
throw new BusinessException("非刀剖消耗,禁止修改!");
}
return ResultGenerator.success(reportSapGoodsmvtService.modifyAufnrByCrystalNo(procName,crystalNoList,status));
}
......
......@@ -17,7 +17,6 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -45,9 +44,6 @@ public class MesToSapScheduling {
@Autowired
private ProductionScheduleService productionScheduleService;
@Autowired
private DictionaryItemService dictionaryItemService;
/**
* 拉取erp订单job
*/
......@@ -59,14 +55,8 @@ public class MesToSapScheduling {
SwitchConfig config = GlobalSwitch.switchConfig(CODE_SWITCH, "scheduleReportArgonToSap", false);
if(config.isEnable()){
List<LoadingTask> byConfirmTime;
String time = config.getValue();
// if(null != time && !time.equals("")){
// byConfirmTime = loadingTaskService.findByConfirmTime(time,
// DateUtil.longSdf.format(DateUtil.getCurrentMonthLastDayEndTime8H()));
// } else {
byConfirmTime = loadingTaskService.findByConfirmTime(DateUtil.longSdf.format(DateUtil.addMonth(DateUtil.getCurrentMonthLastDayEndTime8H(), -1)),
DateUtil.longSdf.format(DateUtil.getCurrentMonthLastDayEndTime8H()));
// }
if(null != byConfirmTime && byConfirmTime.size() > 0){
List<String> collect = byConfirmTime.stream().map(loadingTask -> loadingTask.getLotNo()).collect(Collectors.toList());
List<CrystalPullingInfoLog> crystalPullingInfoLogByLotNos = crystalPullingInfoLogService.getCrystalPullingInfoLogByLotNos(collect);
......
package com.sw.mes.sap.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.google.gson.Gson;
import com.sw.mes.core.annotation.Jinko;
import com.sw.mes.core.annotation.ServiceLogs;
import com.sw.mes.core.base.BaseServiceImpl;
import com.sw.mes.core.dto.sap.ReportSapChargItemDto;
import com.sw.mes.core.dto.sap.ReportSapGoodsmvtDto;
import com.sw.mes.sap.dao.ReportSapGoodsmvtDao;
import com.sw.mes.sap.entity.RecycledReportSapRecord;
import com.sw.mes.sap.entity.ReportSapGoodsmvt;
import com.sw.mes.sap.service.RecycledReportSapRecordService;
import lombok.extern.slf4j.Slf4j;
import org.modelmapper.ModelMapper;
......
......@@ -65,14 +65,6 @@ public class ReportErpInputRecordServiceImpl extends BaseServiceImpl<ReportErpIn
@Autowired
private ErpRequestUtil erpRequestUtil;
@Autowired
private StoreFeignClients storeFeignClients;
@Autowired
private MaterialCleanModelService materialCleanModelService;
@Value("${spring.erpServiceUrl}")
private String erpServiceUrl;
......@@ -123,9 +115,6 @@ public class ReportErpInputRecordServiceImpl extends BaseServiceImpl<ReportErpIn
mesToErpCkdEntity.setCinvcode(byeErpOrderNo.getMatnr());
//todo 订单id暂时不对
mesToErpCkdEntity.setIproorderid(byeErpOrderNo.getTid());
//部门编号 无问题(数据库已填充该数据)
//mesToErpCkdEntity.setCdepcode(byeErpOrderNo.getDeptCode());
//部门名称
mesToErpCkdEntity.setCdepname(byeErpOrderNo.getWorkShop());
mesToErpCkdEntity.setImquantity(String.valueOf(byeErpOrderNo.getMenge()));
......@@ -169,58 +158,6 @@ public class ReportErpInputRecordServiceImpl extends BaseServiceImpl<ReportErpIn
}
//通过提供的表用料号 批次号 去查对应的关系
String code = detail.getMaterialCode();
// Result<StoreInputApplyDetailDto> result = storeFeignClients.findStoreInputApplyDetail(detail.getBatchNo());
// if(result.getCode().equals(ResultCode.SUCCESS.getCode())){
// StoreInputApplyDetailDto dto1 = result.getData();
// String batch = dto1.getErpBatchNo();
// if(StringUtils.isBlank(batch)){
// //截取删除最后四位再去查
// String batch1 = batchNo.substring(0, batchNo.length() - 4);
// PullErpWarehouseData data = pullErpWarehouseDataService.findData(batch1);
// if(data == null || !data.getCwhcode().equals("320")){
// continue;
// }
// mesToErpCkdDetailEntity.setCinvcode(data.getCinvcode());
// mesToErpCkdDetailEntity.setCbatch(data.getCbatch());
//
// }else{
// PullErpWarehouseData data = pullErpWarehouseDataService.findData(batch);
// if(data == null || !data.getCwhcode().equals("320")){
// continue;
// }
// mesToErpCkdDetailEntity.setCinvcode(data.getCinvcode());
// mesToErpCkdDetailEntity.setCbatch(data.getCbatch());
// }
// }else{
// //截取删除最后四位再去查
// String batch1 = batchNo.substring(0, batchNo.length() - 4);
// PullErpWarehouseData data = pullErpWarehouseDataService.findData(batch1);
// if(data == null || !data.getCwhcode().equals("320")){
// continue;
// }
// mesToErpCkdDetailEntity.setCinvcode(data.getCinvcode());
// mesToErpCkdDetailEntity.setCbatch(data.getCbatch());
// }
// mesToErpCkdDetailEntity.setCinvcode(detail.getMaterialCode());
// mesToErpCkdDetailEntity.setCbatch(detail.getBatchNo());
// String batch = "";
// if(result.getCode().equals(ResultCode.SUCCESS.getCode())){
// StoreInputApplyDetailDto dto1 = result.getData();
// batch = dto1.getErpBatchNo();
// if(StringUtils.isBlank(batch)){
// batch = batchNo.substring(0, batchNo.length() - 4);
// }
// }else{
// batch = batchNo.substring(0, batchNo.length() - 4);
//
// }
// MaterialCleanModel materialCleanModel = materialCleanModelService.findByNameAndCode(detail.getMaterialName(),detail.getMaterialCode());
// if(materialCleanModel == null){
// mesToErpCkdDetailEntity.setCinvcode(detail.getMaterialCode());
// }else{
// mesToErpCkdDetailEntity.setCinvcode(materialCleanModel.getFinishedCode());
// }
// mesToErpCkdDetailEntity.setCinvcode(detail.getMaterialCode());
mesToErpCkdDetailEntity.setCinvcode(code);
mesToErpCkdDetailEntity.setCbatch(batchNo);
mesToErpCkdDetailEntity.setCinvm_unit(byCode1.getUnit().getName());
......@@ -241,10 +178,6 @@ public class ReportErpInputRecordServiceImpl extends BaseServiceImpl<ReportErpIn
mesToErpCkdDetailEntity.setIrowno(String.valueOf(erpOrder.getIrowno()));
//默认1
mesToErpCkdDetailEntity.setIpesoseq(String.valueOf(erpOrder.getIpesoseq()));
// mesToErpCkdDetailEntity.setIpesodid();
// mesToErpCkdDetailEntity.setBcanreplace();
// mesToErpCkdDetailEntity.setCbatchproperty9();
mesToErpCkdDetailEntitys.add(mesToErpCkdDetailEntity);
}
......
......@@ -110,11 +110,8 @@ public class ReportErpOutputRecordServiceImpl extends BaseServiceImpl<ReportErpO
}
return ResultGenerator.success("上报成功");
}
// throw new RuntimeException(erpAddResultDto.getErrmsg());
}
return ResultGenerator.fail(erpAddResultDto.getErrmsg());
// throw new RuntimeException(erpAddResultDto.getErrmsg());
}
private ErpRequestDto packageData(ReportErpOutputRecord reportErpOutputRecord) {
......@@ -126,7 +123,6 @@ public class ReportErpOutputRecordServiceImpl extends BaseServiceImpl<ReportErpO
ProductionOrder byeErpOrderNo = productionOrderService.findByeErpOrderNo(orderNo);
if(null != byeErpOrderNo){
String date = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
// String date1 = LocalDate.now().format(DateTimeFormatter.ofPattern("yyMMdd"));
String date1 = DateUtil.packageDocDate(reportErpOutputRecord.getCreateTime());
String number = getNumber(date);
......@@ -151,8 +147,6 @@ public class ReportErpOutputRecordServiceImpl extends BaseServiceImpl<ReportErpO
}
mesToErpCcpEntity.setCinvm_unit(byCode.getUnit().getCode());
mesToErpCcpEntity.setIquantity(String.valueOf(byeErpOrderNo.getMenge()));
// mesToErpCcpEntity.setImpoids();
// mesToErpCcpEntity.setBrelated();
mesToErpCcpEntity.setCmocode(byeErpOrderNo.getAufnr());
mesToErpCcpEntity.setImoseq("1");
mesToErpCcpEntity.setIrowno("1");
......@@ -165,7 +159,6 @@ public class ReportErpOutputRecordServiceImpl extends BaseServiceImpl<ReportErpO
} else if (byeErpOrderNo.getWorkShop().equals("二车间")){
mesToErpCcpEntity.setCdepcode("1206");
}
// mesToErpCcpEntity.setCdepcode(byeErpOrderNo.getDeptCode());
mesToErpCcpEntity.setCdepname(byeErpOrderNo.getWorkShop());
}
......
......@@ -148,7 +148,6 @@ public class ReportErpSquareOutputRecordServiceImpl extends BaseServiceImpl<Repo
if (null != byeErpOrderNo) {
String date = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
// String date1 = LocalDate.now().format(DateTimeFormatter.ofPattern("yyMMdd"));
String date1 = DateUtil.packageDocDate(reportErpSquareOutputRecord.getCreateTime());
String number = getNumber(date);
String batchNo = null;
......@@ -157,7 +156,6 @@ public class ReportErpSquareOutputRecordServiceImpl extends BaseServiceImpl<Repo
} else {
batchNo = date1 + "1202" + number + "-" + byeErpOrderNo.getProductType() + byeErpOrderNo.getSideLengthRange();
}
//todo 批次号按样单拼接数据 目前拼接存在问题
mesToErpCkdEntity.setCbatch(batchNo);
//部门编号 无问题(数据库已填充该数据)
......@@ -166,13 +164,10 @@ public class ReportErpSquareOutputRecordServiceImpl extends BaseServiceImpl<Repo
} else {
mesToErpCkdEntity.setCdepcode("1202");
}
//部门名称
// mesToErpCkdEntity.setCdepname(byeErpOrderNo.getWorkShop());
}
if(null != byAufnr){
//需根据方棒订单查到物料编号
mesToErpCkdEntity.setCinvcode(byAufnr.getMatnr());
//todo 订单id暂时不对
mesToErpCkdEntity.setIproorderid(byAufnr.getTid());
//新封装数据
mesToErpCkdEntity.setImquantity(String.valueOf(byAufnr.getMenge()));
......@@ -215,7 +210,6 @@ public class ReportErpSquareOutputRecordServiceImpl extends BaseServiceImpl<Repo
mesToErpCkdDetailEntity.setCinvstd(byCode1.getSpecification());
//取生产订单
mesToErpCkdDetailEntity.setImoseq(byeErpOrderNo1.getAufnr());
//todo 查询工单信息表【erp_order】 此处有疑问???
ErpOrder erpOrder = new ErpOrder();
List<ErpOrder> byModIdAndInCode1 = erpOrderService.findByModIdAndInvCode1(byeErpOrderNo1.getModid(), byCode1.getMatnr());
if(!CollectionUtils.isEmpty(byModIdAndInCode1)){
......@@ -223,16 +217,11 @@ public class ReportErpSquareOutputRecordServiceImpl extends BaseServiceImpl<Repo
}
mesToErpCkdDetailEntity.setImpoids(String.valueOf(erpOrder.getComponentId()));
mesToErpCkdDetailEntity.setInquantity(String.valueOf(erpOrder.getIssQty()));
// mesToErpCkdDetailEntity.setIquantity(String.valueOf(erpOrder.getAuxQty()));
mesToErpCkdDetailEntity.setIquantity(String.valueOf(reportErpSquareOutputRecordDetail.getWeight()));//默认0
mesToErpCkdDetailEntity.setIorderdid(String.valueOf(erpOrder.getIorderdid()));
//默认1
mesToErpCkdDetailEntity.setIrowno(String.valueOf(erpOrder.getIrowno()));
//默认1
mesToErpCkdDetailEntity.setIpesoseq(String.valueOf(erpOrder.getIpesoseq()));
// mesToErpCkdDetailEntity.setIpesodid();
// mesToErpCkdDetailEntity.setBcanreplace();
ReportErpOutputRecordDetail byCrystalNo = reportErpOutputRecordDetailService.findByCrystalNo(reportErpSquareOutputRecordDetail.getCrystalNo());
if(null != byCrystalNo){
......@@ -240,7 +229,6 @@ public class ReportErpSquareOutputRecordServiceImpl extends BaseServiceImpl<Repo
} else {
throw new RuntimeException("未查询到长晶棒产成品报工批次");
}
// mesToErpCkdDetailEntity.setCbatchproperty9();
mesToErpCkdDetailEntityList.add(mesToErpCkdDetailEntity);
}
}
......
......@@ -103,8 +103,6 @@ public class ReportSapGoodsmvtServiceImpl extends BaseServiceImpl<ReportSapGoods
private CrystalMaterialRelationService crystalMaterialRelationService;
@Autowired
private WarehouseLocationService warehouseLocationService;
// @Autowired
// private SapGoodsmvtDataAsyncService sapGoodsmvtDataAsyncService;
@Autowired
......
......@@ -308,28 +308,28 @@ public class WipStorageYbController {
if (StringUtils.isNotBlank(wipStorageCode)) {
Equipment byCode = equipmentService.findByCode(deviceCode);
if (StringUtils.isBlank(deviceCode)) {
throw new RuntimeException("进站设备编号为空!进站工单号为:" + processingOrderCode);
throw new BusinessException("进站设备编号为空!进站工单号为:" + processingOrderCode);
}
if (null == byCode) {
throw new RuntimeException("进站设备台账记录不存在,请先核对设备编号:" + deviceCode + ";进站工单号为:" + processingOrderCode);
throw new BusinessException("进站设备台账记录不存在,请先核对设备编号:" + deviceCode + ";进站工单号为:" + processingOrderCode);
}
if (null == byCode.getDevice()) {
throw new RuntimeException("进站设备台账记录设备类型为空,请先核对设备编号:" + deviceCode + ";进站工单号为:" + processingOrderCode);
throw new BusinessException("进站设备台账记录设备类型为空,请先核对设备编号:" + deviceCode + ";进站工单号为:" + processingOrderCode);
}
if (StringUtils.equals(EnumValuesFactory.WipStorageCode.毛棒截断.getKey(), wipStorageCode)) {
if (!StringUtils.equals(byCode.getDevice().getName(), EnumValuesFactory.DeviceCategory.截断机.getValue())) {
throw new RuntimeException("截断进站设备非截断机设备,请先核对设备编号:" + deviceCode + ";设备类型为::" + byCode.getDevice().getName());
throw new BusinessException("截断进站设备非截断机设备,请先核对设备编号:" + deviceCode + ";设备类型为::" + byCode.getDevice().getName());
}
} else if (StringUtils.equals(EnumValuesFactory.WipStorageCode.圆棒检验.getKey(), wipStorageCode) || StringUtils.equals(EnumValuesFactory.WipStorageCode.开方.getKey(), wipStorageCode)) {
if (!StringUtils.equals(byCode.getDevice().getName(), "刀剖机")) {
throw new RuntimeException("刀剖进站设备非刀剖机设备,请先核对设备编号:" + deviceCode + ";设备类型为::" + byCode.getDevice().getName());
throw new BusinessException("刀剖进站设备非刀剖机设备,请先核对设备编号:" + deviceCode + ";设备类型为::" + byCode.getDevice().getName());
}
} else if (StringUtils.equals(EnumValuesFactory.WipStorageCode.磨倒.getKey(), wipStorageCode)) {
if (!StringUtils.equals(byCode.getDevice().getName(), "平磨机")) {
throw new RuntimeException("磨削进站设备非平磨机设备,请先核对设备编号:" + deviceCode + ";设备类型为::" + byCode.getDevice().getName());
throw new BusinessException("磨削进站设备非平磨机设备,请先核对设备编号:" + deviceCode + ";设备类型为::" + byCode.getDevice().getName());
}
}
}
......
package com.sw.mes.yb.accessory.service;
import com.sw.mes.core.exception.BusinessException;
import com.sw.mes.yb.accessory.dto.*;
import com.sw.mes.yb.accessory.entity.EquipmentAccessory;
import com.sw.mes.core.base.BaseService;
......@@ -19,9 +20,9 @@ import java.util.Map;
*/
public interface EquipmentAccessoryService extends BaseService<EquipmentAccessory> {
void saveOrUpdate(@Valid AccessoryChangeDto equipmentAccessoryDto) throws RuntimeException;
void saveOrUpdate(@Valid AccessoryChangeDto equipmentAccessoryDto) throws BusinessException;
void saveOrUpdate(@Valid EquipmentAccessoryDto equipmentAccessoryDto) throws RuntimeException;
void saveOrUpdate(@Valid EquipmentAccessoryDto equipmentAccessoryDto) throws BusinessException;
/**
* 根据设备ID
......@@ -37,11 +38,11 @@ public interface EquipmentAccessoryService extends BaseService<EquipmentAccessor
*/
void updateUseLife(Long materialId, Double useLife);
EquipmentAccessory saveOrUpdate(EquipAccessCreateDto dto) throws RuntimeException;
EquipmentAccessory saveOrUpdate(EquipAccessCreateDto dto) throws BusinessException;
void update(EquipAccessUpdateDto dto) throws RuntimeException;
void update(EquipAccessUpdateDto dto) throws BusinessException;
void change(EquipAccessChangeDto dto) throws RuntimeException;
void change(EquipAccessChangeDto dto) throws BusinessException;
EquipmentAccessory getByEquipment_idAndMaterial_id(Long equipmentId, Long materialId);
......
......@@ -6,6 +6,7 @@ import com.sw.mes.base.factory.init.service.EquipmentService;
import com.sw.mes.core.base.BaseServiceImpl;
import com.sw.mes.core.dto.MaterialOutDto;
import com.sw.mes.core.enums.EnumValues;
import com.sw.mes.core.exception.BusinessException;
import com.sw.mes.yb.accessory.dao.AccessoryApplyFeedbackDao;
import com.sw.mes.yb.accessory.dto.AccessoryApplyFeedbackDto;
import com.sw.mes.yb.accessory.entity.*;
......@@ -65,30 +66,18 @@ public class AccessoryApplyFeedbackServiceImpl extends BaseServiceImpl<Accessory
public void saveFeedback(AccessoryApplyFeedback accessoryApplyFeedback) {
AccessoryApply accessoryApply = accessoryApplyService.findByPickNo(accessoryApplyFeedback.getOrderNum());
if (accessoryApply == null){
throw new RuntimeException("退料单号"+accessoryApplyFeedback.getOrderNum()+"有误!");
throw new BusinessException("退料单号"+accessoryApplyFeedback.getOrderNum()+"有误!");
}
if (!EnumValues.PickInfoStatus.NOTCONFIRMED.getKey().equals(accessoryApply.getState())){
throw new RuntimeException(accessoryApplyFeedback.getOrderNum()+"请不要重复处理!");
throw new BusinessException(accessoryApplyFeedback.getOrderNum()+"请不要重复处理!");
}
EquipmentAccessory equipmentAccessory = accessoryApply.getEquipmentAccessory();
//AccessoryReturn accessoryReturn = accessoryReturnService.findByAccessoryId(equipmentAccessory.getId().intValue());
if (accessoryApplyFeedback.getType() == 1){
// if (accessoryReturn != null && EnumValues.AccessoryReturnStatus.REJECTED.getKey().equals(accessoryReturn.getState())){
// throw new RuntimeException(accessoryReturn.getOrderNum()+"辅料退库申请已拒绝!请拒绝辅料申请!");
// }
//申请记录状态改为 CONFIRMED("CONFIRMED","接收") 在发料(AccessoryMaterialOut)
accessoryApply.setAccessoryApplyFeedback(accessoryApplyFeedback);
}else {
// if (accessoryReturn != null && EnumValues.AccessoryReturnStatus.CONFIRMED.getKey().equals(accessoryReturn.getState())){
// //辅料退库已通过,要料申请拒绝
// }
// if (accessoryReturn != null && EnumValues.AccessoryReturnStatus.NOTCONFIRMED.getKey().equals(accessoryReturn.getState())){
// //辅料退库未处理,要料申请拒绝
// }
// if (accessoryReturn != null && EnumValues.AccessoryReturnStatus.REJECTED.getKey().equals(accessoryReturn.getState())){
// equipmentAccessory.setButtonStatus(1); //退库拒绝,要料申请也拒绝,也开放删除-对调-更换按钮
// }
accessoryApply.setState(EnumValues.PickInfoStatus.REJECTED.getKey());
accessoryApply.setStateDate(new Date());
accessoryApply.setAccessoryApplyFeedback(accessoryApplyFeedback);
......@@ -111,15 +100,15 @@ public class AccessoryApplyFeedbackServiceImpl extends BaseServiceImpl<Accessory
Equipment equipment = equipmentService.findByCode(accessoryMaterialOut.getDeviceNo());
if (equipment == null) {
throw new RuntimeException("该设备编号"+accessoryMaterialOut.getDeviceNo()+"在mes中不存在");
throw new BusinessException("该设备编号"+accessoryMaterialOut.getDeviceNo()+"在mes中不存在");
}
AccessoryMaterial accessoryMaterial = accessoryMaterialService.findByCodes(accessoryMaterialOut.getProductNo());
if (accessoryMaterial == null) {
throw new RuntimeException("该辅料模型"+accessoryMaterialOut.getProductNo()+"在mes易耗品模型(拉晶车间)中不存在");
throw new BusinessException("该辅料模型"+accessoryMaterialOut.getProductNo()+"在mes易耗品模型(拉晶车间)中不存在");
}
List<EquipmentAccessory> list = equipmentAccessoryService.findByGoodCodesWithBind(out.getUniqueCode());
if (list != null && list.size() > 0) {
throw new RuntimeException("uniqueCode唯一编码"+out.getUniqueCode()+"已存在");
throw new BusinessException("uniqueCode唯一编码"+out.getUniqueCode()+"已存在");
}
accessoryMaterialOut.setEquipment(equipment);
accessoryMaterialOut.setMaterial(accessoryMaterial);
......
......@@ -12,6 +12,7 @@ import com.sw.mes.core.dto.store.StoreOperatorDto;
import com.sw.mes.core.enums.EnumValues;
import com.sw.mes.core.enums.StoreBusinessTypeEnum;
import com.sw.mes.core.enums.StoreOperatorTypeEnum;
import com.sw.mes.core.exception.BusinessException;
import com.sw.mes.core.response.Result;
import com.sw.mes.core.response.ResultGenerator;
import com.sw.mes.base.factory.init.entity.Equipment;
......@@ -93,15 +94,9 @@ public class AccessoryApplyServiceImpl extends BaseServiceImpl<AccessoryApply> i
private RestTemplate restTemplate;
@Autowired
private AccessoryApplyService accessoryApplyService;
@Autowired
private EquipmentExtendStateService equipmentExtendStateService;
@Autowired
private AccessoryDiscardService accessoryDiscardService;
@Autowired
private StoreFeignClients storeFeignClients;
@Autowired
......@@ -131,10 +126,10 @@ public class AccessoryApplyServiceImpl extends BaseServiceImpl<AccessoryApply> i
}
@Override
public void apply(IdDto dto) throws RuntimeException {
public void apply(IdDto dto) throws BusinessException {
EquipmentAccessory accessory = equipmentAccessoryService.get(dto.getId());
if (accessory == null) {
throw new RuntimeException("监控信息不存在!");
throw new BusinessException("监控信息不存在!");
}
AccessoryReturn accessoryReturn = accessoryReturnService.findByAccessoryId(accessory.getId().intValue());
......@@ -142,30 +137,25 @@ public class AccessoryApplyServiceImpl extends BaseServiceImpl<AccessoryApply> i
accessory.getApplyButton() == 0
)
{
throw new RuntimeException("请先退库再申请要料!");
throw new BusinessException("请先退库再申请要料!");
}
if (accessoryReturn == null){
throw new RuntimeException("缺失对应的退库记录!");
throw new BusinessException("缺失对应的退库记录!");
}
if (!accessory.getGoodsCode().equals(accessoryReturn.getGoodsCode())){
if (EnumValues.AccessoryReturnStatus.NOTCONFIRMED.getKey().equals(accessoryReturn.getState())){
throw new RuntimeException("之前的退库请求还没被处理!");
throw new BusinessException("之前的退库请求还没被处理!");
}
} //防止先退库,再申请要料,要料出库后,还没处理之前的退库请求,再要料的现象发生。
AccessoryApply oldApply = findByApplyDateAndGoodsCode(accessoryReturn.getApplyDate(), accessory.getGoodsCode());
if (oldApply != null && EnumValues.PickInfoStatus.NOTCONFIRMED.getKey().equals(oldApply.getState())) {
throw new RuntimeException("当前监控有要料申请正在处理");
throw new BusinessException("当前监控有要料申请正在处理");
}
// AccessoryDiscard accessoryDiscard = accessoryDiscardService.findByReturnId(accessoryReturn.getId());
// if (accessoryDiscard.getOpinionOfProduct() == null && accessoryDiscard.getOpinionOfTechnology() == null && accessoryDiscard.getOpinionOfQuality() == null){
// throw new RuntimeException("该寿命监控报废记录还未被审核!");
// }
AccessoryApply apply = new AccessoryApply();
Result<UserDto> user = authFeignClient.getUserById(BaseContextHandler.getUserID());
if (user != null && user.getData()!=null){
......@@ -200,7 +190,7 @@ public class AccessoryApplyServiceImpl extends BaseServiceImpl<AccessoryApply> i
StoreOperatorDto storeOperatorDto = buildStoreOperatorDto(apply);
Result result = storeFeignClients.createOutputForSite(storeOperatorDto);
if (result == null || !result.getCode().equals(200)){
throw new RuntimeException("远程调用storeFeignClients.createForSite生成出库申请单失败:"+Optional.ofNullable(result).map(Result::getMessage).orElse(""));
throw new BusinessException("远程调用storeFeignClients.createForSite生成出库申请单失败:"+Optional.ofNullable(result).map(Result::getMessage).orElse(""));
}
}
......@@ -219,7 +209,7 @@ public class AccessoryApplyServiceImpl extends BaseServiceImpl<AccessoryApply> i
StoreOperatorDetailDto detailDto = new StoreOperatorDetailDto();
MaterialModel model = materialModelService.findByCode(apply.getMaterial().getCodes());
if (model == null) {
throw new RuntimeException("物料主数据缺失料号为"+apply.getMaterial().getCodes()+"的模型");
throw new BusinessException("物料主数据缺失料号为"+apply.getMaterial().getCodes()+"的模型");
}
detailDto.setMaterialModelId(model.getId());
detailDto.setMaterialModelCode(model.getCode());
......@@ -236,14 +226,12 @@ public class AccessoryApplyServiceImpl extends BaseServiceImpl<AccessoryApply> i
public String getPickNo(String deviceNo) {
StringBuilder str = new StringBuilder();
str.append("YLFL");
// str.append("-");
str.append(deviceNo);
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
String format = sdf.format(new Date());
str.append(format);
String uuid = UUID.randomUUID().toString();
String substring = uuid.substring(0, 5);
// str.append("-");
str.append(substring);
return str.toString();
}
......@@ -268,7 +256,7 @@ public class AccessoryApplyServiceImpl extends BaseServiceImpl<AccessoryApply> i
EquipmentAccessory equipmentAccessory = equipmentAccessoryService.getByEquipment_idAndMaterial_id(equipment.getId(), accessoryMaterial.getId());
if(equipmentAccessory == null){
throw new RuntimeException("不存在设备"+dto.getEquipmentCode()+"与料号"+dto.getMaterialCodes()+"绑定的热场监控");
throw new BusinessException("不存在设备"+dto.getEquipmentCode()+"与料号"+dto.getMaterialCodes()+"绑定的热场监控");
}
AccessoryReturn accessoryReturn = accessoryReturnService.findByAccessoryId(equipmentAccessory.getId().intValue());
......@@ -277,22 +265,22 @@ public class AccessoryApplyServiceImpl extends BaseServiceImpl<AccessoryApply> i
equipmentAccessory.getApplyButton() == 0
)
{
throw new RuntimeException("请先退库再申请要料!");
throw new BusinessException("请先退库再申请要料!");
}
if (accessoryReturn == null){
throw new RuntimeException("缺失对应的退库记录!");
throw new BusinessException("缺失对应的退库记录!");
}
if (!equipmentAccessory.getGoodsCode().equals(accessoryReturn.getGoodsCode())){
if (EnumValues.AccessoryReturnStatus.NOTCONFIRMED.getKey().equals(accessoryReturn.getState())){
throw new RuntimeException("之前的退库请求还没被处理!");
throw new BusinessException("之前的退库请求还没被处理!");
}
} //防止先退库,再申请要料,要料出库后,还没处理之前的退库请求,再要料的现象发生。
AccessoryApply oldApply = findByApplyDateAndGoodsCode(accessoryReturn.getApplyDate(), equipmentAccessory.getGoodsCode());
if (oldApply != null && EnumValues.PickInfoStatus.NOTCONFIRMED.getKey().equals(oldApply.getState())) {
throw new RuntimeException("当前监控有要料申请正在处理");
throw new BusinessException("当前监控有要料申请正在处理");
}
AccessoryApply apply = new AccessoryApply();
......@@ -329,7 +317,7 @@ public class AccessoryApplyServiceImpl extends BaseServiceImpl<AccessoryApply> i
StoreOperatorDto storeOperatorDto = buildStoreOperatorDto(apply);
Result result = storeFeignClients.createOutputForSite(storeOperatorDto);
if (result == null || !result.getCode().equals(200)){
throw new RuntimeException("远程调用storeFeignClients.createForSite生成出库申请单失败:"+Optional.ofNullable(result).map(Result::getMessage).orElse(""));
throw new BusinessException("远程调用storeFeignClients.createForSite生成出库申请单失败:"+Optional.ofNullable(result).map(Result::getMessage).orElse(""));
}
}
......
......@@ -8,6 +8,7 @@ import com.sw.mes.core.context.BaseContextHandler;
import com.sw.mes.core.dto.Convert;
import com.sw.mes.core.dto.auth.UserDto;
import com.sw.mes.core.enums.EnumValues;
import com.sw.mes.core.exception.BusinessException;
import com.sw.mes.core.response.Result;
import com.sw.mes.yb.accessory.dao.AccessoryMaterialOutDao;
import com.sw.mes.yb.accessory.dto.EquipAccessCreateDto;
......@@ -72,32 +73,28 @@ public class AccessoryMaterialOutServiceImpl extends BaseServiceImpl<AccessoryMa
AccessoryApply accessoryApply = accessoryApplyService.findByPickNo(accessoryMaterialOut.getPickNo());
if (accessoryApply == null){
throw new RuntimeException("要料单号"+accessoryMaterialOut.getPickNo()+"有误");
throw new BusinessException("要料单号"+accessoryMaterialOut.getPickNo()+"有误");
}
if (EnumValues.PickInfoStatus.REJECTED.getKey().equals(accessoryApply.getState())){
throw new RuntimeException("辅料要料申请"+accessoryMaterialOut.getPickNo()+"已拒绝!无法发料!");
throw new BusinessException("辅料要料申请"+accessoryMaterialOut.getPickNo()+"已拒绝!无法发料!");
}
if (EnumValues.PickInfoStatus.ENDDING.getKey().equals(accessoryApply.getState())){
throw new RuntimeException("辅料要料申请"+accessoryMaterialOut.getPickNo()+"已出库!");
throw new BusinessException("辅料要料申请"+accessoryMaterialOut.getPickNo()+"已出库!");
}
AccessoryReturn accessoryReturn = accessoryReturnService.findByAccessoryId(accessoryApply.getEquipmentAccessory().getId().intValue());
if (accessoryReturn != null && EnumValues.AccessoryReturnStatus.REJECTED.getKey().equals(accessoryReturn.getState())){
throw new RuntimeException("辅料退库申请"+accessoryReturn.getOrderNum()+"已拒绝!无法发料!");
throw new BusinessException("辅料退库申请"+accessoryReturn.getOrderNum()+"已拒绝!无法发料!");
}
String codes = accessoryApply.getMaterial().getCodes();
if (!accessoryMaterialOut.getEquipment().getId().equals(accessoryApply.getEquipment().getId())) {
throw new RuntimeException(accessoryMaterialOut.getPickNo()+"与所申请设备不同!");
throw new BusinessException(accessoryMaterialOut.getPickNo()+"与所申请设备不同!");
}
// if (!accessoryMaterialOut.getProductNo().equals(codes)){
// throw new RuntimeException(accessoryMaterialOut.getPickNo()+"与所申请辅料模型不同!");
// }
accessoryApply.setState(EnumValues.PickInfoStatus.ENDDING.getKey());
accessoryApply.setStateDate(new Date());
......@@ -184,7 +181,7 @@ public class AccessoryMaterialOutServiceImpl extends BaseServiceImpl<AccessoryMa
if (entity.getWarning()) { //TODO 可能需要改判定方式
if (entity.getMaterial().getUseLife() == null || entity.getMaterial().getWarnTime() == null) {
throw new RuntimeException("辅料编号:"+entity.getMaterial().getCodes()+"--额定寿命或预警寿命为空");
throw new BusinessException("辅料编号:"+entity.getMaterial().getCodes()+"--额定寿命或预警寿命为空");
}
Integer time = entity.getMaterial().getUseLife().intValue() - entity.getUseTime().intValue() - entity.getMaterial().getWarnTime().intValue();
Calendar date = Calendar.getInstance();
......
......@@ -3,6 +3,7 @@ package com.sw.mes.yb.accessory.service.impl;
import com.sw.mes.core.base.BaseServiceImpl;
import com.sw.mes.core.enums.EnumValues;
import com.sw.mes.core.exception.BusinessException;
import com.sw.mes.yb.accessory.dao.AccessoryReturnFeedbackDao;
import com.sw.mes.yb.accessory.dto.AccessoryReturnFeedbackDto;
import com.sw.mes.yb.accessory.entity.*;
......@@ -36,15 +37,6 @@ public class AccessoryReturnFeedbackServiceImpl extends BaseServiceImpl<Accessor
private AccessoryReturnService accessoryReturnService;
@Autowired
private EquipmentAccessoryService equipmentAccessoryService;
@Autowired
private AccessoryMaterialOutService accessoryMaterialOutService;
@Autowired
private AccessoryApplyService accessoryApplyService;
@Autowired
private AccessoryReturnFeedbackService accessoryReturnFeedbackService;
@Autowired
......@@ -55,10 +47,10 @@ public class AccessoryReturnFeedbackServiceImpl extends BaseServiceImpl<Accessor
public void saveFeedback(AccessoryReturnFeedback accessoryReturnFeedback) {
AccessoryReturn accessoryReturn = accessoryReturnService.findByOrderNum(accessoryReturnFeedback.getOrderNum());
if (accessoryReturn == null){
throw new RuntimeException("退料单号"+accessoryReturnFeedback.getOrderNum()+"有误!");
throw new BusinessException("退料单号"+accessoryReturnFeedback.getOrderNum()+"有误!");
}
if (!EnumValues.AccessoryReturnStatus.NOTCONFIRMED.getKey().equals(accessoryReturn.getState())){
throw new RuntimeException(accessoryReturnFeedback.getOrderNum()+"请不要重复处理!");
throw new BusinessException(accessoryReturnFeedback.getOrderNum()+"请不要重复处理!");
}
if(accessoryReturnFeedback.getType() == 1){
......
......@@ -17,6 +17,7 @@ import com.sw.mes.base.factory.init.entity.Equipment;
import com.sw.mes.base.factory.material.entity.Unit;
import com.sw.mes.core.enums.StoreBusinessTypeEnum;
import com.sw.mes.core.enums.StoreOperatorTypeEnum;
import com.sw.mes.core.exception.BusinessException;
import com.sw.mes.core.response.Result;
import com.sw.mes.yb.accessory.dao.AccessoryReturnDao;
import com.sw.mes.yb.accessory.dto.AccessoryReturnDto;
......@@ -70,7 +71,6 @@ public class AccessoryReturnServiceImpl extends BaseServiceImpl<AccessoryReturn>
@Autowired
//private UserService userService;
private AuthFeignClient authFeignClient;
@Autowired
......@@ -82,22 +82,13 @@ public class AccessoryReturnServiceImpl extends BaseServiceImpl<AccessoryReturn>
@Autowired
private AccessoryLogService accessoryLogService;
@Autowired
private AccessoryReturnService accessoryReturnService;
@Autowired
private EquipmentExtendStateService equipmentExtendStateService;
@Autowired
private AccessoryDiscardService accessoryDiscardService;
@Autowired
private StoreFeignClients storeFeignClients;
@Autowired
private MaterialModelService materialModelService;
@Autowired
private AccessoryMaterialOutService accessoryMaterialOutService;
// @Value("${wms.url}")
......@@ -118,15 +109,15 @@ public class AccessoryReturnServiceImpl extends BaseServiceImpl<AccessoryReturn>
public void accessoryReturn(ReturnCreateDto returnCreateDto) {
EquipmentAccessory accessory = equipmentAccessoryService.get(returnCreateDto.getEquipmentAccessoryId().longValue());
if (accessory == null) {
throw new RuntimeException("监控信息不存在!");
throw new BusinessException("监控信息不存在!");
}
if (accessory.getNum() == 0){
throw new RuntimeException("当前监控信息已解绑,无法退库!");
throw new BusinessException("当前监控信息已解绑,无法退库!");
}
if (accessory.getApplyButton() == 1){
throw new RuntimeException("已发起退库,请发起申请。");
throw new BusinessException("已发起退库,请发起申请。");
}
Integer num = returnCreateDto.getNum();
......@@ -138,7 +129,7 @@ public class AccessoryReturnServiceImpl extends BaseServiceImpl<AccessoryReturn>
AccessoryMaterialOut accessoryMaterialOut = accessoryMaterialOutService.findByPickNo(accessoryApply.getPickNo());
if (accessoryMaterialOut != null){
if (!accessoryMaterialOut.getUniqueCode().equals(accessory.getGoodsCode())){
throw new RuntimeException("当前记录已过期;原因:当前设备监控辅料不来自于该条申请!");
throw new BusinessException("当前记录已过期;原因:当前设备监控辅料不来自于该条申请!");
}
}
}
......@@ -147,10 +138,10 @@ public class AccessoryReturnServiceImpl extends BaseServiceImpl<AccessoryReturn>
if (num != null){
if (num < 0){
throw new RuntimeException("数量不得小于0");
throw new BusinessException("数量不得小于0");
}
if (num > accessory.getNum()){
throw new RuntimeException("退库数量大于库存量");
throw new BusinessException("退库数量大于库存量");
}
}
......@@ -193,23 +184,6 @@ public class AccessoryReturnServiceImpl extends BaseServiceImpl<AccessoryReturn>
equipmentAccessoryService.saveOrUpdate(accessory);
saveOrUpdate(accessoryReturn);
//生成报废记录
// AccessoryDiscard accessoryDiscard = new AccessoryDiscard();
// accessoryDiscard.setAccessory(accessory);
// accessoryDiscard.setEquipment(accessory.getEquipment());
// accessoryDiscard.setMaterial(accessory.getMaterial());
// accessoryDiscard.setUseTime(new BigDecimal(Optional.ofNullable(detail).map(EquipmentAccessoryListByPageDto::getUseTime).map(Object::toString).orElse("0")));
// accessoryDiscard.setOperateTime(accessory.getOperateDate());
// accessoryDiscard.setAccessoryReturn(accessoryReturn);
// accessoryDiscard.setGoodsCode(accessory.getGoodsCode());
// accessoryDiscard.setFactory(accessory.getFactory());
// accessoryDiscard.setReturnType(returnCreateDto.getReturnType());
// accessoryDiscard.setResult(EnumValues.AccessoryOpinionStatus.OPINION.getKey());
// accessoryDiscard.setCreateTime(new Date());
// accessoryDiscard.setCreateUser(BaseContextHandler.getUsername());
// accessoryDiscard.setCreateId(Optional.ofNullable(user).map(Result::getData).map(UserDto::getId).orElse(-1));
// accessoryDiscardService.saveOrUpdate(accessoryDiscard);
//退料给线边仓
StoreOperatorDto storeOperatorDto = buildStoreOperatorDto(accessoryReturn);
storeOperatorDto.setStoreBusinessTypeEnum(StoreBusinessTypeEnum.辅料退线);
......@@ -219,11 +193,6 @@ public class AccessoryReturnServiceImpl extends BaseServiceImpl<AccessoryReturn>
if (stringResult == null || !stringResult.getCode().equals(200)){
throw new RuntimeException("远程调用storeFeignClients.inputStoreBill线边仓入库单失败:"+Optional.ofNullable(stringResult).map(Result::getMessage).orElse(""));
}
// Result<String> stringResult1 = storeFeignClients.calculateStock(storeOperatorDto);
// if (stringResult1 == null || !stringResult1.getCode().equals(200)){
// throw new RuntimeException("远程调用storeFeignClients.calculateStock线边仓增加库存失败:"+Optional.ofNullable(stringResult).map(Result::getMessage).orElse(""));
// }
}
private StoreOperatorDto buildStoreOperatorDto(AccessoryReturn accessoryReturn) {
......
......@@ -4,6 +4,7 @@ package com.sw.mes.yb.accessory.service.impl;
import com.sw.mes.base.system.entity.DictionaryItem;
import com.sw.mes.core.base.BaseServiceImpl;
import com.sw.mes.base.system.service.DictionaryItemService;
import com.sw.mes.core.exception.BusinessException;
import com.sw.mes.core.utils.DateUtil;
import com.sw.mes.enumvalue.EnumValuesEap;
import com.sw.mes.base.factory.init.entity.Equipment;
......@@ -58,7 +59,7 @@ public class EquipmentDeviceStatusServiceImpl extends BaseServiceImpl<EquipmentD
public void createDeviceStatus(EapToMesDeviceStatusVo dto) {
Equipment equipment = equipmentService.findByCode(dto.getDeviceCode());
if (equipment == null){
throw new RuntimeException("该设备不存在");
throw new BusinessException("该设备不存在");
}
EquipmentDeviceStatus status = findByDeviceNo(dto.getDeviceCode());
Date date = null;
......@@ -106,7 +107,7 @@ public class EquipmentDeviceStatusServiceImpl extends BaseServiceImpl<EquipmentD
}
}
}else {
throw new RuntimeException("设备修改信号不正确!");
throw new BusinessException("设备修改信号不正确!");
}
}
......@@ -121,7 +122,7 @@ public class EquipmentDeviceStatusServiceImpl extends BaseServiceImpl<EquipmentD
try{
Equipment equipment = equipmentService.findByCode(dto.getEquipmentCode());
if (equipment == null){
throw new RuntimeException("该设备不存在");
throw new BusinessException("该设备不存在");
}
EquipmentDeviceStatus status = findByDeviceNo(dto.getEquipmentCode());
Date date = new Date();
......@@ -164,7 +165,7 @@ public class EquipmentDeviceStatusServiceImpl extends BaseServiceImpl<EquipmentD
}
}
}else {
throw new RuntimeException("设备修改信号不正确!");
throw new BusinessException("设备修改信号不正确!");
}
}catch (Exception e){
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
......
......@@ -139,7 +139,6 @@ public class FlsToMesController {
}
sectionInfoDto.setSideLength(sideLength);
sectionInfoDto.setIsBevel(inspectDataBase.getIsBevel());
// sectionInfoDto.setProductTypeSecond(inspectDataBase.getConductiveType());
return ResultGenerator.success(sectionInfoDto);
}
......@@ -244,7 +243,6 @@ public class FlsToMesController {
@PostMapping(value = "/matchMakeTrayRule")
public Result matchMakeTrayRule(@RequestBody BindingDto bindingDto) {
try {
// return flsToMesService.matchMakeTrayRule(bindingDto);
return flsToMesService.matchMakeTrayRuleV2(bindingDto);
} catch (Exception e) {
return ResultGenerator.message(500, "系统异常:" + e.getMessage(), null);
......
......@@ -57,19 +57,6 @@ public class MesToFlsController {
@ApiOperation(value = "更新KfReturnMaterial")
@PostMapping("/update")
public Result callAgv() {
// try {
// Equipment equipment = equipmentService.findByCode(dto.getEquipmentCode());
// String targetPoint = EnumValuesAgv.EquipmentAreaBLHCK.getText(equipment.getArea());
//
// AgvCallDto agvCall = new AgvCallDto();
// agvCall.setKeyword(EnumValuesAgv.AGVKeyword.开方自动退料.getValue());//关键字 根据配置中的信息固定写入 : 圆棒送验
// agvCall.setStartPoint(dto.getEquipmentCode()); //起始位置编号 - 当前传入机台号
// agvCall.setTargetPoint(targetPoint);//结束工作位
// //其他信息可根据配置信息自动填充
// String taskCode = agvDispatchService.callAgv(agvCall);
// } catch (Exception e) {
// throw new RuntimeException(e.getMessage());
// }
return null;
}
......
......@@ -25,16 +25,12 @@ public class PaintingLineInfoDetailDto {
String no;
@ApiModelProperty(name ="晶段长度" )
BigDecimal length;
// @ApiModelProperty(name ="晶段重量" )
// BigDecimal weight;
@ApiModelProperty(name ="直径" )
String diameter;
@ApiModelProperty(name ="" )
Integer isCut;
@ApiModelProperty(name ="圆方棒标识 0圆棒 1是方棒" )
Integer crystalType;
// @ApiModelProperty(name ="是否拼棒 0否 1是" )
// Integer isJoin;
@ApiModelProperty(name ="段号" )
Integer segmentNum;
@ApiModelProperty(name ="样片类型" )
......
......@@ -11,8 +11,6 @@ import lombok.Data;
@ApiModel(value = "晶段信息获取接口Dto")
@Data
public class SectionInfoDto {
// @ApiModelProperty(value = "规格/实际规格")
// String productTypeSecond;
@ApiModelProperty(value = "长度")
String actualLength;
@ApiModelProperty(value = "平均直径")
......
......@@ -161,9 +161,6 @@ public class KfReturnMaterialServiceImpl extends BaseServiceImpl<KfReturnMateria
entity.setProductLevelExperiment(tempInspectDataBase.getProductLevelExperiment());
entity.setProductTypeSecond(tempInspectDataBase.getProductTypeSecond());
entity.setActualLength(tempInspectDataBase.getActualLength());
// entity.setActualWeight(tempInspectDataBase.getActualWeight());
// entity.setFineCutLength(tempInspectDataBase.getFineCutLength());
// entity.setCollapseLine(tempInspectDataBase.getCollapseLine());
entity.setSectionType(tempInspectDataBase.getSectionType());
entity.setReCheckType(tempInspectDataBase.getReCheckType());
entity.setBackCutType(null != tempInspectDataBase.getIsCutBack() && tempInspectDataBase.getIsCutBack().equals(1) ? "是" : "否");
......@@ -176,7 +173,7 @@ public class KfReturnMaterialServiceImpl extends BaseServiceImpl<KfReturnMateria
List<String> sectionNoList = Optional.ofNullable(items).orElse(new ArrayList<>()).stream().map(TurnstoreInItem::getSectionNo).collect(Collectors.toList());
//添加判断非拒收单晶不能重复退料
if (turnstoreInItemService.getIsReturnRecordBySectionNoList(sectionNoList, purpose)) {
throw new RuntimeException("退库中,已申请或已入库的托号不可重复退料!");
throw new BusinessException("退库中,已申请或已入库的托号不可重复退料!");
}
}
......
package com.sw.mes.yb.fls.service.impl;
import com.sw.mes.core.annotation.ServiceLogs;
import com.sw.mes.core.response.Result;
import com.sw.mes.yb.fls.dto.*;
import com.sw.mes.yb.fls.service.MesToFlsService;
import com.sw.mes.yb.fls.utils.*;
......@@ -33,8 +32,6 @@ public class MesToFlsServiceImpl implements MesToFlsService {
@Value("${spring.fls3ServiceUrl}")
private String fls3ServiceUrl;
// @Value("${spring.fls2ServiceUrl}")
// private String fls2ServiceUrl;
@Override
public ResultDto callAgv(CallAGVDto callAGVDto) {
......
......@@ -2,12 +2,8 @@ package com.sw.mes.yb.mcs.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.sw.mes.base.system.entity.DictionaryItem;
import com.sw.mes.base.system.service.DictionaryItemService;
import com.sw.mes.core.enums.SectionIndexRangeEnum;
import com.sw.mes.core.response.Result;
import com.sw.mes.core.response.ResultGenerator;
import com.sw.mes.inspect.entity.YbInspectData;
import com.sw.mes.inspect.service.YbInspectDataService;
import com.sw.mes.utils.StringUtils;
import com.sw.mes.yb.fls.dto.BindingDto;
......@@ -22,8 +18,6 @@ import com.sw.mes.yb.mcs.entity.CodingRecord;
import com.sw.mes.yb.mcs.service.CodingRecordService;
import com.sw.mes.yb.mcs.service.YbMcsToMesService;
import com.sw.mes.yb.mcs.vo.HiddenCrackDetectionVo;
import com.sw.mes.yb.pad.service.ProductionPaintingLineService;
import com.sw.mes.yb.pc.service.SideSkinCodingRuleService;
import com.sw.mes.yb.production.entity.AgainTaskDetail;
import com.sw.mes.yb.production.entity.AgainTaskPrepare.AgainTaskPrepare;
import com.sw.mes.yb.production.entity.LoadingTask;
......@@ -43,10 +37,7 @@ import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* @Author: GaoXinJian
......@@ -62,24 +53,17 @@ public class McsToMesController {
YbMcsToMesService mcsToMesService;
@Autowired
FlsToMesService flsToMesService;
@Autowired
private SideSkinCodingRuleService sideSkinCodingRuleService;
@Autowired
private LongCrystalService longCrystalService;
@Autowired
private DictionaryItemService dictionaryItemService;
@Autowired
private CodingRecordService codingRecordService;
@Autowired
private YbInspectDataService ybInspectDataService;
@Autowired
private AgainTaskService againTaskService;
@Autowired
private LoadingTaskService loadingTaskService;
@Autowired
......@@ -88,15 +72,11 @@ public class McsToMesController {
@Autowired
private AgainTaskPrepareService againTaskPrepareService;
@Autowired
private ProductionPaintingLineService productionPaintingLineService;
@ApiOperation(value = "晶段检验过点上传接口")
@PostMapping("/segmentCheckInfo")
public Result segmentCheckInfo(@RequestBody SegmentCheckInfoDto segmentCheckInfoDto, HttpServletRequest request, HttpServletResponse response) {
mcsToMesService.segmentCheckInfo(segmentCheckInfoDto);
// log.info(segmentCheckInfoDto.toString());
return ResultGenerator.success();
}
......@@ -149,65 +129,11 @@ public class McsToMesController {
int len = segmentNo.length();
String crystalNo = segmentNo.substring(0, 16);
// String fromMark = segmentNo.substring(SectionIndexRangeEnum.基地追溯产品类型.getBeginIndex(), SectionIndexRangeEnum.基地追溯产品类型.getEndIndex());
// if (fromMark.matches("[A-Z]+")) {
// crystalNo = segmentNo.substring(SectionIndexRangeEnum.毛棒范围.getBeginIndex(), SectionIndexRangeEnum.毛棒范围.getEndIndex());
// }
//查询长晶棒产出表
LongCrystal byCrystalNo = longCrystalService.findByCrystalNo(crystalNo);
if (byCrystalNo == null) {
return ResultGenerator.fail("晶棒编号不存在!");
}
// List<DictionaryItem> toMCSProductSpec = dictionaryItemService.findByThemeValueAndEnable("ToMCSProductSpecNew", true);
// Map<String, DictionaryItem> specMap = toMCSProductSpec.stream().collect(Collectors.toMap(DictionaryItem::getName, Function.identity(), (t1, t2) -> t1));
// String productType = byCrystalNo.getSpecs();
// if (specMap.containsKey(productType)) {
//
// productTypeResult = specMap.get(productType).getValue();
//// byCrystalNo.setProductType(specMap.get(productType).getValue());
// }
//边长范围
// List<DictionaryItem> multipleSideLogics = dictionaryItemService.findByThemeValueAndEnable("multipleSideLogic", true);
// if (null != multipleSideLogics) {
// Map<String, DictionaryItem> multipleSideLogicMap = multipleSideLogics.stream().collect(Collectors.toMap(DictionaryItem::getName, Function.identity(), (t1, t2) -> t1));
// String sideLengthRange = byCrystalNo.getSideLengthRange();
// if (multipleSideLogicMap.containsKey(sideLengthRange)) {
//// byCrystalNo.setSideLengthRange(multipleSideLogicMap.get(sideLengthRange).getExtendValue1());
// sideLengthRangeResult = multipleSideLogicMap.get(sideLengthRange).getExtendValue1();
// }
// }
//
// JSONObject jsonObject = new JSONObject();
// //增加 是否打打码、规格、前边皮、后边皮
// //String skinCoding = sideSkinCodingRule == null ? null : sideSkinCodingRule.getCodeMark();
// //前边皮编码
// jsonObject.put("frontSkinCoding", "");
// //后边皮编码
// jsonObject.put("backSkinCoding", "");
// //规格:晶段编号截取4-6
//
//// jsonObject.put("productType", productTypeResult);
// String productGrade = byCrystalNo.getProductGrade();
// jsonObject.put("level", StringUtils.equals(byCrystalNo.getProductGrade(), "-") ? "A1" : byCrystalNo.getProductGrade());
// if (productGrade.contains("A1")) {
// jsonObject.put("level", "A1");
// }
// YbInspectData bySectionNo = ybInspectDataService.findBySectionNo(segmentNo);
// List<CodingRecord> codingRecordBySectionNo = codingRecordService.getCodingRecordBySectionNo(segmentNo);
// if (null != bySectionNo && null != bySectionNo.getProductLevel() && null != codingRecordBySectionNo && codingRecordBySectionNo.size() > 1) {
// if (bySectionNo.getProductLevel().contains("A1")) {
// jsonObject.put("level", "A1");
// }
// if (bySectionNo.getProductLevel().contains("A2")) {
// jsonObject.put("level", "A2");
// }
// }
// //是否打码:有规则打码,无规则不打码
// jsonObject.put("isCoding", true);
// // 拼接规则:掺杂剂-规格-等级
// jsonObject.put("productGrade", byCrystalNo.getDopant() + "-" + jsonObject.getString("productType") + "-" + jsonObject.getString("level") + "-" + sideLengthRangeResult);
return ResultGenerator.success();
}
......@@ -429,7 +355,6 @@ public class McsToMesController {
@PostMapping(value = "/matchMakeTrayRuleForMCS")
public Result matchMakeTrayRuleMcs(@RequestBody BindingDto bindingDto) {
try {
// return flsToMesService.matchMakeTrayRule(bindingDto);
return flsToMesService.matchMakeTrayRuleV2(bindingDto);
} catch (Exception e) {
return ResultGenerator.message(500, "系统异常:" + e.getMessage(), null);
......
......@@ -8,11 +8,9 @@ import com.sw.mes.core.dto.RankResultDto;
import com.sw.mes.core.dto.store.WarehouseInventoryBo;
import com.sw.mes.core.response.Result;
import com.sw.mes.core.response.ResultGenerator;
import com.sw.mes.production.dto.FormulaSchemeDto;
import com.sw.mes.yb.mcs.dto.*;
import com.sw.mes.yb.mcs.dto.fillingMaterial.*;
import com.sw.mes.yb.mcs.dto.fillingMaterial.MoTrayBindingToMcs.MaterialPropertyDto;
import com.sw.mes.yb.mcs.entity.SegmentInspectionPassPointInfo;
import com.sw.mes.yb.mcs.service.YbMesToMcsService;
import com.sw.mes.yb.mcs.utils.ResultDto;
import com.sw.mes.yb.production.entity.AgainTask;
......@@ -24,7 +22,6 @@ import com.sw.mes.yb.production.service.AgainTaskPrepareService;
import com.sw.mes.yb.production.service.AgainTaskService;
import com.sw.mes.yb.production.service.LoadingTaskService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
......@@ -34,7 +31,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
import java.util.List;
import java.util.stream.Collectors;
......
package com.sw.mes.yb.mcs.controller;
import com.sw.mes.core.context.BaseContextHandler;
import com.sw.mes.core.response.ResponsePage;
import com.sw.mes.core.response.Result;
import com.sw.mes.core.response.ResultGenerator;
......@@ -20,9 +19,7 @@ import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
import com.sw.mes.yb.mcs.entity.RecycledMaterialCase;
......
package com.sw.mes.yb.mcs.controller;
import com.sw.mes.core.context.BaseContextHandler;
import com.sw.mes.core.response.ResponsePage;
import com.sw.mes.core.response.Result;
import com.sw.mes.core.response.ResultGenerator;
......@@ -20,9 +19,7 @@ import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
import com.sw.mes.yb.mcs.entity.RecycledMaterialCaseRecord;
......
package com.sw.mes.yb.mcs.controller;
import com.sw.mes.core.context.BaseContextHandler;
import com.sw.mes.core.response.ResponsePage;
import com.sw.mes.core.response.Result;
import com.sw.mes.core.response.ResultGenerator;
......@@ -20,9 +19,7 @@ import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
import com.sw.mes.yb.mcs.entity.SegmentInspectionPassPointInfo;
......
......@@ -51,6 +51,4 @@ public class CrystalTrayBindInfoDto {
String mix;
@ApiModelProperty(value = "去向:(检验、应急下料口)")
String hasGone;
// @ApiModelProperty(value = "圆棒类型(1头棒、2中间棒、3尾棒、4其他)")
// String posType;
}
......@@ -50,9 +50,6 @@ public class IssueMoToMcsDto {
@ApiModelProperty(value = "复投次数")
private Integer againNum;
// @ApiModelProperty(value = "任务优先级")
// private String priority;
@ApiModelProperty(value = "预计投料时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date againTime;
......
......@@ -25,6 +25,4 @@ public class McsMaterialDto {
private String vesselNo;
@ApiModelProperty(value = "单位")
private String unit;
// @ApiModelProperty(value = "线边仓库位编码")
// private String storeLocationCode;
}
......@@ -23,8 +23,6 @@ public class MoWarehousingBindingToMcsDto {
String forkliftLocationCode;
@ApiModelProperty(value = "物料编号")
String materialNo;
// @ApiModelProperty(value = "物料属性")
// MaterialDetailDto materialDetailInfo;
@ApiModelProperty(value = "物料属性")
String materialDetailInfo;
@ApiModelProperty(value = "库位状态:0 空,1空物料,2 已满, 3锁定, 10异常锁定")
......
......@@ -38,7 +38,6 @@ public class PlanWaterLineManageToWmsEventListener implements SmartApplicationLi
public void onApplicationEvent(ApplicationEvent applicationEvent) {
PlanWaterLineManageToWmsEvent planWaterLineManageToWmsEvent=(PlanWaterLineManageToWmsEvent) applicationEvent;
PlanWaterLineManageToWmsDto planWaterLineManageToWmsDto = planWaterLineManageToWmsEvent.getPlanWaterLineManageToWmsDto();
// mesToMcsService.planWaterLineManageToWmsDto(planWaterLineManageToWmsDto);
mesToFlsService.planWaterLineManageToWmsDto(planWaterLineManageToWmsDto);
}
......
......@@ -35,10 +35,6 @@ public class RankResultEventListener implements SmartApplicationListener {
@Lazy
@Autowired
private RatingResultService ratingResultService;
// @Autowired
// ProductionBindingTrayService productionBindingTrayService;
// @Autowired
// InventoryManageInfoService inventoryManageInfoService;
@Override
public boolean supportsEventType(Class<? extends ApplicationEvent> aClass) {
return aClass == RankResultEvent.class;
......@@ -50,74 +46,17 @@ public class RankResultEventListener implements SmartApplicationListener {
RankResultEvent rankResultEvent = (RankResultEvent) applicationEvent;
//下发mes
RankResultDto rankResultDto = rankResultEvent.rankResultDto;
// String sectionType = rankResultDto.getType();
// BigDecimal length = null;
if (rankResultDto.getIsCutBack() != null && rankResultDto.getIsCutBack() == 1){
rankResultDto.setType("反切");
}else{
if (rankResultDto.getSticksCount() != null && rankResultDto.getSticksCount().compareTo(1) > 0){
rankResultDto.setType("拼棒");
// length = rankResultDto.getLength();
}
}
String crystalNo = rankResultDto.getCrystalNo();
String sectionNo = rankResultDto.getSectionNo();
// if(!"外观反切".equals(rankResultDto.getGradeType())) {
// Boolean aBoolean = productionPaintingLineDetailService.flowDirectionV2(crystalNo, sectionNo, "评级结果下发");
// if (aBoolean) {
// rankResultDto.setType("完结尾");
// }
// }
rankResultDto.setCrystalLength(rankResultDto.getLength());
mesToMcsService.rankResult(rankResultDto);
// requestUtilsWms.postForWms(new RequestWmsDto(rankResultUrl,rankResultDto, 2));
//mq
ratingResultService.ratingResult(rankResultDto);
// //下发wms
// try{
// //查询是否为wms入库晶段
// InventoryManageInfo oneByRoundSnOrderByIdDesc = inventoryManageInfoService.findOneByRoundSnAndCrystalTypeOrderByIdDesc(rankResultDto.getSectionNo(),0);
// if (oneByRoundSnOrderByIdDesc != null){
// log.info("圆棒评级结果下发开始");
// //查询托盘绑定信息
// RatingResultDto ratingResultDto = new RatingResultDto();
// ProductionBindingTray productionBindingTray = productionBindingTrayService.getByCrystalNo(rankResultDto.getSectionNo());
// if (productionBindingTray != null){
// ratingResultDto.setTrayCode(productionBindingTray.getTrayNo());
// }
// ratingResultDto.setSectionNo(rankResultDto.getCrystalNo());
// ratingResultDto.setRoundSn(rankResultDto.getSectionNo());
// ratingResultDto.setProductLevel(rankResultDto.getProductRank());
// ratingResultDto.setProductLevelExperiment(rankResultDto.getTestRank());
// ratingResultDto.setData(sectionType);
// ratingResultDto.setSectionType(sectionType);
// ratingResultDto.setProductType(rankResultDto.getSpecs());
// ratingResultDto.setWareHouseLength(rankResultDto.getWareHouseLength());
// ratingResultDto.setActualLength(rankResultDto.getActualLength());
// ratingResultDto.setSpellBarLength(length);
// ratingResultDto.setActualWeight(rankResultDto.getActualWeight());
// ratingResultDto.setTheoryWeight(rankResultDto.getTheoryWeight());
// ratingResultDto.setDiameterMin(rankResultDto.getDiameterMin());
// ratingResultDto.setDiameterMax(rankResultDto.getDiameterMax());
// ratingResultDto.setDiameterJudge(rankResultDto.getDiameterJudge());
// ratingResultDto.setDistortion(rankResultDto.getDistortion());
// ratingResultDto.setIsBevel(rankResultDto.getIsBevel());
// ratingResultDto.setConductiveType(rankResultDto.getConductiveType());
// ratingResultDto.setFineDiameter(rankResultDto.getFineDiameter());
// ratingResultDto.setFineCutLength(rankResultDto.getFineCutLength());
// ratingResultDto.setPiecewiseNum(rankResultDto.getPiecewiseNum());
// ratingResultDto.setOrderNo(rankResultDto.getOrderNo());
// ratingResultDto.setAgainNum(rankResultDto.getAgainNum());
// ratingResultDto.setHeadTailRecognition(rankResultDto.getHeadTailRecognition());
// ratingResultDto.setIsSeeBottom(rankResultDto.getIsSeeBottom());
// ratingResultDto.setLineMarking(rankResultDto.getLineMarking());
// ratingResultDto.setIsCutBack(rankResultDto.getIsCutBack());
// ResultWmsDto resultWmsDto = ratingResultService.ratingResult(ratingResultDto);
// log.info("圆棒评级结果下发结束"+resultWmsDto);
// }
// }catch(Exception e){
//
// }
}
}
......@@ -77,8 +77,6 @@ public class PublishRankResultImpl implements PublishRankResultService {
*/
SysLog syslog = null;
try {
//if ("正常".equals(rankResultDto.getGradeType())) {
// PlanWaterLineManageRecord planWaterLineManageRecord = planWaterLineManageService.selectOneOrder(rankResultDto.getDopant(), rankResultDto.getConductiveType(), rankResultDto.getSpecs(), rankResultDto.getYbInspectDataToMcsDto().getProductType());
PlanWaterLineManageRecord planWaterLineManageRecord = null;
String ybLevel = "%" + rankResultDto.getProductRank() + "%";
YbInspectData bySectionNo = ybInspectDataService.findBySectionNo(rankResultDto.getSectionNo());
......@@ -86,39 +84,14 @@ public class PublishRankResultImpl implements PublishRankResultService {
List<PlanWaterLineManageRecord> planWaterLineManageRecords = planWaterLineManageService.selectOrders(rankResultDto.getDopant(), rankResultDto.getConductiveType(), rankResultDto.getSpecs(),rankResultDto.getSideLengthRange(), ybLevel, "%" + resLevel + "%");
planWaterLineManageRecord = planWaterLineManageRecords.get(0);
// if(null != planWaterLineManageRecords && planWaterLineManageRecords.size() > 0){
// for (PlanWaterLineManageRecord waterLineManageRecord : planWaterLineManageRecords) {
// String productType = rankResultDto.getYbInspectDataToMcsDto().getProductType();
// String[] split = waterLineManageRecord.getProductType().split(",");
// for (String s : split) {
// if(s.equals(productType)){
// planWaterLineManageRecord = waterLineManageRecord;
// break;
// }
// }
// }
// }
if (planWaterLineManageRecord != null) {
// rankResultDto.setOrderNo(planWaterLineManageRecord.getAufnr());
//更换下发的订单字段
rankResultDto.setWaterLineManageOrderNo(planWaterLineManageRecord.getAufnr());
YbInspectDataToMcsDto ybInspectDataToMcsDto = rankResultDto.getYbInspectDataToMcsDto();
//更换下发的订单字段
// ybInspectDataToMcsDto.setOrderNo(planWaterLineManageRecord.getAufnr());
ybInspectDataToMcsDto.setWaterLineManageOrderNo(planWaterLineManageRecord.getAufnr());
//todo if(!StringUtils.isBlank(rankResultDto.getProductRank()) && rankResultDto.getProductRank().equals("晶昇A2") && !StringUtils.isBlank(rankResultDto.getSectionNo())){
// if(!StringUtils.isBlank(rankResultDto.getProductRank()) && rankResultDto.getProductRank().equals("A2") && !StringUtils.isBlank(rankResultDto.getSectionNo())){
// List<CodingRecord> codingRecordBySectionNo = codingRecordService.getCodingRecordBySectionNo(rankResultDto.getSectionNo());
// if(null != codingRecordBySectionNo && codingRecordBySectionNo.size() > 0){
// if(codingRecordBySectionNo.size() == 1 && (rankResultDto.getGradeType().equals("正常") || rankResultDto.getGradeType().equals("转规格"))){
// rankResultDto.setGradeType("复测");
// ybInspectDataToMcsDto.setGradeType("复测");
// }
// }
// }
rankResultDto.setYbInspectDataToMcsDto(ybInspectDataToMcsDto);
}
//}
} catch (Exception e) {
syslog = new SysLog();
syslog.setResult(e.getMessage());
......@@ -153,27 +126,11 @@ public class PublishRankResultImpl implements PublishRankResultService {
//圆棒评级下发MCS信息中字段gradeType和type根据数据字典映射转换
List<DictionaryItem> itemList = dictionaryItemService.findItemByThemeValue("gradeTypeToType", true);
Map<String, String> weightCoefficient = itemList.stream().collect(Collectors.toMap(DictionaryItem::getName, DictionaryItem::getValue));
String type = weightCoefficient.get(rankResultDto.getGradeType());
/*注释美科业务逻辑 标棒最小长度 配置问题
DictionaryItem item = dictionaryItemService.findByThemeValueAndNameAndEnable("standedLength", "标棒最小长度", true);
BigDecimal standedLength = new BigDecimal(item.getValue());
if (null != rankResultDto.getGradeType() && rankResultDto.getGradeType().equals("正常") && null != rankResultDto.getActualLength()){
if (rankResultDto.getActualLength().compareTo(standedLength)>=0){
rankResultDto.setType("标棒");
}else {
rankResultDto.setType("非标棒");
}
}else if (!rankResultDto.getGradeType().equals("正常")){
rankResultDto.setType(type);
}*/
}
@Override
public void publishRankResult(YbInspectData inspectDataBase, BigDecimal actualWeight, BigDecimal theoryWeight) {
if (actualWeight == null){
// actualWeight = inspectDataBase.getActualWeight();
}
if (theoryWeight == null){
theoryWeight = inspectDataBase.getTheoryWeight();
}
......@@ -196,22 +153,16 @@ public class PublishRankResultImpl implements PublishRankResultService {
rankResultDto.setActualLength(inspectDataBase.getActualLength());
rankResultDto.setCrystalNo(inspectDataBase.getCrystalNo());
rankResultDto.setData(inspectDataBase.getSectionType());
// rankResultDto.setWareHouseLength(inspectDataBase.getWareHouseLength());
rankResultDto.setActualWeight(actualWeight);
rankResultDto.setTheoryWeight(theoryWeight);
rankResultDto.setDiameterMin(inspectDataBase.getDiameterMin());
rankResultDto.setDiameterMax(inspectDataBase.getDiameterMax());
// rankResultDto.setDiameterJudge(inspectDataBase.getDiamDecide());
rankResultDto.setDistortion(inspectDataBase.getDistortion());
rankResultDto.setIsBevel(inspectDataBase.getIsBevel().toString());
// rankResultDto.setFineDiameter(inspectDataBase.getFineDiameter());
// rankResultDto.setFineCutLength(inspectDataBase.getFineCutLength());
rankResultDto.setPiecewiseNum(inspectDataBase.getPiecewiseNum());
rankResultDto.setSticksCount(inspectDataBase.getSticksCount());
rankResultDto.setAgainNum(inspectDataBase.getAgainNum());
rankResultDto.setHeadTailRecognition(inspectDataBase.getHeadTailRecognition());
// rankResultDto.setIsSeeBottom(inspectDataBase.getIsSeeBottom());
// rankResultDto.setLineMarking(inspectDataBase.getLineMarking());
rankResultDto.setIsCutBack(inspectDataBase.getIsCutBack());
this.publishRankResult(rankResultDto);
}
......
......@@ -408,16 +408,6 @@ public class YbMcsToMesServiceImpl implements YbMcsToMesService {
if (null == byCode.getStatus() || byCode.getStatus() != 1) {
return ResultGenerator.fail("此编号: " + segmentNo + " 不在加工中状态,当前状态为:" + EnumValuesFactory.PlanProcessingOrderStatus.getText(byCode.getStatus()));
}
// if (!EnumValuesFactory.WipStorageCode.圆棒检验.getValue().equals(byCode.getWipStorage().getProcessName())) {
// return ResultGenerator.fail("此编号: " + segmentNo + " 站点不在圆棒检验");
// }
// // 待进站和已进站通过
// if (byCode.getWipStorage().getStatus() == EnumValuesFactory.WipStorageStatus.已出站.getKey()
// ) {
// return ResultGenerator.fail("此编号: " + segmentNo + " 已出站");
// }
// String toMcsInfo = byCode.getWipStorage().getProcessName() + EnumValuesFactory.WipStorageStatus.valueOf(byCode.getWipStorage().getProcessName());
String toMcsInfo = byCode.getWipStorage().getProcessName();
return ResultGenerator.success(toMcsInfo, null);
}
......@@ -462,7 +452,6 @@ public class YbMcsToMesServiceImpl implements YbMcsToMesService {
}
//如果不是检验待进站状态,报错
boolean isStatus = currentWipStorageStatusDto.getWipStorageCode().equals(EnumValuesFactory.WipStorageCode.圆棒检验.getKey());
// && currentWipStorageStatusDto.getWipStorageStatus() == EnumValuesFactory.WipStorageStatus.待进站.getKey();
if (!isStatus) {
return ResultGenerator.fail("晶棒:" + pdaBingDto.getSectionNo() + "不是检验待进站状态不允许当前操作!");
}
......@@ -555,33 +544,6 @@ public class YbMcsToMesServiceImpl implements YbMcsToMesService {
// 默认值
// 截取样片倒数第二位,判断是头是尾
String pieceNo = pieceDetail.getPieceNo();
String TorW = pieceNo.substring(pieceNo.length() - 2, pieceNo.length() - 1);
DefaultSample sample = this.defaultSampleService.findByDopantLikeAndSpecificationsLikeAndProductTypeLike(pieceDetail.getDopant(), pieceDetail.getSpecs(), pieceDetail.getProductType());
// // 微缺陷
// if (sampleCheckInfoDto.getMicroDefect() == null){
// if (TorW.equals("T") && sample != null){
// pieceCheck.setMicroDefect(sample.getHeadDefect());// 头微缺陷
// }else if (TorW.equals("W") && sample != null){
// pieceCheck.setMicroDefect(sample.getTailDefect());// 尾微缺陷
// }else {
// pieceCheck.setMicroDefect(null);
// }
// }else {
// pieceCheck.setMicroDefect(sampleCheckInfoDto.getMicroDefect());// 微缺陷
// }
//
// // 位错
// if (sampleCheckInfoDto.getLineDefect() == null){
// if (TorW.equals("T") && sample != null){
// pieceCheck.setLineDefect(sample.getHeadDislocation());// 头位错
// }else if (TorW.equals("W") && sample != null){
// pieceCheck.setLineDefect(sample.getTailDislocation());// 尾位错
// }else {
// pieceCheck.setLineDefect(null);
// }
// }else {
// pieceCheck.setLineDefect(sampleCheckInfoDto.getLineDefect());// 位错
// }
BeanUtils.copyProperties(sampleCheckInfoDto, pieceCheck, BeanUtil.getIgnoreProperties(sampleCheckInfoDto, null, null));
pieceCheck.setUserName1("mcs");
pieceCheck.setCheckTime1(new Date());
......@@ -712,8 +674,6 @@ public class YbMcsToMesServiceImpl implements YbMcsToMesService {
result.setType(longCrystal.getSpecs());
result.setSegmentType(lineDetail.getType());
result.setIsReCut(lineDetail.getIsCut());
// result.setIsAvoidCheck();//Todo 后面预留
return result;
}
......@@ -732,7 +692,6 @@ public class YbMcsToMesServiceImpl implements YbMcsToMesService {
BlastFurnaceAddDto addDto = new BlastFurnaceAddDto();
addDto.setLoadingTaskDto(toLazyDto(task));
addDto.getLoadingTaskDto().setOperationTime(dto.getFeedingEndTime());
// addDto.getLoadingTaskDto().setWeight(getWeight(dto.getMaterialList()));
addDto.setVehicleCode(dto.getFrockCode());
List<BlastFurnaceDetailDto> list = new ArrayList<>();
if (dto.getMaterialList() != null) {
......@@ -753,16 +712,6 @@ public class YbMcsToMesServiceImpl implements YbMcsToMesService {
detail.setStoreLocationId(warehouseInventoryBoResult.getData().getWarehouseId() == null ? null : warehouseInventoryBoResult.getData().getWarehouseId().intValue());
detail.setStoreLocationName(warehouseInventoryBoResult.getData().getWarehouseName());
}
// detail.setUniqueCode();
// detail.setBucketForty();
// detail.setBucketTen();
// detail.setAlloyBrand();
// detail.setAlloyType();
// detail.setTrialType();
// detail.setPulled();
// detail.setErpWarehouseCode();
// detail.setErpBatchNo();
MaterialModel model = materialModelService.findByCode(mDto.getMaterialNo());
if (model != null) {
detail.setSupplierName(model.getSupplier());
......@@ -1138,14 +1087,6 @@ public class YbMcsToMesServiceImpl implements YbMcsToMesService {
return "0";
}
}
private BigDecimal getWeight(List<McsMaterialDto> materialList) {
BigDecimal total = BigDecimal.ZERO;
for (McsMaterialDto dto : materialList) {
total = total.add(dto.getMaterialWeight() == null ? BigDecimal.ZERO : dto.getMaterialWeight());
}
return total;
}
public AgainTaskDetailDto toLazyDto(AgainTaskDetail entity) {
return modelMapper.map(entity, AgainTaskDetailDto.class);
}
......@@ -1187,8 +1128,6 @@ public class YbMcsToMesServiceImpl implements YbMcsToMesService {
inspectionRecordDto.setAbnormal("");
inspectionRecordDto.setLocationNo(locationNo);
inspectionRecordDto.setUserName("mcs");
// inspectionRecordDto.setClassNo();
// inspectionRecordDto.setTeamGroup();
inspectionRecordDto.setBuildTime(new Date());
inspectionRecordDto.setLongCrystalId(longCrystal.getId());
inspectionRecordDto.setIsAuto(true);
......
......@@ -155,7 +155,6 @@ public class RequestUtils {
if (null != status && StringUtils.isNotEmpty(status) && ("200".equals(status) || "Success".equals(status))){
v = 200;
}
// resultDto = JSON.parseObject(result.getBody(), ResultDto.class,);
resultDto.setStatus(v);
resultDto.setMessage(jsonObject.getString("message"));
resultDto.setCode(Integer.parseInt(jsonObject.getString("code")));
......
package com.sw.mes.yb.pc.service.impl;
import com.sw.mes.base.factory.inspect.entity.ProductAssemblyRule;
import com.sw.mes.core.base.BaseServiceImpl;
import com.sw.mes.core.enums.SectionIndexRangeEnum;
import com.sw.mes.core.exception.BusinessException;
import com.sw.mes.core.response.ResultGenerator;
import com.sw.mes.core.utils.BeanUtil;
import com.sw.mes.core.utils.StringUtils;
import com.sw.mes.inspect.entity.YbInspectData;
......@@ -14,12 +12,10 @@ import com.sw.mes.production.service.TruncationReccutDetailsService;
import com.sw.mes.yb.fls.dto.SectionRecycledResultDto;
import com.sw.mes.yb.fls.dto.SectionRequestDto;
import com.sw.mes.yb.mcs.dto.HeadTailMaterialTypeDto;
import com.sw.mes.yb.pad.entity.ProductionBackCuttingRecord;
import com.sw.mes.yb.pad.entity.ProductionPaintingLine;
import com.sw.mes.yb.pad.entity.ProductionPaintingLineDetail;
import com.sw.mes.yb.pad.service.ProductionPaintingLineDetailService;
import com.sw.mes.yb.pad.service.ProductionPaintingLineService;
import com.sw.mes.yb.pad.service.ProductionRecutService;
import com.sw.mes.yb.pc.dao.HeadTailMaterialRuleDao;
import com.sw.mes.yb.pc.entity.HeadTailMaterialRule;
import com.sw.mes.yb.pc.service.HeadTailMaterialRuleService;
......@@ -65,12 +61,6 @@ public class HeadTailMaterialRuleServiceImpl extends BaseServiceImpl<HeadTailMat
ProductionPaintingLineDetailService productionPaintingLineDetailService;
/**
* 返切画线信息
*/
@Autowired
private ProductionRecutService productionRecutService;
/**
* 圆棒检验数据库service
*/
@Autowired
......@@ -147,12 +137,6 @@ public class HeadTailMaterialRuleServiceImpl extends BaseServiceImpl<HeadTailMat
return null;
} else {
YbInspectData inspectDataBase = inspectDataBaseService.findBySectionNo(firstSectionNo);
// TODO: 2022/2/7 赋值 //电阻率
// BigDecimal resistivity = null;
// //碳含量
// BigDecimal carbon = null;
// //少子寿命
// BigDecimal sinton = null;
}
......@@ -162,12 +146,6 @@ public class HeadTailMaterialRuleServiceImpl extends BaseServiceImpl<HeadTailMat
return null;
} else {
YbInspectData inspectDataBase = inspectDataBaseService.findBySectionNo(firstSectionNo);
// TODO: 2022/2/7 赋值 //电阻率
// BigDecimal resistivity = null;
// //碳含量
// BigDecimal carbon = null;
// //少子寿命
// BigDecimal sinton = null;
}
} else {
return null;
......@@ -273,11 +251,7 @@ public class HeadTailMaterialRuleServiceImpl extends BaseServiceImpl<HeadTailMat
//查询画线明细数据
ProductionPaintingLineDetail bySegmentNo = productionPaintingLineDetailService.findBySegmentNo(recoveryNo);
if (bySegmentNo != null) {
// if (bySegmentNo.getType() == 0) {
// throw new RuntimeException("编号【" + recoveryNo + "】非回收料!");
// }
// T2BP0011R51WP
String fromMark = bySegmentNo.getNo().substring(SectionIndexRangeEnum.基地追溯产品类型.getBeginIndex(), SectionIndexRangeEnum.基地追溯产品类型.getEndIndex());
if (fromMark.matches("[A-Z]+")) {
if (bySegmentNo.getNo().substring(SectionIndexRangeEnum.断次.getBeginIndex()).toUpperCase().contains("T") || bySegmentNo.getNo().toUpperCase().contains("01Y")
......@@ -299,12 +273,6 @@ public class HeadTailMaterialRuleServiceImpl extends BaseServiceImpl<HeadTailMat
type = 3;
}
}
// //正常长晶棒画线
// if (recoveryNo.charAt(recoveryNo.length() - 3) == 'W') {
// type = 2;
// } else if (recoveryNo.charAt(recoveryNo.length() - 3) == '1') {
// type = 1;
// }
} else {
crystalNoBySectionNo = truncationReccutDetailsService.findCrystalNoBySectionNo(recoveryNo);
if (StringUtils.isBlank(crystalNoBySectionNo)) {
......@@ -342,13 +310,11 @@ public class HeadTailMaterialRuleServiceImpl extends BaseServiceImpl<HeadTailMat
if (productionPaintingLineDetailList == null || productionPaintingLineDetailList.size() < 1) {
throw new RuntimeException("尾料编号【" + recoveryNo + "】对应的长晶棒画线信息不存在!");
}
// no = productionPaintingLineDetailList.get(productionPaintingLineDetailList.size()-1).getNo();
List<ProductionPaintingLineDetail> detailList = productionPaintingLineDetailList.stream().filter(productionPaintingLineDetail -> productionPaintingLineDetail.getNo().substring(productionPaintingLineDetail.getNo().length()-2,productionPaintingLineDetail.getNo().length()-1).toUpperCase().contains("W")).collect(Collectors.toList());
if(CollectionUtils.isNotEmpty(detailList)) {
no = detailList.get(0).getNo();
}
} else if (type == 3) {
// productionPaintingLineDetailList = productionPaintingLineDetailService.findByRecycledSectionNoFQ(recoveryNo);
if (productionPaintingLineDetailList != null && productionPaintingLineDetailList.size() > 0) {
for (ProductionPaintingLineDetail productionPaintingLineDetail : productionPaintingLineDetailList) {
......@@ -367,14 +333,6 @@ public class HeadTailMaterialRuleServiceImpl extends BaseServiceImpl<HeadTailMat
}
}
}
// else {
// //圆棒返切记录
// ProductionBackCuttingRecord productionBackCuttingRecord = productionRecutService.get(bySegmentNo.getOperateReversecutDrawId());
// if (productionBackCuttingRecord == null) {
// throw new RuntimeException("回收料编号【" + recoveryNo + "】返切记录不存在!");
// }
// recoveryNo = productionBackCuttingRecord.getSegmentNo();
// }
} else if (type == 4) {
productionPaintingLineDetailList = productionPaintingLineDetailService.findByRecycledCrystalNo(crystalNoBySectionNo);
if (productionPaintingLineDetailList == null || productionPaintingLineDetailList.size() < 1) {
......@@ -406,7 +364,6 @@ public class HeadTailMaterialRuleServiceImpl extends BaseServiceImpl<HeadTailMat
headTailMaterialTypeDto.setCentreLife(inspectDataBase.getTCentreLife());
headTailMaterialTypeDto.setLifeEdge1(inspectDataBase.getTLifeEdge1()); //没问题
headTailMaterialTypeDto.setCarbonContent(inspectDataBase.getCarbonContentHead());
// headTailMaterialTypeDto.setCarbonContentBorder(inspectDataBase.getCarbonContentBorder());
} else if (type == 2 || type == 4) {
dopant = inspectDataBase.getDopant();
resistivity = inspectDataBase.getWRadialCentre();
......@@ -419,7 +376,6 @@ public class HeadTailMaterialRuleServiceImpl extends BaseServiceImpl<HeadTailMat
headTailMaterialTypeDto.setCentreLife(inspectDataBase.getWCentreLife());
headTailMaterialTypeDto.setLifeEdge1(inspectDataBase.getWLifeEdge1());
headTailMaterialTypeDto.setCarbonContent(inspectDataBase.getCarbonContentTail());
// headTailMaterialTypeDto.setCarbonContentBorder(inspectDataBase.getCarbonContentBorderTail());
}
//返回值增加头氧数值
headTailMaterialTypeDto.setOxygenContentHead(inspectDataBase.getOxygenContentHead());
......@@ -509,7 +465,6 @@ public class HeadTailMaterialRuleServiceImpl extends BaseServiceImpl<HeadTailMat
sectionRecycledResultDto.setBracketNo(String.valueOf(headTailMaterialRule.getBracketNo()));
sectionRecycledResultDto.setRecoveryName(headTailMaterialRule.getRecoveryName());
list.add(sectionRecycledResultDto);
// return sectionRecycledResultDto;
}
}
if (list.size() == 0) {
......
......@@ -54,58 +54,6 @@ public class DocketPrintController {
System.out.println(System.currentTimeMillis() - d1);
return ResultGenerator.success(docketPrintResultDto);
}
/* @ApiOperation(value = "pad单据打印")
@GetMapping(value = "/printShow")
public Result printShow(@ApiParam("pad单据打印") @RequestParam(required = false) String trayNo, @RequestParam(required = false) String trayCode) {
if (StringUtils.isBlank(trayNo) && StringUtils.isBlank(trayCode)) {
return ResultGenerator.fail("单晶编号与托盘编号不能同时为空");
}
if (StringUtils.isBlank(trayNo)) {
ProductionBindingTray productionBindingTray = productionBindingTrayService.getByTrayNoAndLocationNo(trayCode, "1");
if (productionBindingTray == null) {
throw new BusinessException("【" + trayCode + "】" + "托盘编号不存在");
}
if (StringUtils.isBlank(productionBindingTray.getCrystalNo())) {
throw new BusinessException("【" + trayCode + "】托盘,未查到绑定单晶");
}
trayNo = productionBindingTray.getCrystalNo();
}
List<YbInspectData> inspectDataBases = inspectDataBaseDao.findBySectionNo(trayNo);
if (inspectDataBases.size() == 0) {
throw new BusinessException("检验数据不存在");
}
YbInspectData inspectDataBase = inspectDataBases.get(0);
DocketPrintDto docketPrintDto = new DocketPrintDto();
if (StringUtils.isNotBlank(inspectDataBase.getGradeData())) {
ProductionBackCuttingRecord productionBackCuttingRecord = productionRecutService.findTopBySegmentNoOrderByIdDesc(trayNo);
if (productionBackCuttingRecord == null) {
throw new BusinessException("【" + trayNo + "】:为反切单晶,不存在反切数据,请检查");
}
//打印反切标签
docketPrintDto.setPrintNum(1);
docketPrintDto.setPrintModel("圆棒反切标签");
docketPrintDto.setCode(trayNo);
docketPrintDto.setIsPreview(true);
docketPrintDto.setIsAssociated(false);
docketPrintDto.setPrintType("圆棒反切标签");
} else {
//打印合格证标签
docketPrintDto.setPrintNum(2);
docketPrintDto.setPrintModel("合格证标签");
docketPrintDto.setCode(trayNo);
docketPrintDto.setIsPreview(true);
docketPrintDto.setIsAssociated(false);
docketPrintDto.setPrintType("合格证标签");
}
List<DocketPrintDto> docketPrintDtos = new ArrayList<>();
docketPrintDtos.add(docketPrintDto);
DocketPrintResultDto docketPrintResultDto = docketPrintService.docketPrint(docketPrintDtos);
if (docketPrintResultDto.getFailedNum() > 0) {
return ResultGenerator.fail("打印失败:" + docketPrintResultDto.getDocketPrintFailedDetailList().get(0).getDescription());
}
return ResultGenerator.success(docketPrintResultDto.getPreviewList());
}*/
@ApiOperation(value = "pad单据打印")
@GetMapping(value = "/printShow")
......@@ -406,20 +354,4 @@ public class DocketPrintController {
}
return ResultGenerator.success(preview);
}
/**
* 打印圆棒信息条码
* @param dto
* @return
*/
// @ApiOperation(value = "打印圆棒物料信息条码")
// @PostMapping("/printPoleMaterial")
// public Result printPoleMaterial(@Valid @RequestBody @ApiParam(value = "打印信息") DocketPolePrintDto dto) {
// List<String> preview;
// try {
// preview = docketPrintService.printPoleMaterial(dto);
// } catch (Exception e) {
// return ResultGenerator.fail(e.getMessage());
// }
// return ResultGenerator.success(preview);
// }
}
package com.sw.mes.yb.printer.controller;
import com.sw.mes.core.context.BaseContextHandler;
import com.sw.mes.core.response.ResponsePage;
import com.sw.mes.core.response.Result;
import com.sw.mes.core.response.ResultGenerator;
......@@ -20,9 +19,7 @@ import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
import com.sw.mes.yb.printer.entity.PrinterLog;
......
......@@ -36,13 +36,6 @@ public class FbCrystalCertificateDto {
String endCentreEdgeAvg4;
@ApiModelProperty(value = "径向电阻率TW边缘1平均" )
String twRadialEdge1Avg;
//
// //223
// @ApiModelProperty(value = "电阻率头中心边缘平均" )
// String topCentreEdgeAvg;
// @ApiModelProperty(value = "电阻率尾中心边缘平均" )
// String endCentreEdgeAvg;
// //247 295
@ApiModelProperty(value = "电阻率头均值")
String resistivityTopAvg;
@ApiModelProperty(value = "电阻率尾均值")
......@@ -52,7 +45,6 @@ public class FbCrystalCertificateDto {
@ApiModelProperty(value = "崩边长度")
String edgeBark;
//产品标准卡信息
@ApiModelProperty(value = "客户名称" )
String customerName;
@ApiModelProperty(value = "直径" )
......@@ -76,10 +68,6 @@ public class FbCrystalCertificateDto {
@ApiModelProperty(value = "圆棒实验等级")
String ybExperiLevel;
// ======================
@ApiModelProperty(value = "单晶编号(整棒)")
String crystalNo;
@ApiModelProperty(value = "晶段编号(短棒)")
......@@ -424,17 +412,12 @@ String fbSectionNo;
@ApiModelProperty(value = "直径min")
String diameterMinMax;
// @ApiModelProperty(value = "直径max")
// @ExcelProperty(value = "单晶编号")
// String diameterMax;
@ApiModelProperty(value = "当前提交日期")
String checkTime;
@ApiModelProperty(value = "方棒长度-方棒减长")
String length;
@ApiModelProperty(value = "方棒实验等级")
String fbExperiLevel;
// @ApiModelProperty(value = "方棒减长 ")
// private String lengthPrep;
@ApiModelProperty(value = "方棒备注")
String squareRodRemark;
@ApiModelProperty(value = "方棒等级/检验入库类别")
......
......@@ -40,13 +40,6 @@ public class YbCrystalCertificateDto {
String twRadialEdge1Avg;
@ApiModelProperty(value = "实际称重/实测重量")
String actualWeight;
//
// //223
// @ApiModelProperty(value = "电阻率头中心边缘平均" )
// String topCentreEdgeAvg;
// @ApiModelProperty(value = "电阻率尾中心边缘平均" )
// String endCentreEdgeAvg;
// //247 295
@ApiModelProperty(value = "电阻率头均值")
String resistivityTopAvg;
@ApiModelProperty(value = "电阻率尾均值")
......@@ -55,8 +48,6 @@ public class YbCrystalCertificateDto {
//圆棒长度-单晶减长长度
@ApiModelProperty(value = "圆棒长度-单晶减长长度")
String actualLength;
// @ApiModelProperty(value = "单晶减长长度" )
// String reduceCrystalLength;
@ApiModelProperty(value = "异常汇总")
String anomaly;
......@@ -73,9 +64,6 @@ public class YbCrystalCertificateDto {
@ApiModelProperty(value = "直径Min-Max")
String diameterMin;
// @Column(length=19)
// private String diameterMax;
@ApiModelProperty(value = "头斜")
String headSlope;
......
......@@ -84,9 +84,4 @@ public interface DocketPrintService {
* 打印配料单标签
*/
List<String> printIngredientList(DocketIngredientListPrintDto dto);
//
// /**
// * 打印圆棒信息条码
// */
// List<String> printPoleMaterial(DocketPolePrintDto dto);
}
......@@ -10,7 +10,6 @@ import com.sw.mes.yb.printer.entity.PrinterLog;
import com.sw.mes.yb.printer.dao.PrinterLogDao;
import com.sw.mes.yb.printer.service.PrinterLogService;
import java.lang.reflect.Field;
import java.util.Date;
import java.util.List;
......
......@@ -5,6 +5,7 @@ import com.sw.mes.base.system.entity.DictionaryItem;
import com.sw.mes.base.system.service.DictionaryItemService;
import com.sw.mes.core.context.BaseContextHandler;
import com.sw.mes.core.entity.SearchFilter;
import com.sw.mes.core.exception.BusinessException;
import com.sw.mes.core.response.ResponsePage;
import com.sw.mes.core.response.Result;
import com.sw.mes.core.response.ResultGenerator;
......@@ -118,7 +119,7 @@ public class InputFurnaceBurdenController {
@GetMapping("/export")
public void export(InputFurnaceBurdenExportParam param, HttpServletResponse response){
if (StringUtils.isBlank(param.getSearch_GTE_startTime()) || StringUtils.isBlank(param.getSearch_LTE_startTime())){
throw new RuntimeException("灌料时间不能空");
throw new BusinessException("灌料时间不能空");
}
List<Map<String, Object>> mapList = againTaskDetailService.findTaskAndDetails(param);
List<TaskDetailExportDto> list = mapList.stream()
......
......@@ -228,11 +228,6 @@ public class RecycledMaterialManageController {
return ResultGenerator.success(responsePage);
}
@ApiOperation(value = "回收料上报ERP")
@PostMapping("/reportedErp")
public Result reportedErp(@RequestBody @Valid @ApiParam(value = "Dto对象") RecycledMaterialManageDto recycledMaterialManageDto) {
return recycledMaterialManageService.reportedErp(recycledMaterialManageDto);
}
@ApiOperation(value = "回收料管理详细信息")
@GetMapping("/{id}")
......@@ -275,108 +270,7 @@ public class RecycledMaterialManageController {
}
return ResultGenerator.success(recycledMaterialManage);
}
/* @ApiOperation(value = "新增和更新回收料管理列表详情")
@PostMapping("/saveOrUpdateRecycledMaterial")
public Result saveOrUpdateRecycledMaterial(@RequestBody @Valid @ApiParam(value = "新增和更新回收料管理列表详情") RecycledMaterialManageDto recycledMaterialManageDto, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultGenerator.fail(bindingResult.getFieldError().getDefaultMessage());
}
//todo:校验追溯标识是否一致
String fromMark = recycledMaterialManageDto.getFromMark();
Long manageId = recycledMaterialManageDto.getId();
String maker = BaseContextHandler.getUsername();
Date now = new Date();
List<RecycledMaterialManageDetailDto> recycledMaterialManageDetailDtos = recycledMaterialManageDto.getRecycledMaterialMangeDetailDtos();
// if(recycledMaterialManageDetailDtos == null || recycledMaterialManageDetailDtos.isEmpty()){
// return ResultGenerator.fail("未录入回收料");
// }
if(null != recycledMaterialManageDetailDtos && !recycledMaterialManageDetailDtos.isEmpty() && recycledMaterialManageDetailDtos.size() > 0){
List<String> recycleNos = recycledMaterialManageDetailDtos.stream().map(temp -> temp.getRecycleNo()).collect(Collectors.toList());
//todo 单晶允许重复
// HashSet<String> hashSet = new HashSet<>(recycleNos);
// if(!"单晶".equals(recycledMaterialManageDto.getSource())){
// if(recycleNos.size() != hashSet.size()){
// return ResultGenerator.fail("回收料重复");
// }
// }
//校验当前回收料码是否存在其他非取消和拒收的记录中
//校验子物料产品类型与主物料是否相同
List<String> usedRecycleNos = recycledMaterialManageDetailService.findUsedRecycleNos(manageId);
for(RecycledMaterialManageDetailDto temp:recycledMaterialManageDetailDtos){
if(null == temp.getProductionType()){
// return ResultGenerator.fail("物料的产品类别不存在");
continue;
}
// if(!temp.getProductionType().equals(recycledMaterialManageDto.getProductionCategory())){
// return ResultGenerator.fail("产品类别不一致");
// }
if (StringUtils.isNotBlank(fromMark) && !fromMark.equals(temp.getFromMark())) {
return ResultGenerator.fail("溯源标识不一致");
}
if (usedRecycleNos != null && !usedRecycleNos.isEmpty() && null != temp.getRecycleNo()
&& !temp.getRecycleNo().isEmpty()) {
if (usedRecycleNos.contains(temp.getRecycleNo())) {
return ResultGenerator.fail(temp.getRecycleNo()+"物料已被组托!");
}
}
}
}
if(manageId != null){//编辑
Integer status = recycledMaterialManageDto.getStatus();
if(null == status){
return ResultGenerator.fail("缺少状态参数");
}
if(status.equals(StockStateEnum.REFUSE.getCode()) || status.equals(StockStateEnum.TOBEOUT.getCode()) || status.equals(StockStateEnum.CANCEL.getCode())){
recycledMaterialManageDetailService.deleteByManageId(manageId);
}else{
return ResultGenerator.fail("该状态不可编辑");
}
recycledMaterialManageDto.setUpdateBy(maker);
recycledMaterialManageDto.setUpdateTime(now);
}else{//新增
String materialBoxNo = recycledMaterialManageDto.getBoxNo();
RecycledMaterialManage materialManage = recycledMaterialManageService.getByBoxNoAndStatus(materialBoxNo);
if (null != materialManage) {
return ResultGenerator.fail("该箱号: " + materialBoxNo + " 被占用,领料清空后方可使用!");
}
//todo 新的托号和生产批次号
String trayNo = creatTrayNew(recycledMaterialManageDto);
String produceBatchNo = creatProduceBatchNo(recycledMaterialManageDto);
// String trayNo = creatTrayNo(recycledMaterialManageDto);
recycledMaterialManageDto.setTrayNo(trayNo);
//生产批次号
recycledMaterialManageDto.setProduceBatchNo(produceBatchNo);
recycledMaterialManageDto.setCreateBy(maker);
recycledMaterialManageDto.setCreateTime(now);
recycledMaterialManageDto.setUpdateBy(maker);
recycledMaterialManageDto.setUpdateTime(now);
}
if("单晶".equals(recycledMaterialManageDto.getSource())){
if(StringUtils.isBlank(recycledMaterialManageDto.getLotNo())){
ResultGenerator.fail("未录入炉次号");
}
}
recycledMaterialManageDto.setStatus(StockStateEnum.TOBEOUT.getCode());
if(recycledMaterialManageDetailDtos == null || recycledMaterialManageDetailDtos.isEmpty()){
recycledMaterialManageDto.setNum(0);
} else {
recycledMaterialManageDto.setNum(recycledMaterialManageDetailDtos.size());
}
RecycledMaterialManage recycledMaterialManage = fromDto(recycledMaterialManageDto);
recycledMaterialManageService.saveOrUpdate(recycledMaterialManage);
if(null != recycledMaterialManageDetailDtos && !recycledMaterialManageDetailDtos.isEmpty() && recycledMaterialManageDetailDtos.size() > 0){
List<RecycledMaterialManageDetail> recycledMaterialManageDetails = recycledMaterialManageDetailDtos.stream().map(entity -> fromDetailDto(entity))
.collect(Collectors.toList());
recycledMaterialManageDetails.stream().forEach(temp -> temp.setManageId(recycledMaterialManage.getId()));
recycledMaterialManageDetailService.saveAll(recycledMaterialManageDetails);
}
return ResultGenerator.success();
}
*/
@Jinko(author = "yyl", value = "余料新增和更新回收料管理列表详情")
@ApiOperation(value = "余料新增和更新回收料管理列表详情")
@PostMapping("/saveOrUpdateRecycledMaterial")
......@@ -399,16 +293,6 @@ public class RecycledMaterialManageController {
@ApiOperation(value = "删除回收料管理信息")
@GetMapping("/delete")
public Result delete(@ApiParam(value = "id", type = "query") @RequestParam Long id) {
......@@ -440,34 +324,6 @@ public class RecycledMaterialManageController {
}
/*@ApiOperation(value = "发起入库")
@GetMapping("/startWarehousing")
public Result startWarehousing(@ApiParam(value = "id", type = "query") @RequestParam Long id) {
RecycledMaterialManage recycledMaterialManage = recycledMaterialManageService.get(id);
Integer status = recycledMaterialManage.getStatus();
if(status.equals(StockStateEnum.TOBEOUT.getCode())){
recycledMaterialManage.setStatus(StockStateEnum.TOBEDETERMINE.getCode());
}else{
return ResultGenerator.fail("该状态不可发起入库");
}
if(recycledMaterialManage.getWeight() == null){
return ResultGenerator.fail("重量不可以为空");
}
RecycledMaterialManageDto recycledMaterialManageDto = toLazyDto1(recycledMaterialManage);
try {
//todo发起入库功能待取消,后期不适用
recycledMaterialManageService.recycledMaterialIn(recycledMaterialManageDto);
} catch(BusinessException e){
return ResultGenerator.fail(e.getMessage());
}
recycledMaterialManage.setReceiveTime(new Date());
recycledMaterialManage.setReceiver("WMS");
recycledMaterialManage.setStatus(StockStateEnum.RECEIVED.getCode());
recycledMaterialManageService.saveOrUpdate(recycledMaterialManage);
return ResultGenerator.success();
}
*/
@Jinko(author = "yyl", value = "回收料发起入库")
@ApiOperation(value = "回收料发起入库")
......@@ -719,10 +575,6 @@ public class RecycledMaterialManageController {
}
}
// List<MaterialModel> materialModels = materialModelService.findRecycledMaterialByParam(param);
// if(null != materialModels && !materialModels.isEmpty()){
// materialModelDtos = materialModels.stream().map(entity -> modelMapper.map(entity,MaterialModelDto.class)).collect(Collectors.toList());
// }
return ResultGenerator.success(materialModelDtos);
}
......
......@@ -50,7 +50,6 @@ public interface RecycledMaterialManageService extends BaseService<RecycledMater
RecycledMaterialManage getByBoxNo(String boxNo);
Result reportedErp(RecycledMaterialManageDto recycledMaterialManageDto);
/**
* 回收料对接 料理车间或者wms入库
......
......@@ -61,23 +61,14 @@ public class LoadingTaskLogServiceImpl extends BaseServiceImpl<LoadingTaskLog> i
public LoadingTaskLog saveByLoadingTask(LoadingTask entity) {
LoadingTaskLog loadingTaskLog = modelMapper.map(entity, LoadingTaskLog.class);
if (entity.getRawStatus() != LoadingTaskDto.rawStatus_0 && entity.getRawStatus() != LoadingTaskDto.rawStatus_6) {
// LoadingTaskLog loadingTaskLogOld = dao.findByLotNoWithRecipeUserName(entity.getLotNo());
// if(null != loadingTaskLogOld){
// loadingTaskLog.setId(loadingTaskLogOld.getId());
// loadingTaskLog.setRecipeUserName(loadingTaskLogOld.getRecipeUserName());
// loadingTaskLog.setRecipeTime(loadingTaskLogOld.getRecipeTime());
// }else{
loadingTaskLog.setRecipeUserName(entity.getUserName());
loadingTaskLog.setRecipeTime(entity.getOperationTime());
loadingTaskLog.setLoadingTaskId(entity.getId());
// }
loadingTaskLog.setRecipeUserName(entity.getUserName());
loadingTaskLog.setRecipeTime(entity.getOperationTime());
loadingTaskLog.setLoadingTaskId(entity.getId());
saveOrUpdate(loadingTaskLog);
blastFurnaceDetailLogService.deleteByLoadingTaskId(entity.getId());
List<BlastFurnaceDetail> blastFurnaceDetailList = blastFurnaceDetailService.getBlastFurnaceDetailList(entity.getId());
if (blastFurnaceDetailList != null && blastFurnaceDetailList.size()>0){
for (BlastFurnaceDetail blastFurnaceDetail : blastFurnaceDetailList) {
......@@ -299,12 +290,6 @@ public class LoadingTaskLogServiceImpl extends BaseServiceImpl<LoadingTaskLog> i
if (loadingTaskLogDto.getZlWeight() != null) {
row.createCell(25).setCellValue(loadingTaskLogDto.getZlWeight().toString());
}
// if (loadingTaskLogDto.getBucketForty() != null) {
// row.createCell(26).setCellValue(loadingTaskLogDto.getBucketForty());
// }
// if (loadingTaskLogDto.getBucketTen() != null) {
// row.createCell(27).setCellValue(loadingTaskLogDto.getBucketTen());
// }
}
sheet.setDefaultRowHeight((short) (20 * 20));
......
package com.sw.mes.yb.report.controller;
import com.sw.mes.core.context.BaseContextHandler;
import com.sw.mes.core.response.ResponsePage;
import com.sw.mes.core.response.Result;
import com.sw.mes.core.response.ResultGenerator;
......
package com.sw.mes.yb.report.controller;
import com.sw.mes.core.context.BaseContextHandler;
import com.sw.mes.core.response.ResponsePage;
import com.sw.mes.core.response.Result;
import com.sw.mes.core.response.ResultGenerator;
......@@ -18,10 +17,8 @@ import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
import com.sw.mes.yb.report.entity.BrokenBractBase;
......
package com.sw.mes.yb.report.controller;
import com.sw.mes.core.context.BaseContextHandler;
import com.sw.mes.core.response.ResponsePage;
import com.sw.mes.core.response.Result;
import com.sw.mes.core.response.ResultGenerator;
......@@ -20,7 +19,6 @@ import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import java.math.BigDecimal;
import java.util.Date;
......
package com.sw.mes.yb.report.controller;
import com.sw.mes.base.system.entity.DictionaryItem;
import com.sw.mes.base.system.service.DictionaryItemService;
import com.sw.mes.core.context.BaseContextHandler;
import com.sw.mes.core.response.ResponsePage;
import com.sw.mes.core.response.Result;
import com.sw.mes.core.response.ResultGenerator;
......@@ -11,7 +9,6 @@ import com.sw.mes.core.utils.DynamicSpecifications;
import com.sw.mes.core.utils.PageUtil;
import com.sw.mes.core.utils.RequestPage;
import com.sw.mes.yb.report.dto.CrystalPullingInfoRunTimeDto;
import com.sw.mes.yb.report.entity.CrystalPullingInfo;
import com.sw.mes.yb.report.service.CrystalPullingInfoService;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
......@@ -25,11 +22,9 @@ import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
import com.sw.mes.yb.report.entity.CrystalPullingInfoLog;
......@@ -54,12 +49,6 @@ public class CrystalPullingInfoLogController {
@Autowired
private CrystalPullingInfoLogService crystalPullingInfoLogService;
@Autowired
private DictionaryItemService dictionaryItemService;
@Autowired
private CrystalPullingInfoService crystalPullingInfoService;
@ApiOperation(value = "分页查询CrystalPullingInfoLog列表")
@ApiImplicitParams({
@ApiImplicitParam(name = "rows", value = "行数", dataType = "integer", paramType = "query"),
......
......@@ -39,12 +39,6 @@ public class EquipmentMonitorController {
@Autowired
private EquipmentMonitorService equipmentMonitorService;
@Autowired
private DingTalkService dingTalkService;
@Autowired
private BrokenBractBaseService brokenBractBaseService;
@ApiOperation(value = "设备工艺监控报表")
@GetMapping("/monitor")
public Result monitor() {
......
package com.sw.mes.yb.report.controller;
import com.sw.mes.core.context.BaseContextHandler;
import com.sw.mes.core.response.ResponsePage;
import com.sw.mes.core.response.Result;
import com.sw.mes.core.response.ResultGenerator;
......@@ -20,9 +19,7 @@ import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
import com.sw.mes.yb.report.entity.ExpansionBase;
......
......@@ -4,7 +4,6 @@ import com.sw.mes.core.response.Result;
import com.sw.mes.core.response.ResultGenerator;
import com.sw.mes.utils.ExcelUtil;
import com.sw.mes.yb.report.service.MaterialPreparationService;
import com.sw.mes.yb.report.service.RecycledMaterialPlanService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
......
......@@ -14,7 +14,6 @@ import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
......
package com.sw.mes.yb.report.controller;
import com.sw.mes.core.context.BaseContextHandler;
import com.sw.mes.core.response.ResponsePage;
import com.sw.mes.core.response.Result;
import com.sw.mes.core.response.ResultGenerator;
......@@ -20,9 +19,7 @@ import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
import com.sw.mes.yb.report.entity.ShoulderSeedingRate;
......
package com.sw.mes.yb.report.controller;
import com.sw.mes.core.context.BaseContextHandler;
import com.sw.mes.core.response.ResponsePage;
import com.sw.mes.core.response.Result;
import com.sw.mes.core.response.ResultGenerator;
......@@ -20,9 +19,7 @@ import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
import com.sw.mes.yb.report.entity.ShoulderSurvivalRate;
......
......@@ -68,16 +68,6 @@ public class WorkOrderProgressReportController {
return ResultGenerator.success(orderProgress);
}
// @ApiOperation(value = "查询工单收货报工信息列表-方法1")
// @PostMapping("/findOrderProgress1")
// public Result<List<WorkOrderProgressReportDto>> findOrderProgress(ServletRequest request, @ApiIgnore RequestPage requestPage) {
//
// //按工单查询工单收获报工信息列表
// List<WorkOrderProgressReportDto> orderProgress = workOrderProgressReportService.findOrderProgress1(request, requestPage);
// return ResultGenerator.success(orderProgress);
// }
@ApiOperation(value = "分页查询收货列表")
@ApiImplicitParams({
@ApiImplicitParam(name = "rows", value = "行数", dataType = "integer", paramType = "query"),
......@@ -115,34 +105,7 @@ public class WorkOrderProgressReportController {
})
@GetMapping("/findData")
public Result<ResponsePage<List<WipProcessDetailedInfoDto>>> findData(ServletRequest request, @ApiIgnore RequestPage requestPage) {
// Set<SearchFilter> searchSet = new HashSet<>();
String orderCode = request.getParameter("search_EQ_orderCode");
// if (!StringUtils.isBlank(orderCode)) {
// searchSet.add(new SearchFilter("orderCode", SearchFilter.Operator.EQ, orderCode));
// }
// String procName = request.getParameter("search_LIKE_procName");
// if (!StringUtils.isBlank(procName) && procName.equals("截断")) {
// searchSet.add(new SearchFilter("process_name", SearchFilter.Operator.IN, new String[]{"圆棒检验", "圆棒反切", "配圆棒"}));
// }
// if (!StringUtils.isBlank(procName) && procName.equals("刀剖")) {
// searchSet.add(new SearchFilter("process_name", SearchFilter.Operator.IN, new String[]{"磨削", "方棒检验", "方棒反切"}));
// }
// Specification<WipProcessDetailedInfoDto> specification = DynamicSpecifications.bySearchFilter(WipProcessDetailedInfoDto.class, searchSet);
//
// Set<SearchFilter> searchSet1 = new HashSet<>();
// if (!StringUtils.isBlank(orderCode)) {
// searchSet1.add(new SearchFilter("orderCode", SearchFilter.Operator.EQ, orderCode));
// }
// if (!StringUtils.isBlank(procName) && procName.equals("截断")) {
// searchSet1.add(new SearchFilter("process_name", SearchFilter.Operator.EQ, "毛棒截断"));
// }
// if (!StringUtils.isBlank(procName) && procName.equals("刀剖")) {
// searchSet1.add(new SearchFilter("process_name", SearchFilter.Operator.EQ, "刀剖"));
// }
// searchSet1.add(new SearchFilter("status", SearchFilter.Operator.EQ, 1));
// Specification<WipProcessDetailedInfoDto> specification1 = DynamicSpecifications.bySearchFilter(WipProcessDetailedInfoDto.class, searchSet);
//
// Specification<WipProcessDetailedInfoDto> specification2 = specification.or(specification1);
ResponsePage<List<WipProcessDetailedInfoDto>> responsePage = wipStorageService.getProcessInfoPage(orderCode, PageUtil.createPageable(requestPage, new String[]{"overtime DESC", "id DESC"}));
return ResultGenerator.success(responsePage);
}
......
......@@ -7,9 +7,6 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import java.math.BigDecimal;
import java.util.Date;
......
......@@ -4,9 +4,6 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.*;
import javax.validation.constraints.*;
import java.math.BigDecimal;
import java.util.Date;
......
package com.sw.mes.yb.report.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
......
......@@ -4,8 +4,6 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
import java.util.TreeSet;
/**
......
......@@ -4,8 +4,6 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @Author
* @Description:
......
......@@ -4,7 +4,6 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
/**
......
package com.sw.mes.yb.report.dto;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.metadata.BaseRowModel;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
......
......@@ -9,8 +9,6 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.persistence.Column;
/**
* @Author
* @Description:
......
......@@ -4,9 +4,6 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.*;
import javax.validation.constraints.*;
import java.math.BigDecimal;
import java.util.Date;
......
......@@ -3,8 +3,6 @@
*/
package com.sw.mes.yb.report.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment