备注信息调整

This commit is contained in:
lym
2024-06-25 09:12:43 +08:00
parent 03de668d9a
commit 280beb808a
7 changed files with 21 additions and 41 deletions
@@ -248,7 +248,7 @@ public class OrderController {
// 读取文件
excelReadUtil.setErr(0);
Map<String, Object> map = excelReadUtil.read(file);
System.out.println(" map " + map);
// System.out.println(" map " + map);
System.err.println(excelReadUtil.isErr());
// 判断是否读取有误
if (excelReadUtil.isErr() == -1) { // 文件为空
@@ -256,7 +256,7 @@ public class OrderController {
return;
}else if (excelReadUtil.isErr() > 0) {
// 返回文件
System.out.println("(Map<Object, Object>) " + (Map<Object, Object>) map.get("order")+ " , (List<OrderPlateImportExcelVO>)" +(List<OrderPlateImportExcelVO>) map.get("plate"));
// System.out.println("(Map<Object, Object>) " + (Map<Object, Object>) map.get("order")+ " , (List<OrderPlateImportExcelVO>)" +(List<OrderPlateImportExcelVO>) map.get("plate"));
ExcelWriterUtil.write(response, (Map<Object, Object>) map.get("order"), (List<OrderPlateImportExcelVO>) map.get("plate"), orderService.getSavePath() + File.separator + "生产单Excel导入错误导出模板.xlsx");
return;
} else {
@@ -4,20 +4,15 @@ import java.util.*;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.cf.imes.framework.common.exception.ServiceException;
import com.cf.imes.framework.common.pojo.PageResult;
import com.cf.imes.framework.common.util.object.BeanUtils;
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
import com.cf.imes.module.executor.controller.admin.plan.saveOptimize.PrintOrderPartsRespVO;
import com.cf.imes.module.executor.controller.admin.plate.vo.PlateGoodsRespVO;
import com.cf.imes.module.executor.controller.admin.plate.vo.PlateRespVO;
import com.cf.imes.module.executor.dal.dataobject.goods.GoodsDO;
import com.cf.imes.module.executor.dal.dataobject.orderParts.OrderPartsDO;
import org.apache.ibatis.annotations.Mapper;
import com.cf.imes.module.executor.controller.admin.orderParts.vo.*;
import org.apache.ibatis.annotations.Param;
import org.apache.poi.ss.formula.functions.T;
import static com.cf.imes.framework.security.core.util.SecurityFrameworkUtils.getUserOrganId;
@@ -49,22 +44,6 @@ public interface OrderPartsMapper extends BaseMapperX<OrderPartsDO> {
.orderByDesc(OrderPartsDO::getId));
}
default OrderPartsImportRespVO importOrderPartsList(List<OrderPartsSaveReqVO> importOrderParts) {
OrderPartsImportRespVO respVO = OrderPartsImportRespVO.builder().createOrderParts(new ArrayList<OrderPartsSaveReqVO>())
.updateOrderParts(new ArrayList<>()).failureOrderParts(new LinkedHashMap<>()).build();
importOrderParts.forEach(orderParts -> {
try{
OrderPartsDO orderPartsDO = BeanUtils.toBean(orderParts, OrderPartsDO.class);
insert(orderPartsDO);
orderParts.setId(orderPartsDO.getId());
respVO.getCreateOrderParts().add(orderParts);
}catch (ServiceException ex){
respVO.getFailureOrderParts().put(orderParts.getName(), ex.getMessage());
}
});
System.err.println("OrderPartsImportRespVO " + respVO);
return respVO;
}
IPage<OrderPartsRespVO> selectProductList(@Param("page") IPage<OrderPartsRespVO> page , @Param("orderId")Long orderId, @Param("roomId")Long roomId , @Param("bodyId")Long bodyId,@Param("organId")Long organId);
@@ -213,7 +213,7 @@ public class OrderServiceImpl implements OrderService {
rawGoodsMapper.updateOrderDeleted(orderId, OrderDeletedEnum.NOT_DELETED.getStatus(), SecurityFrameworkUtils.getLoginUser().getOrganId());
orderProcessMapper.updateOrderDeleted(orderId, OrderDeletedEnum.NOT_DELETED.getStatus(), SecurityFrameworkUtils.getLoginUser().getOrganId());
processStepMapper.updateOrderDeleted(orderId, OrderDeletedEnum.NOT_DELETED.getStatus(), SecurityFrameworkUtils.getLoginUser().getOrganId());
;
}
private void validateOrderExists(Long id, Long organId) {
@@ -229,7 +229,7 @@ public class OrderServiceImpl implements OrderService {
@Override
public PageResult<OrderDO> getOrderPage(OrderPageReqVO pageReqVO) {
System.out.println("pageReqVO " + pageReqVO);
return orderMapper.selectPage(pageReqVO.setOrganId(SecurityFrameworkUtils.getLoginUser().getOrganId()));
}
@@ -250,7 +250,7 @@ public class OrderServiceImpl implements OrderService {
index = OrderDeletedEnum.NOT_DELETED.getStatus();
else
index = OrderDeletedEnum.DELETED.getStatus();
System.out.println(" deleted " + deleted);
return index;
}
@Override
@@ -322,7 +322,7 @@ public class OrderServiceImpl implements OrderService {
// 校验存在
validateOrderBodyExists(orderId, bodyId, SecurityFrameworkUtils.getLoginUser().getOrganId());
// 删除
// orderBodyMapper.deleteAllByOrderId(orderId, bodyId);
// orderBodyMapper.deleteAllByOrderId(orderId, bodyId); 物理删除
orderBodyMapper.updateDeletedById(bodyId, OrderDeletedEnum.DELETED.getStatus(), SecurityFrameworkUtils.getLoginUser().getOrganId());
orderGroupMapper.updateDeletedById(bodyId, OrderDeletedEnum.DELETED.getStatus(), SecurityFrameworkUtils.getLoginUser().getOrganId());
@@ -428,7 +428,7 @@ public class OrderServiceImpl implements OrderService {
}
map.put("goodsDO", goodsLists);
map.put("plateGoodDOLists", plateGoodLists);
System.err.println(" map " + map);
// System.err.println(" map " + map);
return map;
}
@@ -452,7 +452,7 @@ public class OrderServiceImpl implements OrderService {
return futureDate;
} catch (DateTimeParseException e) {
// 在实际应用中应该有更详细的错误处理逻辑
System.err.println("Error parsing future date: " + e.getMessage());
// System.err.println("Error parsing future date: " + e.getMessage());
}
}
return date;
@@ -512,9 +512,7 @@ public class OrderServiceImpl implements OrderService {
Matcher matcher = pattern.matcher(phoneNumber);
// 判断手机号是否匹配正则表达式
if (matcher.matches()) {
System.out.println("手机号合法");
} else {
if (!matcher.matches()) {
throw exception(PHONE_NOT_LAWFUL);
}
}
@@ -532,7 +530,6 @@ public class OrderServiceImpl implements OrderService {
@Override
public void importExcelData(OrderDO orderDO, List<?> list) {
orderDO.setId((Long) snowFlakeGenerator.nextId(null));
System.out.println(excelTypeRealize.changeDate(list, orderDO.getId()));
Map<String, List<?>> listMap = excelTypeRealize.changeDate(list, orderDO.getId());
List<RawGoodsDO> rawGoodsDO = (List<RawGoodsDO>) listMap.get("rawGoodsDOS");
@@ -192,15 +192,13 @@ public class ApiTypeRealize {
List<OrderGroupDO> orderGroupDOList = orderGroupDO.values().stream().collect(Collectors.toList());
Map<Long, OrderGroupDO> orderGroupDOMap = orderGroupDOList.stream().collect(Collectors.toMap(OrderGroupDO::getId, v -> v));
System.out.println("groupPlate " + groupPlate + " plateDOMap " + plateDOMap + " orderGroupDOMap " + orderGroupDOMap);
groupPlate.forEach((k, v) -> { // k 加工组id
v.forEach(item -> {
if (plateDOMap.get(item.getPlateId()) != null) {
if (plateDOMap.get(item.getPlateId()).getIsSpecialShaped()) { // 异形相加
specialShapedNum++;
System.out.println(k + " 对应 " + specialShapedNum);
// System.out.println(k + " 对应 " + specialShapedNum);
}
}
});
@@ -535,6 +533,10 @@ public class ApiTypeRealize {
plate.getString("BoardType"))
.getData().getValue());
Long plateId = (Long) identifierGenerator.nextId(null);
String remarkJson = plate.getString("RemarkJson").replace("[", "").replace("]", "");
String remark = remarkJson != null && !remarkJson.trim().isEmpty() ? remarkJson : "";
PlateDO plateInfo = PlateDO.builder()
.id(plateId)
.orderId(orderId)
@@ -577,7 +579,7 @@ public class ApiTypeRealize {
.isSculpt(plate.getBoolean("IsModel"))
.isSpecialShaped(plate.getBoolean("UnRegular"))
.isCancel(false)
.remark(plate.getString("RemarkJson"))
.remark(remark)
.build();
// item 明细
@@ -747,7 +749,7 @@ public class ApiTypeRealize {
}
} else {
System.out.println("JSON 数据中没有订单信息(Orders 数组为空)。");
// System.out.println("JSON 数据中没有订单信息(Orders 数组为空)。");
}
return plateDetails;
@@ -822,7 +824,7 @@ public class ApiTypeRealize {
.depth(Double.valueOf(hole.getString("Depth")))
.build());
} catch (Exception e) {
System.out.println("HoleDetail " + hole);
// System.out.println("HoleDetail " + hole);
}
}
@@ -46,6 +46,7 @@
<select id="selectPartAll"
resultType="com.cf.imes.module.executor.controller.admin.orderParts.vo.PartGoodsRespVO">
SELECT DISTINCT
a.id,
a.name,
a.brand,
a.model,
@@ -244,6 +244,7 @@
<select id="selectPlateGoodsListSummary" resultType="com.cf.imes.module.executor.controller.admin.plate.vo.PlateGoodsRespVO">
select distinct
op.id,
op.name,
op.open_door_type,
op.height,
@@ -52,7 +52,7 @@ public class PlateServiceImpl implements PlateService {
}
// 判断板材是否存在
PlateDO existPlate = plateMapper.selectByGoodID(createReqVO.getGoodsId(), OrganContextHolder.getOrganId());
System.out.println(" existPlate " + existPlate);
// System.out.println(" existPlate " + existPlate);
if (existPlate != null){
throw exception(ErrorCodeConstants.PLATE_EXISTS);
}