xml导入修改,新增price,新增孔类型和id

This commit is contained in:
lym
2024-11-28 11:01:22 +08:00
parent 683eb69efd
commit d3847c9745
51 changed files with 580 additions and 159 deletions
@@ -369,7 +369,7 @@ public class OrderController {
} else {
orderDO.setStatus(OrderStatusEnum.NEW_ORDER.getStatus());
flag = xmlUtil.checkVO(orderXmlVO);
listMap = xmlTypeRealize.goodsInfoChange(orderXmlVO, orderDO.getId(), getUserOrganId());
}
}
if (!flag){
@@ -377,6 +377,13 @@ public class OrderController {
XMLUtil.writeErr(response, xmlStr, " order_add_xml_err.xml");
return;
}
long startTime = System.currentTimeMillis();
listMap = xmlTypeRealize.goodsInfoChange(orderXmlVO, orderDO.getId(), getUserOrganId());
long endTime = System.currentTimeMillis();
long duration = endTime - startTime;
System.out.println("方法运行耗时 goodsInfoChange: " + duration + " 毫秒");
}
orderService.importExcelData(orderDO, index, listMap);
} catch (Exception e) {
@@ -53,7 +53,7 @@ public class OrderStatisticsController {
@GetMapping("/producing/square")
@Operation(summary = "生产中生产平方数")
public CommonResult<Integer> getOrderSquareProduce() {
public CommonResult<Double> getOrderSquareProduce() {
return success(orderStatisticsService.orderSquareProduce());
}
@@ -63,7 +63,7 @@ public class OrderSupStatisticsController {
@GetMapping("/total/plateArea")
@Operation(summary = "拆单板件平方数")
public CommonResult<Map<String, Integer>> getPlateAreaTotal() {
public CommonResult<Map<String, Double>> getPlateAreaTotal() {
return success(orderSupStatisticsService.plateAreaTotal());
}
@@ -63,7 +63,6 @@ public class OrderSaveReqVO {
private String dealer;
@Schema(description = "经销商电话", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "经销商电话不能为空")
private String dealerPhoneNumber;
@Schema(description = "业务员")
@@ -80,7 +80,7 @@ public class GoodsDO extends BaseDO {
/**
* 价格
*/
private BigDecimal price;
private Double price;
/**
* 品牌
*/
@@ -12,6 +12,8 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.List;
/**
@@ -25,8 +27,7 @@ public interface OrderStatisticsMapper extends BaseMapperX<OrderDO> {
* 生产单数量统计
*/
default Integer selectOrderCount() {
return Math.toIntExact(selectCount(new LambdaQueryWrapperX<OrderDO>()
.eq(OrderDO::getDeleted, OrderDeletedEnum.NOT_DELETED.getStatus())));
return Math.toIntExact(selectCount());
}
/**
@@ -35,8 +36,8 @@ public interface OrderStatisticsMapper extends BaseMapperX<OrderDO> {
*/
default Integer selectOrderCountToday() {
return Math.toIntExact(selectCount(new LambdaQueryWrapperX<OrderDO>()
.eq(OrderDO::getDeleted, OrderDeletedEnum.NOT_DELETED.getStatus())
.eq(OrderDO::getOrderDate, LocalDate.now())));
// .eq(OrderDO::getDeleted, OrderDeletedEnum.NOT_DELETED.getStatus())
.between(OrderDO::getCreateTime, LocalDateTime.of(LocalDate.now(), LocalTime.MIN), LocalDateTime.of(LocalDate.now(), LocalTime.MAX))));
}
@@ -48,7 +49,7 @@ public interface OrderStatisticsMapper extends BaseMapperX<OrderDO> {
return Math.toIntExact(selectCount(new LambdaQueryWrapperX<OrderDO>()
.eq(OrderDO::getDeleted, OrderDeletedEnum.NOT_DELETED.getStatus())
.eq(OrderDO::getStatus, OrderStatusEnum.FINISH_PRODUCTION.getStatus())
.eq(OrderDO::getFinishTime, LocalDate.now())));
.between(OrderDO::getFinishTime, LocalDateTime.of(LocalDate.now(), LocalTime.MIN), LocalDateTime.of(LocalDate.now(), LocalTime.MAX))));
}
/**
@@ -67,7 +68,7 @@ public interface OrderStatisticsMapper extends BaseMapperX<OrderDO> {
* @param
* @return
*/
Integer selectOrderSquareProduce();
Double selectOrderSquareProduce();
/**
* 生产单状态按时间分组统计数量
@@ -17,7 +17,7 @@ public interface OrderSupStatisticsMapper extends BaseMapperX<OrderDO> {
/**
* 当日生产单板件平方数
*/
Integer selectOrderSquareProduceToday(@Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);
Double selectOrderSquareProduceToday(@Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);
/**
* 生产单按时间统计失效数量
@@ -423,7 +423,7 @@ public class OrderServiceImpl implements OrderService {
orderInputProcessor.batchSaveOrderPartsModel(partsRemark);
}
return order.getId();
return order == null ? 0 : order.getId();
}
// 生产单插入
@@ -458,7 +458,7 @@ public class OrderServiceImpl implements OrderService {
List<PlateDO> plateDO = (List<PlateDO>) listMap.get("plateDOS");
List<OrderPartsDO> partsDO = (List<OrderPartsDO>) listMap.get("orderPartsDOS");
List<OrderItemDO> itemDO = (List<OrderItemDO>) listMap.get("orderItemDOS");
List<OrderModelDO> orderModelDOS = (List<OrderModelDO>) listMap.get("orderModelDOS");
// List<OrderModelDO> orderModelDOS = (List<OrderModelDO>) listMap.get("orderModelDOS");
List<OrderPartsRemark> orderPartsRemarks = (List<OrderPartsRemark>) listMap.get("orderPartsRemarks");
List<PlateDetail> plateDetail = (List<PlateDetail>) listMap.get("plateDetail");
// 板材库匹配
@@ -484,16 +484,16 @@ public class OrderServiceImpl implements OrderService {
}
}
orderInputProcessor.batchInsert(rawGoodsDO, bodyDO, groupDO, partsDO, plateDO, itemDO, goodsDO, plateGoodDOS, partsDOList);
if (orderModelDOS != null && !orderModelDOS.isEmpty()) {
orderInputProcessor.batchSaveModel(orderModelDOS);
}
if (plateDetail != null){
// if (orderModelDOS != null && !orderModelDOS.isEmpty()) {
// orderInputProcessor.batchSaveModel(orderModelDOS);
// }
if (plateDetail != null && !plateDetail.isEmpty()){
List<OrderModelDO> orderModelDOs = BeanUtils.toBean(plateDetail, OrderModelDO.class);
if (!orderModelDOs.isEmpty()) {
orderModelDOs.forEach(orderModelDO -> orderModelDO.setOrderId(orderDO.getId()));
System.out.println("----" + orderModelDOs);
// if (!orderModelDOs.isEmpty()) {
// orderModelDOs.forEach(orderModelDO -> orderModelDO.setOrderId(orderDO.getId()));
// System.out.println("----" + orderModelDOs);
orderInputProcessor.batchSaveModel(orderModelDOs);
}
// }
}
if (orderPartsRemarks != null && !orderPartsRemarks.isEmpty()) {
orderInputProcessor.batchSaveOrderPartsModel(orderPartsRemarks);
@@ -34,7 +34,7 @@ public interface OrderStatisticsService {
/**
* 今日生产单完成总数
*/
Integer orderSquareProduce();
Double orderSquareProduce();
/**
* 生产单状态分组统计
@@ -111,7 +111,7 @@ public class OrderStatisticsServiceImpl implements OrderStatisticsService {
}
@Override
public Integer orderSquareProduce() {
public Double orderSquareProduce() {
return orderStatisticsMapper.selectOrderSquareProduce();
}
@@ -642,6 +642,9 @@ public class OrderStatisticsServiceImpl implements OrderStatisticsService {
// 计算时间跨度
getTimeSpan(reqVO);
// 重新计算开始时间喝结束时间
countTimeSpan(reqVO);
// 所有的日期集合
return generateDateRange(reqVO);
}
@@ -684,6 +687,56 @@ public class OrderStatisticsServiceImpl implements OrderStatisticsService {
}
}
/**
* 根据传入信息重新计算时间范围
*
* @param reqVO
*/
private void countTimeSpan(OrderStatisticsReqVO reqVO) {
Integer unit = reqVO.getUnit();
// 计算时间跨度
getTimeSpan(reqVO);
// 计算后的开始和结束时间
LocalDate startDate = ObjectUtil.clone(reqVO.getCreateTime()[0]);
LocalDate endDate = ObjectUtil.clone(reqVO.getCreateTime()[1]);
if (startDate.isAfter(endDate)) {
startDate = ObjectUtil.clone(reqVO.getCreateTime()[1]);
endDate = ObjectUtil.clone(reqVO.getCreateTime()[0]);
}
LocalDate first = startDate;
LocalDate end = endDate;
switch (OrderStatisticsUnit.fromValue(unit)) {
case QUARTER -> {
first = firstDayOfQuarter(startDate);
end = lastDayOfQuarter(endDate);
}
case MONTH -> {
first = startDate.with(TemporalAdjusters.firstDayOfMonth());
end = endDate.with(TemporalAdjusters.lastDayOfMonth());
}
case WEEK -> {
first = startDate.with(TemporalAdjusters.previousOrSame(java.time.DayOfWeek.MONDAY));
end = endDate.with(TemporalAdjusters.nextOrSame(java.time.DayOfWeek.SUNDAY));
}
}
reqVO.setCreateTime(new LocalDate[]{first, end});
}
private LocalDate firstDayOfQuarter(LocalDate date) {
int month = date.getMonthValue();
int quarter = (month - 1) / 3 + 1;
int startMonth = (quarter - 1) * 3 + 1;
return LocalDate.of(date.getYear(), startMonth, 1);
}
private LocalDate lastDayOfQuarter(LocalDate date) {
int month = date.getMonthValue();
int quarter = (month - 1) / 3 + 1;
int endMonth = (quarter - 1) * 3 + 3;
return LocalDate.of(date.getYear(), endMonth, 1).with(TemporalAdjusters.lastDayOfMonth());
}
/**
* 获取日期范围内的所有格式字符串
*
@@ -713,7 +766,7 @@ public class OrderStatisticsServiceImpl implements OrderStatisticsService {
startDate = startDate.plusMonths(1);
break;
case WEEK:
dateStr = startDate.format(DateTimeFormatter.ofPattern("yyyy-M-W"));
dateStr = startDate.format(DateTimeFormatter.ofPattern("yyyy-M-ww"));
// 加一周
startDate = startDate.plusWeeks(1);
break;
@@ -17,7 +17,7 @@ public interface OrderSupStatisticsService {
/**
* 拆单板件平方数统计
*/
Map<String, Integer> plateAreaTotal();
Map<String, Double> plateAreaTotal();
/**
* 有效、无效生产单数量统计
@@ -49,18 +49,18 @@ public class OrderSupStatisticsServiceImpl implements OrderSupStatisticsService{
}
@Override
public Map<String, Integer> plateAreaTotal() {
Map<String, Integer> resultMap = new LinkedHashMap<>();
public Map<String, Double> plateAreaTotal() {
Map<String, Double> resultMap = new LinkedHashMap<>();
// 生产单板件平方数
Integer total = orderStatisticsMapper.selectOrderSquareProduce();
Double total = orderStatisticsMapper.selectOrderSquareProduce();
resultMap.put("total", total);
// 当日生产单板件平方数
LocalDate date = LocalDate.now();
LocalDateTime startTime = LocalDateTime.of(date, LocalTime.MIDNIGHT);
LocalDateTime endTime = LocalDateTime.of(date, LocalTime.MAX);
Integer today = orderSupStatisticsMapper.selectOrderSquareProduceToday(startTime, endTime);
Double today = orderSupStatisticsMapper.selectOrderSquareProduceToday(startTime, endTime);
resultMap.put("today", today);
return resultMap;
@@ -15,6 +15,9 @@ import lombok.NoArgsConstructor;
@NoArgsConstructor
public class HoleDetail {
@Schema(description = "孔ID")
private String id;
@Schema(description = "孔名称,用于类型相同的孔,进行分组区分,一组的孔名称相同")
private String holeName;
@@ -25,6 +28,13 @@ public class HoleDetail {
@Schema(description = "孔类型(0大孔, 10小孔, 20木削, 21木削大孔, 30层板钉, 40通孔, 50连接杆, -10造型孔)")
private Integer holeType;
// xml无法转换数据
@Schema(description = "[加工面——正面、反面、左侧面、右侧面、上侧面、下侧面、斜面]")
private String faceTypeStr;
@Schema(description = "[方向——向后Z-、向前Z+、向右X+、向左X-、向下Y-、向上Y+、斜O]")
private String directionStr;
@Schema(description = "孔类型——简单孔(恒定直径的孔(盲孔、通孔/穿孔、间断孔))、沉头孔(恒定直径孔连接直径较大的孔(柱形、锥形))、锥孔、螺纹孔]")
private String holeTypeStr;
@Schema(description = "孔的起点坐标")
@@ -45,4 +55,46 @@ public class HoleDetail {
@Schema(description = "深度")
private Double depth;
// xml新增数据
@Schema(description = " 沉头孔内直径")
private Double diameterInner;
@Schema(description = " 沉头孔(台阶孔)深孔深度")
private Double depthInner;
@Schema(description = " 孔组X坐标偏移")
private Double groupXOffset;
@Schema(description = " 孔组Y坐标偏移")
private Double groupYOffset;
@Schema(description = " 孔组Z坐标偏移")
private Double groupZOffset;
@Schema(description = " 孔组数量")
private Integer groupNumber;
@Schema(description = "刀号")
private String toolNo;
@Schema(description = "刀名称")
private String toolName;
@Schema(description = "刀具起点X轴旋转角度")
private Double toolStartRotateX;
@Schema(description = "刀具起点Y轴旋转角度")
private Double toolStartRotateY;
@Schema(description = "刀具起点Z轴旋转角度")
private Double toolStartRotateZ;
@Schema(description = "刀具终点X轴旋转角度")
private Double toolEndRotateX;
@Schema(description = "刀具终点Y轴旋转角度")
private Double toolEndRotateY;
@Schema(description = "刀具终点Z轴旋转角度")
private Double toolEndRotateZ;
}
@@ -25,4 +25,6 @@ public class IContourData {
private Point pts; //
@Schema(description = "凸度(0直线段 >0逆时针方向 <0顺时针方向)")
private Double buls; //
@Schema(description = "起点圆弧半径(直线段为0)")
private Double radius; //
}
@@ -23,10 +23,14 @@ public class IOriginModelingData {
private Double knifeRadius;
@Schema(description = "厚度")
private Double thickness;
private Double thickness; // xml中没有
@Schema(description = "方向")
private Integer dir;
// xml中修改
@Schema(description = "造型/凹槽(边缘)的刀路方向——内圈顺时针(最)外圈逆时针、内圈顺时针(最)外圈顺时针、内圈逆时针(最)外圈顺时针、内圈逆时针(最)外圈逆时针")
private String direction;
@Schema(description = "轮廓,造型最外围的轮廓数据")
private List<IContourData> outline;
@Schema(description = "孤岛轮廓")
@@ -41,6 +45,7 @@ public class IOriginModelingData {
private Double addDepth;
// ============ 启用 api =============
@Schema(description = "造型点列表")
private List<PointList> pointList;
// @Schema(description = "造型点列表")
// private List<PointList> pointList;
}
@@ -20,15 +20,19 @@ public class ModelDetail {
@Schema(description = "造型ID")
private Integer id;
@Schema(description = "父ID")
private Integer parentId;
@Schema(description = "内部孤岛ID集合")
private String[] subIDs;
@Schema(description = "类型——矩形槽Rectangle、路径槽Path、内铣槽internalMilling、折返路径槽turnbackPath")
private String type;
private String type; // 目前只在xml中
@Schema(description = "使用字典进行解析 造型排版面 0正面, 1反面, 2侧面")
@Schema(description = "根据是否为正面,face有不同的含义")
private Integer faceType;
// xml更新
@Schema(description = "加工面——正面、反面、左侧面、右侧面、上侧面、下侧面、斜面")
private String grooveFace; // 目前只在xml中
@Schema(description = "造型长度")
private Double width;
@Schema(description = "造型宽度")
@@ -37,18 +41,20 @@ public class ModelDetail {
private Double depth;
@Schema(description = "圆角半径")
private Double round;
private Double round; // 目前只在xml中
@Schema(description = "刀路冗余量(偏移重叠量)")
private Double redundance;
private Double redundance; // 目前只在xml中
@Schema(description = "角度(二维刀路V型刀提角/清角用)")
private Double tangentAngle;
private Double tangentAngle; // 目前只在xml中
@Schema(description = "造型数量")
private Integer count;
// @Schema(description = "造型数量")
// private Integer count;
@Schema(description = "造像使用刀具名称")
private String knifeName;
@Schema(description = "刀号")
private String toolNo;
@Schema(description = "刀半径")
private Double knifeRadius;
@@ -61,4 +67,10 @@ public class ModelDetail {
@Schema(description = "造型偏移量列表-模块偏移数据")
private List<OffSetList> offSetList;
// xml新增
@Schema(description = "加工模式/方式——由内向外、由外向内")
private String mode;
}
@@ -34,6 +34,6 @@ public class OffSetList {
@Schema(description = "二维刀路的属性-刀的名称")
private String name;
@Schema(description = "二维刀路的属性-刀的半径")
private Double radius;
private Double radius; // api中为直径
}
@@ -100,7 +100,7 @@ public class PlateDetail{
private BasePosition plateBasePosition; // 板件基准点坐标
private List<PointDetail> pointDetail ; //点明细,表示小板外围轮廓的几个转折点(不含封边)
private List<PointDetail> rawPointDetail ; //原始点明细(含封边)
private List<PointDetail> basePointDetail ; //坯料点明细
private List<PointDetail> basePointDetail ; //坯料点明细 (xml中特有,现可以不用)
private Map<String,Integer> holeCount;//孔类型数量集合 (xml中特有----孔类型,对应的数量)
private List<HoleDetail> holeDetail ; //孔明细,表示板上的孔
@@ -199,7 +199,10 @@ public class ApiDataAchieve {
// 订单获取
public Future<JSONObject> getApiOrder(String token, String shopId, String orderNo) {
JSONObject jsonOrders = new JSONObject();
jsonOrders.put(ORDER_NO_KEY, shopId + "@N" +orderNo);
orderNo = "N" +orderNo;
JSONArray orderList = new JSONArray();
orderList.add(orderNo.replace(" ", ""));
jsonOrders.put(ORDER_NO_KEY, orderList);
JSONObject order = apiDataProduction.getApiOrderList(token, jsonOrders);
return new AsyncResult<>(order);
}
@@ -14,6 +14,7 @@ import com.cf.imes.module.executor.dal.dataobject.orderParts.OrderPartsDO;
import com.cf.imes.module.executor.dal.dataobject.plate.PlateDO;
import com.cf.imes.module.executor.dal.dataobject.rawgoods.RawGoodsDO;
import com.cf.imes.module.executor.enums.*;
import com.cf.imes.module.executor.service.customplateno.CustomPlateNoGenerateService;
import com.cf.imes.module.executor.util.fileConversion.admin.SnowflakeIdWorker3rd;
import com.cf.imes.module.executor.util.deviseData.structure.*;
import com.cf.imes.module.system.api.dict.DictDataApi;
@@ -49,6 +50,8 @@ public class ApiTypeRealize {
@Resource
private ApiDataAchieve apiDataAchieve;
@Resource
private CustomPlateNoGenerateService customPlateNoGenerateService;
private static final Integer X = 0;
private static final Integer Y = 1;
@@ -90,6 +93,10 @@ public class ApiTypeRealize {
List<OrderItemDO> itemsList = new ArrayList<>();
if (order.getJSONArray(ProduceApiConstants.DATA) == null || order.getJSONArray(ProduceApiConstants.DATA).size() < 1) {
return map;
}
// 生产单数据
OrderDO orderDO = orderInfoChange(order, orderId, orderNo, organId);
map.put(FieldConstants.ORDER, orderDO);
@@ -114,15 +121,21 @@ public class ApiTypeRealize {
Map<String, Object> partsDO = partsInfoChange(dataParts, orderId, goodsDOS, bodyInfoChange, organId, token);
Map<Long, OrderPartsRemark> partsRemark = (Map<Long, OrderPartsRemark>) partsDO.get("remarks"); // 配件备注
map.put(FieldConstants.PARTS_REMARK, new ArrayList<>(partsRemark.values()));
if (partsRemark != null) {
map.put(FieldConstants.PARTS_REMARK, new ArrayList<>(partsRemark.values()));
}
Map<Long, OrderPartsDO> orderPartsDO = (Map<Long, OrderPartsDO>) partsDO.get("partsInfos");
map.put(FieldConstants.PARTS, new ArrayList<>(orderPartsDO.values()));
if (orderPartsDO != null) {
map.put(FieldConstants.PARTS, new ArrayList<>(orderPartsDO.values()));
}
Map<Long, OrderItemDO> partsItems = (Map<Long, OrderItemDO>) partsDO.get("partsItems");
partsItems = orderPartsChange(orderGroupDO, groupLists, partsItems);// item补充
itemsList.addAll(partsItems.values());
if (partsItems != null) {
itemsList.addAll(partsItems.values());
}
// 板材 写库
@@ -130,6 +143,8 @@ public class ApiTypeRealize {
Map<Long, PlateDO> orderPlatesDO = (Map<Long, PlateDO>) platesDO.get("platesInfos");
if (orderPlatesDO != null) {
// 需要添加自定义板编号
plateAddGroupName(orderGroupDO, groupLists, orderPlatesDO);
map.put(FieldConstants.PLATE, new ArrayList<>(orderPlatesDO.values()));
}
@@ -167,15 +182,37 @@ public class ApiTypeRealize {
if (bodyItemsPlates != null) {
map.put(FieldConstants.BODY, new ArrayList<>(bodyItemsPlates.values()));
} else {
map.put(FieldConstants.BODY, new ArrayList<>(bodyInfoChange.values())); // Map<Long, OrderBodyDO> bodyInfoChange
map.put(FieldConstants.BODY, new ArrayList<>(bodyInfoChange.values()));
}
return map;
}
/**
* 板件新增加工组名称
*
*/
public List<PlateDO> plateAddGroupName(Map<Long, OrderGroupDO> orderGroupDO,
Map<Long, List<Long>> groupLists,
Map<Long, PlateDO> orderPlatesDO) {
if (orderGroupDO == null || groupLists == null || orderPlatesDO == null || orderPlatesDO.isEmpty()) {
return Collections.emptyList();
}
// 遍历groupList
groupLists.forEach((k, v) -> {
// 获取加工组名称
String groupName = orderGroupDO.get(k).getName();
// 遍历v,匹配orderPlatesDO
v.forEach(v1 -> {
if (orderPlatesDO.get(v1) != null) {
// orderPlatesDO.get(v1).setProcessGroupName(groupName);
}
});
});
return new ArrayList<>(orderPlatesDO.values());
}
/**
* bodyInfoChange: BoxId body 暂时未用
*
* @param orderGroupDO: ModuleID group
* @param groupLists: ModuleID 板材、配件id
@@ -272,7 +309,7 @@ public class ApiTypeRealize {
for (int i = 0; i < value.size(); i++) {
JSONObject group = value.getJSONObject(i);
OrderGroupDO bodyInfo = OrderGroupDO.builder()
OrderGroupDO orderGroup = OrderGroupDO.builder()
.id((Long) identifierGenerator.nextId(null))
.orderId(orderId)
.bodyId(bodyInfoChange.get(group.getLong(ProduceApiConstants.M_BOX_ID)).getId())//group.getLong("BoxID")
@@ -290,7 +327,7 @@ public class ApiTypeRealize {
.organId(organId)
.build();
groupLists.put(group.getLong(ProduceApiConstants.M_MODULE_ID), jsonArrayToList(group.getJSONArray(ProduceApiConstants.M_ITEM_ID_LIST)));
orderGroupDOs.put(group.getLong(ProduceApiConstants.M_MODULE_ID), bodyInfo);
orderGroupDOs.put(group.getLong(ProduceApiConstants.M_MODULE_ID), orderGroup);
}
}
@@ -413,6 +450,7 @@ public class ApiTypeRealize {
.thickness(goods.getDouble(ProduceApiConstants.G_THICKNESS))
.brand(goods.getString(ProduceApiConstants.G_BRAND))
.spec(goods.getString(ProduceApiConstants.G_SPEC))
.price(goods.getDouble(ProduceApiConstants.G_PRICE))
.organId(organId)
.build();
rawGoodsDOS.put(goods.getLong(ProduceApiConstants.G_DOOR_ID), rawGoodsDO);
@@ -432,6 +470,7 @@ public class ApiTypeRealize {
.thickness(BigDecimal.valueOf(goods.getDouble(ProduceApiConstants.G_THICKNESS)))
.brand(goods.getString(ProduceApiConstants.G_BRAND))
.spec(goods.getString(ProduceApiConstants.G_SPEC))
.price(goods.getDouble(ProduceApiConstants.G_PRICE))
.organId(organId)
.build();
goodsDOS.put(goods.getLong(ProduceApiConstants.G_DOOR_ID), goodsDO);
@@ -525,7 +564,6 @@ public class ApiTypeRealize {
String goodsSn;
try {
JSONObject jsonGood = apiDataAchieve.getApiGoodsMessage(token, new Long[]{goodId}).get();
System.out.println(jsonGood.getJSONArray(ProduceApiConstants.DATA));
goodsSn = jsonGood.getJSONArray(ProduceApiConstants.DATA).getJSONObject(0).getString(ProduceApiConstants.GD_GOODS_SN);
} catch (Exception e){
@@ -605,6 +643,7 @@ public class ApiTypeRealize {
.unit(parts.getString(ProduceApiConstants.PD_UNITS))
.isComposite(parts.getBoolean(ProduceApiConstants.PD_IS_COMPOSITE))
.remark(parts.getString(ProduceApiConstants.PD_REMARK))
.price(parts.getDouble(ProduceApiConstants.PD_PRICE))
.organId(organId)
.build();
@@ -743,6 +782,8 @@ public class ApiTypeRealize {
.filterType("")
.remark(remark)
.organId(organId)
// .roomName(bodyInfos.get(plate.getLong(ProduceApiConstants.BD_BOX_ID)).getRoomName())
// .bodyName(bodyInfos.get(plate.getLong(ProduceApiConstants.BD_BOX_ID)).getName())
.build();
// item 明细
OrderItemDO itemPlate = OrderItemDO.builder()
@@ -1022,6 +1063,8 @@ public class ApiTypeRealize {
for (int i = 0; i < holes.size(); i++) {
JSONObject hole = holes.getJSONObject(i);
holeDetails.add(HoleDetail.builder()
.id(hole.getString(ProduceApiConstants.BPD_HOLE_ID))
.holeType(Integer.valueOf(hole.getString(ProduceApiConstants.BPD_HOLE_TYPE)))
.startX(Double.valueOf(hole.getString(ProduceApiConstants.BPD_HOLE_X)))
.startY(Double.valueOf(hole.getString(ProduceApiConstants.BPD_HOLE_Y)))
.faceType(hole.getInteger(ProduceApiConstants.BPD_HOLE_FACE))
@@ -52,6 +52,7 @@ public class ProduceApiConstants {
public static final String PD_LENGTH = "Length"; // 配件长
public static final String PD_WIDTH = "Width"; // 配件宽
public static final String PD_THICKNESS = "Thickness"; // 配件厚
public static final String PD_PRICE = "Price";
// ========== getApiOrderBodyMessage boxsList 柜体明细模块 ==========
public static final String B_BOX_ID = "BoxID"; // 柜体标识
@@ -75,6 +76,7 @@ public class ProduceApiConstants {
public static final String G_WIDTH = "Width"; // 商品宽度
public static final String G_EXTRA_PROP = "ExtraProp"; // 额外属性
public static final String G_HAS_WAVE = "HasWave"; // 有无纹路 1:有;0:无
public static final String G_PRICE = "Price";
// ========== getApiModuleTypeDataMessage getModuleTypeList 加工组关联板件、五金信息列表模块 ==========
public static final String M_MODULE_TYPE_ID = "ModuleTypeID"; // 加工组类型ID
@@ -241,6 +243,8 @@ public class ProduceApiConstants {
public static final String BPD_HOLES = "Holes"; // 孔
public static final String BPD_SIDE_HOLES = "SideHoles"; // 侧孔 (基于成品轮廓 含封边)
public static final String BPD_HOLE_ID = "ID";
public static final String BPD_HOLE_TYPE = "Type";
public static final String BPD_HOLE_X = "X";
public static final String BPD_HOLE_Y = "Y";
public static final String BPD_HOLE_DEPTH = "Depth";
@@ -16,6 +16,8 @@ import com.cf.imes.module.executor.dal.dataobject.plate.PlateDO;
import com.cf.imes.module.executor.dal.dataobject.plate.PlateGoodDO;
import com.cf.imes.module.executor.dal.dataobject.rawgoods.RawGoodsDO;
import com.cf.imes.module.executor.enums.OrderItemTypeEnum;
import com.cf.imes.module.executor.service.customplateno.CustomPlateNoGenerateService;
import com.cf.imes.module.executor.util.deviseData.structure.PlateDetail;
import com.cf.imes.module.executor.util.fileConversion.admin.SnowflakeIdWorker3rd;
import com.cf.imes.module.system.api.dict.DictDataApi;
import com.cf.imes.module.system.api.dict.dto.DictDataRespDTO;
@@ -47,6 +49,9 @@ public class ExcelTypeRealize {
@Resource
private DictDataApi dictDataApi;
@Resource
private CustomPlateNoGenerateService customPlateNoGenerateService;
final String NOT_ASSIGNED = "未命名";
final String PLATE = "plate";
final String PARTS = "parts";
@@ -71,7 +76,7 @@ public class ExcelTypeRealize {
ArrayList<OrderPartsDO> orderPartsDOS = new ArrayList<>();
ArrayList<OrderItemDO> orderItemDOS = new ArrayList<>();
ArrayList<OrderModuleExtraDO> orderModuleExtraDOS = new ArrayList<>();
ArrayList<OrderModelDO> orderModelDOS = new ArrayList<>();
ArrayList<PlateDetail> plateDetail = new ArrayList<>();
ArrayList<OrderPartsRemark> orderPartsRemarks = new ArrayList<>();
HashMap<String, List<OrderPlateImportExcelVO>> checkMap = classifyGoods(excelVOS);
@@ -271,7 +276,7 @@ public class ExcelTypeRealize {
if (combination.getGoodType().equals("板材")) {
//板材
plateCountByCombination[0] = plateCountByCombination[0] + Double.parseDouble(combination.getGoodsNumber());
System.out.println(" 房间名0 " + combination.getRoomsName() + " 柜体名0 " + combination.getCabinetsName() + " 柜体板数量0 " + plateCountByCabinetName[0] + " 加工组板数量0 " + plateCountByCombination[0]);
// System.out.println(" 房间名0 " + combination.getRoomsName() + " 柜体名0 " + combination.getCabinetsName() + " 柜体板数量0 " + plateCountByCabinetName[0] + " 加工组板数量0 " + plateCountByCombination[0]);
for (int i = 0; i < Integer.parseInt(combination.getGoodsNumber()); i++) {
long plateNo = idWorker.nextId();
@@ -311,6 +316,9 @@ public class ExcelTypeRealize {
.isSpecialShaped(false)
.isSculpt(false)
.remark(remarkExtract(combination.remarkJSON()))
// .roomName(roomName)
// .bodyName(bodyName)
// .processGroupName(combinationName)
.build();
plateDOS.add(plateDO);
@@ -318,8 +326,9 @@ public class ExcelTypeRealize {
.roomId(roomId).bodyId(bodyId).plateId(plateId)
.num(1.0).groupId(synthesisTypeName != " " ? groupId : null).build();
orderItemDOS.add(orderItemDO);
orderModelDOS.add(OrderModelDO.builder().orderId(orderId).plateId(plateId)
.typographicFace(Integer.valueOf(typographyDTO.getValue())).build());
plateDetail.add(PlateDetail.builder().orderId(orderId).plateId(plateId)
.typographicFace(Integer.valueOf(typographyDTO.getValue()))
.texture(plateDO.getTexture()).openDoorType(plateDO.getOpenDoorType()).build());
}
@@ -363,6 +372,8 @@ public class ExcelTypeRealize {
});
});
// 添加板材自定义板编号
customPlateNoGenerateService.generateCustomPlateNo(plateDOS);
map.put("rawGoodsDOS", rawGoodsDOS);
map.put("goodsDOS", goodsDOS);
map.put("plateGoodDOS", plateGoodDOS);
@@ -372,7 +383,7 @@ public class ExcelTypeRealize {
map.put("orderPartsDOS", orderPartsDOS);
map.put("orderItemDOS", orderItemDOS);
map.put("orderModuleExtraDOS", orderModuleExtraDOS);
map.put("orderModelDOS", orderModelDOS);
map.put("plateDetail", plateDetail);
map.put("orderPartsRemarks", orderPartsRemarks);
return map;
}
@@ -111,9 +111,9 @@ public class AssemblyXmlVO implements Serializable {
@XmlAttribute(name = "moduleCode")
private String moduleCode;
// 物料编码
@XmlAttribute(name = "parentCode")
private String parentCode;
// 子组件/部件物料编码
@XmlAttribute(name = "subCodes")
private String subCodes;
// 备注
@XmlElement(name = "Remarks")
@@ -195,7 +195,7 @@ public class BlockXmlVO implements Serializable {
@XmlElement(name = "Holes")
private HoleXmlVOS holeXmlVOS;
// 凹槽信息
// 凹槽信息 / 造型
@XmlElement(name = "Grooves")
private GrooveXmlVOS grooveXmlVOS ;
@@ -19,9 +19,9 @@ public class GrooveXmlVO implements Serializable {
@XmlAttribute(name = "id")
private String id;
// 父(孤岛)ID
@XmlAttribute(name = "parentID")
private String parentId;
// 内部孤岛ID集合
@XmlAttribute(name = "subIDs")
private String subIDs;
// 类型——矩形槽Rectangle、路径槽Path、内铣槽internalMilling、折返路径槽turnbackPath
@XmlAttribute(name = "type")
@@ -111,9 +111,9 @@ public class HardwareXmlVO implements Serializable {
@XmlAttribute(name = "moduleCode")
private String moduleCode;
// 物料编码
@XmlAttribute(name = "parentCode")
private String parentCode;
// 子五金物料编码
@XmlAttribute(name = "subCodes")
private String subCodes;
// 备注
@XmlElement(name = "Remarks")
@@ -6,7 +6,6 @@ import lombok.NoArgsConstructor;
import javax.xml.bind.annotation.*;
import java.io.Serializable;
import java.util.List;
@Data
@AllArgsConstructor
@@ -20,9 +19,9 @@ public class IsletXmlVO implements Serializable {
@XmlAttribute(name = "id")
private String id;
// 父(凹槽)ID
@XmlAttribute(name = "parentID")
private String parentId;
// 内部槽ID集合
@XmlAttribute(name = "subIDs")
private String subIDs;
// 内层(不含内嵌孤岛内的凹槽)凹槽数量
@XmlAttribute(name = "grooveCount")
@@ -42,6 +42,12 @@ public class XMLUtil {
final String NOT_ASSIGNED = "未命名";
final String NOT_ASSIGNED_CODE = "未命编号";
final String ROOM_CODE = "roomCode";
final String BODY_CODE = "boxCode";
final String MODULE_CODE = "moduleCode";
final String GROUP_CODE = "groupCode";
@Resource
private DictDataApi dictDataApi;
@@ -177,8 +183,8 @@ public class XMLUtil {
// 数据格式转换
public Boolean checkVO(OrderXmlVO orderXmlVO) {
long startTime = System.currentTimeMillis();
AtomicBoolean error = new AtomicBoolean(true);
boolean flag = true;
RoomXmlVOS roomXmlVOS = orderXmlVO.getRoomXmlVOS();
if (roomXmlVOS != null) {
@@ -198,6 +204,12 @@ public class XMLUtil {
MaterialXmlVO materialXmlVO = orderXmlVO.getMaterialXmlVO();
if (materialXmlVO != null) {
PlateXmlVOS plateXmlVOS = materialXmlVO.getPlateXmlVOS();
Map<String, Object> map = extractPlateDate(plateXmlVOS);
if (map != null) {
// 判断板块和归属code是否相匹配
}
if (plateXmlVOS != null && plateXmlVOS.getPlateXmlVOList().size() > 0) {
checkPlates(plateXmlVOS.getPlateXmlVOList(), error);
}
@@ -214,7 +226,11 @@ public class XMLUtil {
}
}
return flag;
long endTime = System.currentTimeMillis();
long duration = endTime - startTime;
System.out.println("方法运行耗时: " + duration + " 毫秒");
return error.get();
}
@@ -285,7 +301,7 @@ public class XMLUtil {
* @param error: 错误赋值
*/
private boolean positiveNumberAndBack(String value, String name, Consumer<String> setter, Class<?> targetType, AtomicBoolean error) {
boolean index = true;
boolean index = error.get();
if (ToolUtil.convertToType(value, targetType)) {
if (!ToolUtil.checkNumber(value)) {
setter.accept(String.format(POSITIVE_ERR, name));
@@ -358,7 +374,7 @@ public class XMLUtil {
* @param error: 错误赋值
*/
private boolean isEmptyBackAndPositiveNumberAndBack(Supplier<String> getter, String name, Consumer<String> setter, Class<?> targetType, AtomicBoolean error) {
boolean index = true;
boolean index = error.get();
String value = getter.get();
if (StringUtils.isEmpty(value)) {
setter.accept(String.format(IS_NULL, name));
@@ -633,7 +649,7 @@ public class XMLUtil {
isEmptyAddAndNumber(room::getAxisZrotate, room::setAxisZrotate, "0", Double.class, "绕Z轴旋转角度", flag);
// 柜体数据格式验证
if (room.getBoxXmlVOList() != null && room.getBoxXmlVOList().size() > 0) {
if (room.getBoxXmlVOList() != null && !room.getBoxXmlVOList().isEmpty()) {
checkBoxList(room.getBoxXmlVOList(), flag);
}
@@ -816,14 +832,14 @@ public class XMLUtil {
}
private void checkCorrelations(CorrelationXmlVOS correlationXmlVOS, AtomicBoolean flag) {
notEmptyPositiveNumber(correlationXmlVOS::getCount, correlationXmlVOS::setCount, "关联配件数量", Integer.class, flag);
notEmptyPositiveNumber(correlationXmlVOS::getCount, correlationXmlVOS::setCount, "关联配件数量", Integer.class, flag);
if (correlationXmlVOS.getCorrelationXmlVOList() != null && !correlationXmlVOS.getCorrelationXmlVOList().isEmpty()) {
for (CorrelationXmlVO correlationXmlVO : correlationXmlVOS.getCorrelationXmlVOList()) {
if (StringUtils.isEmpty(correlationXmlVO.getItemCode())) {
isEmptyAndBack(correlationXmlVO::getName, "关联配件名称", correlationXmlVO::setName, flag);
}
isEmptyBackAndPositiveNumber(correlationXmlVO::getCount, "关联配件数量", correlationXmlVO::setCount, Integer.class, flag);
isEmptyBackAndPositiveNumber(correlationXmlVO::getCount, "关联配件数量", correlationXmlVO::setCount, Integer.class, flag);
}
}
}
@@ -903,7 +919,7 @@ public class XMLUtil {
}
private void checkHole(HoleXmlVO holeXmlVO, AtomicBoolean flag) {
isEmptyBackAndInvalid(holeXmlVO::getType, holeXmlVO::setType, DictTypeConstants.HOLE_FACE, "小板孔加工面 ", flag);
// (holeXmlVO::getType, holeXmlVO::setType, DictTypeConstants.HOLE_FACE, "小板孔类型 ", flag);
isEmptyBackAndInvalid(holeXmlVO::getDirection, holeXmlVO::setDirection, DictTypeConstants.HOLE_DIRECTION, "小板孔加工方向 ", flag);
isEmptyBackAndPositiveNumber(holeXmlVO::getDiameter, "小板孔直径", holeXmlVO::setDiameter, Double.class , flag);
if (StringUtils.isNotEmpty(holeXmlVO.getType()) && holeXmlVO.getType().equals("沉头孔")) {
@@ -1151,4 +1167,37 @@ public class XMLUtil {
isEmptyBackAndNumber(pointXmlVO::getPointZ, pointXmlVO::setPointZ, Double.class, name + "起点Z坐标", flag);
}
// 板件房间、柜体、模块、加工组数据抽取
public Map<String ,Object> extractPlateDate(PlateXmlVOS plateXmlVOS) {
Map<String, Object> map = new HashMap<>();
if (plateXmlVOS.getPlateXmlVOList() == null || plateXmlVOS.getPlateXmlVOList().isEmpty()) {
return null;
}
List<PlateXmlVO> plateXmlVOList = plateXmlVOS.getPlateXmlVOList();
// 遍历
for (PlateXmlVO plateXmlVO : plateXmlVOList) {
if (plateXmlVO.getBlockXmlVOS() == null || plateXmlVO.getBlockXmlVOS().getBlockXmlVOList() == null || plateXmlVO.getBlockXmlVOS().getBlockXmlVOList().isEmpty()) {
continue;
}
List<BlockXmlVO> blockXmlVOList = plateXmlVO.getBlockXmlVOS().getBlockXmlVOList();
for (BlockXmlVO blockXmlVO : blockXmlVOList) {
Map<String , String> code = new HashMap<>();
code.put(ROOM_CODE, blockXmlVO.getRoomCode());
code.put(BODY_CODE, blockXmlVO.getBoxCode());
code.put(MODULE_CODE, blockXmlVO.getModuleCode());
code.put(GROUP_CODE, blockXmlVO.getGroupCode());
map.put(blockXmlVO.getProductionCode(), code); // 生产编号
}
}
return map;
}
// 加工组数据对应检查
public void checkGroupCorresponding(Map<String,Object> plateMap, List<GroupXmlVO> groupXmlVOList, AtomicBoolean flag) {
}
// 造型中孤岛对应关系检查
public void checkIslandCorresponding(IsletXmlVOS islandXmlVOList, AtomicBoolean flag) {
}
}
@@ -6,6 +6,7 @@ import com.alibaba.nacos.common.utils.StringUtils;
import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
import com.cf.imes.framework.mybatis.core.generator.SnowFlakeGenerator;
import com.cf.imes.module.executor.controller.admin.orderParts.vo.OrderPartsRemark;
import com.cf.imes.module.executor.controller.admin.plan.dto.Point;
import com.cf.imes.module.executor.dal.dataobject.goods.GoodsDO;
import com.cf.imes.module.executor.dal.dataobject.orderBody.OrderBodyDO;
import com.cf.imes.module.executor.dal.dataobject.orderGroup.OrderGroupDO;
@@ -27,6 +28,7 @@ import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.*;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Supplier;
import java.util.stream.Collectors;
@@ -495,6 +497,18 @@ public class XmlTypeRealize {
return map;
}
// 备注信息提取,判断长度是否超过255,超过255则截取255,并保存在备注中
private String getRemark(List<RemarkXmlVO> finalRemarkXmlVOS) {
StringBuilder sb = new StringBuilder();
for (RemarkXmlVO remarkXmlVO : finalRemarkXmlVOS) {
String info = remarkXmlVO.getInfo();
if (info.length() > 255) {
info = info.substring(0, 255);
}
sb.append(info);
}
return sb.toString();
}
public Map<String, Map<String, Object>> goodsInfoChange(Long organId, Long orderId, Map<String, List<EdgingXmlVO>> edgingMp, Map<String, List<HardwareXmlVO>> hardwareMp,
Map<String, List<AssemblyXmlVO>> assemblyMp,
@@ -510,19 +524,25 @@ public class XmlTypeRealize {
for (String key : edgingMp.keySet()) {
Long partsId = (Long) identifierGenerator.nextId(null);
EdgingXmlVO edgingXmlVO = edgingMp.get(key).get(0);
orderPartsDOMap.put(key, OrderPartsDO.builder()
OrderPartsDO orderPartsDO = OrderPartsDO.builder()
.id(partsId)
.organId(organId)
.orderId(orderId)
.goodsId(edgingXmlVO.getItemCode())
.name(edgingXmlVO.getName())
.color(edgingXmlVO.getColor())
.material(edgingXmlVO.getMaterial())
.category("封边条")
.type("封边条")
.width(Double.valueOf(edgingXmlVO.getWidth()))
.length(Double.valueOf(edgingXmlVO.getLength()))
.thickness(Double.valueOf(edgingXmlVO.getThickness()))
.brand(edgingXmlVO.getBrand())
.factory(edgingXmlVO.getManufacturer())
.spec(edgingXmlVO.getSpecs())
.unit(edgingXmlVO.getUnit())
.isComposite(false)
.build());
.build();
// 属性相同的配件的集合,可能存在房间 柜体 加工组 不同
Map<String, List<EdgingXmlVO>> edgingGroupById = edgingMp.get(key).stream().collect(
@@ -564,6 +584,9 @@ public class XmlTypeRealize {
.build());
});
orderPartsDO.setRemark(getRemark(finalRemarkXmlVOS));
orderPartsDOMap.put(key, orderPartsDO);
if (!finalRemarkXmlVOS.isEmpty()) {
orderPartsRemarks.put(key, OrderPartsRemark.builder()
.partsId(partsId)
@@ -579,19 +602,28 @@ public class XmlTypeRealize {
for (String key : hardwareMp.keySet()) {
Long partsId = (Long) identifierGenerator.nextId(null);
HardwareXmlVO hardwareXmlVO = hardwareMp.get(key).get(0);
orderPartsDOMap.put(key, OrderPartsDO.builder()
OrderPartsDO orderPartsDO = OrderPartsDO.builder()
.id(partsId)
.organId(organId)
.orderId(orderId)
.goodsId(hardwareXmlVO.getItemCode())
.name(hardwareXmlVO.getName())
.color(hardwareXmlVO.getColor())
.material(hardwareXmlVO.getMaterial())
.category("五金")
.type(hardwareXmlVO.getType())
.width(Double.valueOf(hardwareXmlVO.getWidth()))
.length(Double.valueOf(hardwareXmlVO.getLength()))
.thickness(Double.valueOf(hardwareXmlVO.getThickness()))
.brand(hardwareXmlVO.getBrand())
.factory(hardwareXmlVO.getManufacturer())
.spec(hardwareXmlVO.getSpecs())
.unit(hardwareXmlVO.getUnit())
.isComposite(false)
.build());
.subparts(hardwareXmlVO.getSubCodes())
.build();
// 属性相同的配件的集合,可能存在房间 柜体 加工组 不同
Map<String, List<HardwareXmlVO>> hardwareGroupById = hardwareMp.get(key).stream().collect(
@@ -633,6 +665,9 @@ public class XmlTypeRealize {
.build());
});
orderPartsDO.setRemark(getRemark(finalRemarkXmlVOS));
orderPartsDOMap.put(key, orderPartsDO);
if (!finalRemarkXmlVOS.isEmpty()) {
orderPartsRemarks.put(key, OrderPartsRemark.builder()
.partsId(partsId)
@@ -648,19 +683,27 @@ public class XmlTypeRealize {
for (String key : assemblyMp.keySet()) {
Long partsId = (Long) identifierGenerator.nextId(null);
AssemblyXmlVO assemblyXmlVO = assemblyMp.get(key).get(0);
orderPartsDOMap.put(key, OrderPartsDO.builder()
OrderPartsDO orderPartsDO = OrderPartsDO.builder()
.id(partsId)
.organId(organId)
.orderId(orderId)
.goodsId(assemblyXmlVO.getItemCode())
.name(assemblyXmlVO.getName())
.color(assemblyXmlVO.getColor())
.material(assemblyXmlVO.getMaterial())
.category("组件")
.type(assemblyXmlVO.getType())
.width(Double.valueOf(assemblyXmlVO.getWidth()))
.length(Double.valueOf(assemblyXmlVO.getLength()))
.thickness(Double.valueOf(assemblyXmlVO.getHeight()))
.brand(assemblyXmlVO.getBrand())
.factory(assemblyXmlVO.getManufacturer())
.spec(assemblyXmlVO.getSpecs())
.unit(assemblyXmlVO.getUnit())
.isComposite(true)
.build());
.subparts(assemblyXmlVO.getSubCodes())
.build();
// 属性相同的配件的集合,可能存在房间 柜体 加工组 不同
Map<String, List<AssemblyXmlVO>> assemblyGroupById = assemblyMp.get(key).stream().collect(
@@ -702,6 +745,9 @@ public class XmlTypeRealize {
.build());
});
orderPartsDO.setRemark(getRemark(finalRemarkXmlVOS));
orderPartsDOMap.put(key, orderPartsDO);
if (!finalRemarkXmlVOS.isEmpty()) {
orderPartsRemarks.put(key, OrderPartsRemark.builder()
.partsId(partsId)
@@ -863,6 +909,7 @@ public class XmlTypeRealize {
.basePointDetail(new ArrayList<>())
.holeCount(new HashMap<>())
.holeDetail(new ArrayList<>())
.contourCount(new HashMap<>())
.contourDetail(new ArrayList<>())
.sideHoleDetail(new ArrayList<>())
.sideRemark(new HashMap<>())
@@ -873,13 +920,13 @@ public class XmlTypeRealize {
addSealEdge(plateDO, plateDetail, blockXmlVO.getOutlineXmlVO(), partsDO, roomInfos, groupInfos, orderItemMap);
// 偏移量 不含封边
addPointDetail(plateDO, plateDetail, blockXmlVO.getCuttingOutlineXmlVO());
addPointDetail(plateDO, plateDetail, blockXmlVO.getRawOutlineXmlVO());
addPointDetail(plateDO, plateDetail, blockXmlVO.getRawOutlineXmlVO()); // 坯料
// 孔数据
addHole(plateDO, plateDetail, blockXmlVO.getHoleXmlVOS());
// 造型数据 (槽)
addContourDetail(plateDO, plateDetail, blockXmlVO.getGrooveXmlVOS());
// 造型数据 (槽), 加孤岛信息
addContourDetail(plateDO, plateDetail, blockXmlVO.getGrooveXmlVOS(), blockXmlVO.getIsletXmlVOS());
// 造型数据(孤岛)
addIslandDetail(plateDetail, blockXmlVO.getIsletXmlVOS());
// addIslandDetail(plateDetail, blockXmlVO.getIsletXmlVOS());
// 小板关联配件
addParts(plateDetail, blockXmlVO.getCorrelationXmlVOS(),partsDO);
// 小板备注信息
@@ -896,19 +943,19 @@ public class XmlTypeRealize {
private void addIslandDetail(PlateDetail plateDetail, IsletXmlVOS isletXmlVOS) {
if (isletXmlVOS != null && ObjectUtils.allNull(isletXmlVOS)) {
if (isletXmlVOS.getIsletXmlVOList() != null && !isletXmlVOS.getIsletXmlVOList().isEmpty()) {
for (IsletXmlVO isletXmlVO : isletXmlVOS.getIsletXmlVOList()) {
ModelDetail modelDetail = ModelDetail.builder()
.id(Integer.valueOf(isletXmlVO.getId()))
.parentId(Integer.valueOf(isletXmlVO.getParentId()))
.pointList(addPointDetail(isletXmlVO.getPointXmlVOS())).build();
plateDetail.getContourDetail().add(modelDetail);
}
}
}
}
// private void addIslandDetail(PlateDetail plateDetail, IsletXmlVOS isletXmlVOS) {
// if (isletXmlVOS != null && ObjectUtils.allNull(isletXmlVOS)) {
// if (isletXmlVOS.getIsletXmlVOList() != null && !isletXmlVOS.getIsletXmlVOList().isEmpty()) {
// for (IsletXmlVO isletXmlVO : isletXmlVOS.getIsletXmlVOList()) {
// ModelDetail modelDetail = ModelDetail.builder()
// .id(Integer.valueOf(isletXmlVO.getId()))
//// .parentId(Integer.valueOf(isletXmlVO.getSubIDs()))
// .pointList(addPointDetail(isletXmlVO.getPointXmlVOS())).build();
// plateDetail.getContourDetail().add(modelDetail);
// }
// }
// }
// }
// 小板关联配件添加
private void addParts(PlateDetail plateDetail, CorrelationXmlVOS correlationXmlVOS, Map<String, Object> partsDOMap) {
@@ -959,10 +1006,10 @@ public class XmlTypeRealize {
BigDecimal sealUp = BigDecimal.valueOf(0);
BigDecimal sealDown = BigDecimal.valueOf(0);
if (outlineXmlVO != null && outlineXmlVO.getPointXmlVOList() != null && outlineXmlVO.getPointXmlVOList().size() > 0) {
if (outlineXmlVO != null && outlineXmlVO.getPointXmlVOList() != null && !outlineXmlVO.getPointXmlVOList().isEmpty()) {
ExtraVO extraVO = ExtraVO.builder()
.edgeRemarks(new ArrayList<String>())
.rectSealDetail(new ArrayList<RectSealVO>())
.edgeRemarks(new ArrayList<>())
.rectSealDetail(new ArrayList<>())
.build();
int indexId = 0;
for (PointXmlVO pointXmlVO : outlineXmlVO.getPointXmlVOList()) {
@@ -1089,15 +1136,15 @@ public class XmlTypeRealize {
// 坯料
private void addPointDetail(PlateDO plateDO, PlateDetail plateDetail, RawOutlineXmlVO rawOutlineXmlVO) {
if (rawOutlineXmlVO != null) {
if (rawOutlineXmlVO.getReferenceOffsetX() == null) {
rawOutlineXmlVO.setReferenceOffsetX("0");
}
if (rawOutlineXmlVO.getReferenceOffsetY() == null) {
rawOutlineXmlVO.setReferenceOffsetY("0");
}
plateDO.setOffsetX(BigDecimal.valueOf(Double.parseDouble(rawOutlineXmlVO.getReferenceOffsetX()))).
setOffsetY(BigDecimal.valueOf(Double.parseDouble(rawOutlineXmlVO.getReferenceOffsetY())));
plateDetail.setOffsetX(plateDO.getOffsetX()).setOffsetY(plateDO.getOffsetY());
// if (rawOutlineXmlVO.getReferenceOffsetX() == null) {
// rawOutlineXmlVO.setReferenceOffsetX("0");
// }
// if (rawOutlineXmlVO.getReferenceOffsetY() == null) {
// rawOutlineXmlVO.setReferenceOffsetY("0");
// }
// plateDO.setOffsetX(BigDecimal.valueOf(Double.parseDouble(rawOutlineXmlVO.getReferenceOffsetX()))).
// setOffsetY(BigDecimal.valueOf(Double.parseDouble(rawOutlineXmlVO.getReferenceOffsetY())));
// plateDetail.setOffsetX(plateDO.getOffsetX()).setOffsetY(plateDO.getOffsetY());
if (rawOutlineXmlVO.getPointXmlVOList() != null && rawOutlineXmlVO.getPointXmlVOList().size() > 0) {
for (PointXmlVO pointXmlVO : rawOutlineXmlVO.getPointXmlVOList()) {
plateDetail.getBasePointDetail().add(PointDetail.builder()
@@ -1171,7 +1218,7 @@ public class XmlTypeRealize {
DictDataRespDTO faceType = dictDataApi.parseDictData(DictTypeConstants.HOLE_FACE, holeXmlVO.getFace()).getData();
Integer faceTypeValue = faceType != null ? Integer.parseInt(faceType.getValue()) : 2;
Integer direction = Integer.valueOf(dictDataApi.parseDictData(DictTypeConstants.HOLE_DIRECTION, holeXmlVO.getDirection()).getData().getValue());
DictDataRespDTO holeType = holeXmlVO.getType() == null ? null : dictDataApi.parseDictData(DictTypeConstants.HOLE_TYPE, holeXmlVO.getType()).getData();
// DictDataRespDTO holeType = holeXmlVO.getType() == null ? null : dictDataApi.parseDictData(DictTypeConstants.HOLE_TYPE, holeXmlVO.getType()).getData();
Double radius = holeXmlVO.getDiameter() != null ? Double.parseDouble(holeXmlVO.getDiameter()) / 2 : 0;
Double depth = holeXmlVO.getDepth() != null ? Double.parseDouble(holeXmlVO.getDepth()) : 0;
@@ -1179,7 +1226,7 @@ public class XmlTypeRealize {
.holeName(holeXmlVO.getName())
.faceType(faceTypeValue)
.direction(direction)
.holeType(holeType != null ? Integer.valueOf(holeType.getValue()) : null)
.holeTypeStr(holeXmlVO.getType())
.radius(radius)
.depth(depth)
.startX(holeXmlVO.getStartX() != null ? Double.parseDouble(holeXmlVO.getStartX()) : 0)
@@ -1192,7 +1239,7 @@ public class XmlTypeRealize {
}
// 造型
private void addContourDetail(PlateDO plateDO, PlateDetail plateDetail, GrooveXmlVOS grooveXmlVOS) {
private void addContourDetail(PlateDO plateDO, PlateDetail plateDetail, GrooveXmlVOS grooveXmlVOS, IsletXmlVOS isletXmlVOS) {
if (grooveXmlVOS == null || ObjectUtils.allNull(grooveXmlVOS)) {
return;
}
@@ -1203,7 +1250,7 @@ public class XmlTypeRealize {
updatePlateDOFilterTypeIfThroughGroovesExist(plateDO, grooveXmlVOS);
if (grooveXmlVOS.getGrooveXmlVOList() != null && !grooveXmlVOS.getGrooveXmlVOList().isEmpty()) {
addGrooveDetailsToPlateDetail(plateDetail, grooveXmlVOS.getGrooveXmlVOList());
addGrooveDetailsToPlateDetail(plateDetail, grooveXmlVOS.getGrooveXmlVOList(), isletXmlVOS);
}
}
@@ -1226,7 +1273,7 @@ public class XmlTypeRealize {
}
private void updatePlateDetailWithContourCount(PlateDetail plateDetail, Map<String, Integer> contourCount) {
plateDetail.getHoleCount().putAll(contourCount);
plateDetail.getContourCount().putAll(contourCount);
plateDetail.setHas2DModel(contourCount.getOrDefault("count2V", 0) > 0);
plateDetail.setHas3DModel(contourCount.getOrDefault("count3D", 0) > 0);
}
@@ -1242,10 +1289,10 @@ public class XmlTypeRealize {
}
}
private void addGrooveDetailsToPlateDetail(PlateDetail plateDetail, List<GrooveXmlVO> grooveXmlVOList) {
private void addGrooveDetailsToPlateDetail(PlateDetail plateDetail, List<GrooveXmlVO> grooveXmlVOList, IsletXmlVOS isletXmlVOS) {
for (GrooveXmlVO grooveXmlVO : grooveXmlVOList) {
int faceType = parseFaceType(grooveXmlVO.getFace());
ModelDetail modelDetail = createModelDetail(grooveXmlVO, faceType);
// int faceType = parseFaceType(grooveXmlVO.getFace());
ModelDetail modelDetail = createModelDetail(grooveXmlVO, isletXmlVOS);
plateDetail.getContourDetail().add(modelDetail);
}
}
@@ -1255,49 +1302,89 @@ public class XmlTypeRealize {
return faceType == 0 || faceType == 1 ? faceType : 2;
}
private ModelDetail createModelDetail(GrooveXmlVO grooveXmlVO, int faceType) {
private ModelDetail createModelDetail(GrooveXmlVO grooveXmlVO, IsletXmlVOS isletXmlVOS) {
// 槽内孤岛id转换
String[] subIDs = null;
if (grooveXmlVO.getSubIDs() != null) {
subIDs = Arrays.stream(grooveXmlVO.getSubIDs().split(",")).map(String::valueOf).toArray(String[]::new);
}
return ModelDetail.builder()
.id(Integer.valueOf(grooveXmlVO.getId()))
// .parentId(Integer.valueOf(grooveXmlVO.getParentId()))
.subIDs(subIDs)
.type(grooveXmlVO.getType())
.faceType(faceType)
.grooveFace(grooveXmlVO.getFace())
.width(Double.parseDouble(grooveXmlVO.getWidth()))
.length(Double.parseDouble(grooveXmlVO.getLength()))
.depth(Double.parseDouble(grooveXmlVO.getDepth()))
.knifeName(grooveXmlVO.getToolName())
.toolNo(grooveXmlVO.getToolNo())
.knifeRadius(Double.parseDouble(grooveXmlVO.getToolDiameter()) / 2)
.round(Double.parseDouble(grooveXmlVO.getRound()))
.redundance(Double.parseDouble(grooveXmlVO.getRedundance()))
.tangentAngle(Double.parseDouble(grooveXmlVO.getTangentAngle()))
// .originModeling(getOriginModelingData(grooveXmlVO))
.originModeling(getOriginModelingData(grooveXmlVO, subIDs, isletXmlVOS))
.pointList(addPointDetail(grooveXmlVO.getPointXmlVOS()))
.offSetList(addOffSetDetail(grooveXmlVO.getOffsetLineXmlVOS()))
.mode(grooveXmlVO.getMode())
.build();
}
// 造像轮廓数据
private IOriginModelingData getOriginModelingData(GrooveXmlVO grooveXmlVO) {
private IOriginModelingData getOriginModelingData(GrooveXmlVO grooveXmlVO, String[] subIDs, IsletXmlVOS isletXmlVOS) {
// 孤岛信息
List<List<IContourData>> holes = null;
if (subIDs != null && isletXmlVOS != null && isletXmlVOS.getIsletXmlVOList() != null) {
holes = new ArrayList<>();
// 孤岛信息整合
Map<String, IsletXmlVO> isletMap = isletXmlVOS.getIsletXmlVOList().stream().collect(Collectors.toMap(IsletXmlVO::getId, Function.identity()));
// 遍历subIDs
for (String subID : subIDs) {
// 获取孤岛信息
List<IContourData> hole = getHole(subID, isletMap);
holes.add(hole);
}
}
return IOriginModelingData.builder()
.knifeRadius(Double.parseDouble(grooveXmlVO.getToolDiameter()) / 2)
.thickness(Double.valueOf(grooveXmlVO.getDepth()))
.direction(grooveXmlVO.getDirection())
.outline(addOutlineDetail(grooveXmlVO.getOutlineXmlVO()))
.holes(holes)
.addLen(Double.valueOf(grooveXmlVO.getLengthExtend()))
.addDepth(Double.valueOf(grooveXmlVO.getDepthExtend()))
.addWidth(Double.valueOf(grooveXmlVO.getWidthExtend()))
// .pointList(addPointDetail(grooveXmlVO.getPointXmlVOS()))
.build();
}
// 孤岛信息
private List<IContourData> getHole(String subID, Map<String, IsletXmlVO> isletMap) {
return isletMap.get(subID).getPointXmlVOS().getPointXmlVOList().stream().map(pointXmlVO -> IContourData.builder()
.pts(new Point(Double.parseDouble(pointXmlVO.getPointX()), Double.parseDouble(pointXmlVO.getPointY()), Double.parseDouble(pointXmlVO.getPointZ())))
.buls(Double.parseDouble(pointXmlVO.getCurvature())).radius(Double.parseDouble(pointXmlVO.getRadius())).build()).collect(Collectors.toList());
}
// 原始造型(外)轮廓信息
private List<IContourData> addOutlineDetail(OutlineXmlVO outlineXmlVO) {
if (outlineXmlVO == null || outlineXmlVO.getPointXmlVOList() == null) {
return null;
}
return outlineXmlVO.getPointXmlVOList().stream().map(pointXmlVO -> IContourData.builder()
.pts(new Point(Double.parseDouble(pointXmlVO.getPointX()), Double.parseDouble(pointXmlVO.getPointY()), Double.parseDouble(pointXmlVO.getPointZ())))
.buls(Double.parseDouble(pointXmlVO.getCurvature()))
.radius(Double.parseDouble(pointXmlVO.getRadius()))
.build()).collect(Collectors.toList());
}
// 点列表的赋值
private List<PointList> addPointDetail(PointXmlVOS pointXmlVOS) {
List<PointList> pointLists = new ArrayList<>();
if (pointXmlVOS != null && pointXmlVOS.getPointXmlVOList() != null && pointXmlVOS.getPointXmlVOList().size() > 0) {
if (pointXmlVOS != null && pointXmlVOS.getPointXmlVOList() != null && !pointXmlVOS.getPointXmlVOList().isEmpty()) {
for (PointXmlVO pointXmlVO : pointXmlVOS.getPointXmlVOList()) {
pointLists.add(PointList.builder()
// .pointId(Integer.valueOf(pointXmlVO.getId()))
.pointX(Double.parseDouble(pointXmlVO.getPointX())).
pointY(Double.parseDouble(pointXmlVO.getPointY()))
.pointX(Double.parseDouble(pointXmlVO.getPointX()))
.pointY(Double.parseDouble(pointXmlVO.getPointY()))
.pointZ(Double.parseDouble(pointXmlVO.getPointZ()))
.radius(Double.parseDouble(pointXmlVO.getRadius()))
.curve(Double.parseDouble(pointXmlVO.getCurvature()))
// .curve(Double.parseDouble(pointXmlVO.getCurvature()))
.holeRadius(Double.parseDouble(pointXmlVO.getRadius()))
.build());
}
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.cf.imes.module.executor.dal.mysql.order.OrderStatisticsMapper">
<select id="selectOrderSquareProduce" resultType="java.lang.Integer">
<select id="selectOrderSquareProduce" resultType="java.lang.Double">
SELECT SUM(op.area) as area FROM orders o
JOIN order_plate op on op.order_id = o.id
WHERE o.deleted = 0 and o.status = 3;
@@ -15,7 +15,7 @@
,CONCAT(YEAR(o.order_date), '-', MONTH(o.order_date)) as date
</if>
<if test="req.unit != null and req.unit == @com.cf.imes.module.executor.enums.OrderStatisticsUnit@WEEK.getValue()">
,CONCAT(YEAR(o.order_date), '-', MONTH(o.order_date), '-', FLOOR((DayOfMonth(o.order_date)-1)/7)+1) AS date
,CONCAT(YEAR(o.order_date), '-', MONTH(o.order_date), '-', WEEK(o.order_date, 1)) AS date
</if>
<if test="req.unit != null and req.unit == @com.cf.imes.module.executor.enums.OrderStatisticsUnit@DAY.getValue()">
,CONCAT(YEAR(o.order_date), '-', MONTH(o.order_date), '-', DAY(o.order_date)) as date
@@ -28,7 +28,7 @@
count(o.id) as orderCount
<include refid="dateFormat"/>
from orders o
where o.order_date between #{req.createTime[0]} and #{req.createTime[1]}
where o.order_date between #{req.createTime[0]} and DATE_FORMAT(STR_TO_DATE(CONCAT(DATE_FORMAT(#{req.createTime[1]}, '%Y-%m-%d'), ' 23:59:59'), '%Y-%m-%d %H:%i:%s'), '%Y-%m-%d %H:%i:%s')
and o.deleted = 0
group by orderStatus, date;
</select>
@@ -38,7 +38,7 @@
select count(o.id) as orderCount
<include refid="dateFormat"/>
from orders o
where o.order_date between #{req.createTime[0]} and #{req.createTime[1]}
where o.order_date between #{req.createTime[0]} and DATE_FORMAT(STR_TO_DATE(CONCAT(DATE_FORMAT(#{req.createTime[1]}, '%Y-%m-%d'), ' 23:59:59'), '%Y-%m-%d %H:%i:%s'), '%Y-%m-%d %H:%i:%s')
and o.deleted = 0
group by date;
</select>
@@ -49,7 +49,7 @@
<include refid="dateFormat"/>
from orders o
join order_plate op on op.order_id = o.id
where o.order_date between #{req.createTime[0]} and #{req.createTime[1]}
where o.order_date between #{req.createTime[0]} and DATE_FORMAT(STR_TO_DATE(CONCAT(DATE_FORMAT(#{req.createTime[1]}, '%Y-%m-%d'), ' 23:59:59'), '%Y-%m-%d %H:%i:%s'), '%Y-%m-%d %H:%i:%s')
and o.deleted = 0
group by date;
</select>
@@ -17,7 +17,7 @@
</if>
</sql>
<select id="selectOrderSquareProduceToday" resultType="java.lang.Integer">
<select id="selectOrderSquareProduceToday" resultType="java.lang.Double">
SELECT SUM(op.area) as area
FROM orders o
LEFT JOIN order_plate op on op.order_id = o.id
@@ -21,8 +21,8 @@
SELECT b.order_id, b.room_id,b.id AS body_id, g.id as group_id, g.name as group_name, g.group_type_id,g.group_type_name,
g.plate_num AS group_num,b.plate_num AS body_num
FROM `order_body` b
LEFT JOIN `order_group` g ON b.id = g.body_id
WHERE b.order_id = #{orderId} and b.organ_id = #{organId} and b.deleted = #{deleted}
LEFT JOIN `order_group` g ON b.organ_id = g.organ_id AND b.order_id = g.order_id AND b.id = g.body_id
WHERE b.organ_id = #{organId} and b.order_id = #{orderId} and b.deleted = #{deleted}
</select>
<select id="getOrderBodyByOrderId" resultType="com.cf.imes.module.executor.dal.dataobject.orderBody.OrderBodyDO">
@@ -76,7 +76,14 @@
p.type,
p.price,
p.is_composite,
p.create_time
p.create_time,
p.color,
p.category,
p.length,
p.width,
p.thickness,
p.material,
p.goods_id
</select>
<select id="selectPartsByOrderId"
@@ -54,6 +54,9 @@ public class PartsImportExcelVO {
@ExcelProperty("厂家")
private String factor;
@ExcelProperty("价格")// float(8,3)
private String price;
@ExcelProperty("长度")// float(8,3)
private String length;
@@ -54,6 +54,10 @@ public class PartsPageReqVO extends PageParam {
@Size(max = 64, message = "配件规格不能超过64个字符")
private String spec;
@Schema(description = "价格")
@PartsNumberValid(name = "价格")
private Double[] price;
@Schema(description = "宽度")
@PartsNumberValid(name = "宽度")
private Double[] width;
@@ -50,6 +50,10 @@ public class PartsRespVO {
@ExcelProperty("型号")
private String model;
@Schema(description = "价格", requiredMode = Schema.RequiredMode.REQUIRED)
@NumberValid(name = "价格")
private Double price;
@Schema(description = "宽度", requiredMode = Schema.RequiredMode.REQUIRED)
@NumberValid(name = "宽度")
private Double width;
@@ -49,6 +49,10 @@ public class PartsSaveReqVO {
@Size(max = 64, message = "型号长度不能超过64个字符")
private String model;
@Schema(description = "价格", requiredMode = Schema.RequiredMode.REQUIRED)
@NumberValid(name = "价格")
private Double price;
@Schema(description = "宽度", requiredMode = Schema.RequiredMode.REQUIRED)
@NumberValid(name = "宽度")
private Double width;
@@ -120,9 +120,9 @@ public class PlateController {
// 手动创建导出 demo
List<PlateImportExcelVO> list = Arrays.asList(
PlateImportExcelVO.builder().goodsId("SP1123456").goodsName("5mm-多层板-高级灰").material("多层板").width(String.valueOf(1220)).height(String.valueOf(2440))
.thickness(String.valueOf(5)).brand("AAA").spec("2440*1220*5").remark("板材样本").color("高级灰").texture("").build(),
.thickness(String.valueOf(5)).brand("AAA").spec("2440*1220*5").remark("板材样本").color("高级灰").price("120").texture("").build(),
PlateImportExcelVO.builder().goodsId("SP1123457").goodsName("白玉木兰-欧松板").material("欧松板").width(String.valueOf(1220)).height(String.valueOf(2750))
.thickness(String.valueOf(18)).brand("鸿达树").spec("2750*1220*18").remark("测试").color("白玉木兰").texture("").build()
.thickness(String.valueOf(18)).brand("鸿达树").spec("2750*1220*18").remark("测试").color("白玉木兰").price("120").texture("").build()
);
// 输出
ExcelUtils.write(response, IMPORT_TEMPLATE, "板材列表", PlateImportExcelVO.class, list);
@@ -51,9 +51,9 @@ public class PlateImportExcelVO {
@NotEmpty(message = "厚度不能为空")
private String thickness;
// @ExcelProperty("价格")
// @NotEmpty(message = "价格不能为空")
// private String price;
@ExcelProperty("价格")
@NotEmpty(message = "价格不能为空")
private String price;
@ExcelProperty("品牌")
@NotEmpty(message = "品牌不能为空")
@@ -45,8 +45,8 @@ public class PlatePageReqVO extends PageParam {
@Schema(description = "厚度")
private Double thickness;
// @Schema(description = "价格", example = "3380")
// private Double price;
@Schema(description = "价格", example = "3380")
private Double price;
@Schema(description = "品牌")
@Size(max = 64, message = "品牌长度不能超过64个字符")
@@ -51,9 +51,9 @@ public class PlateRespVO {
@ExcelProperty("厚度")
private Double thickness;
// @Schema(description = "价格", requiredMode = Schema.RequiredMode.REQUIRED, example = "3380")
// @ExcelProperty("价格")
// private Double price;
@Schema(description = "价格", requiredMode = Schema.RequiredMode.REQUIRED, example = "3380")
@ExcelProperty("价格")
private Double price;
@Schema(description = "品牌", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("品牌")
@@ -53,8 +53,8 @@ public class PlateSaveReqVO {
@NumberValid(name = "厚度")
private Double thickness;
// @Schema(description = "价格", example = "3380")
// private Double price;
@Schema(description = "价格", example = "3380")
private Double price;
@Schema(description = "品牌")
@Size(max = 64, message = "品牌长度不能超过64个字符")
@@ -0,0 +1,58 @@
package com.cf.imes.module.manage.controller.admin.plate.vo.remain;
import com.cf.imes.framework.common.validation.NumberValid;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
/**
* 余料修改字段
*/
@Schema(description = "管理后台 - 余料修改字段 VO")
@Data
public class RemainPlateUpSaveVO {
@Schema(description = "宽度", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "宽度不能为空")
@NumberValid(name = "宽度")
private BigDecimal width;
@Schema(description = "长度", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "长度不能为空")
@NumberValid(name = "长度")
private BigDecimal length;
@Schema(description = "厚度", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "厚度不能为空")
@NumberValid(name = "厚度")
private BigDecimal thickness;
@Schema(description = "纹理 有 无", requiredMode = Schema.RequiredMode.REQUIRED)
private Boolean texture;
@Schema(description = "材料", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "材料不能为空")
@Size(max = 50, message = "材料长度不能超过50个字符")
private String material;
@Schema(description = "颜色", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "颜色不能为空")
@Size(max = 50, message = "颜色长度不能超过50个字符")
private String color;
@Schema(description = "品牌")
@Size(max = 50, message = "品牌长度不能超过50个字符")
private String brand;
@Schema(description = "仓库名")
@Size(max = 64, message = "品牌长度不能超过64个字符")
private String store;
@Schema(description = "备注", example = "随便")
@Size(max = 255, message = "品牌长度不能超过255个字符")
private String remark;
}
@@ -45,6 +45,10 @@ public class PartsDO extends BaseDO {
* 颜色
*/
private String color;
/**
* 价格
*/
private Double price;
/**
* 配件类型
*/
@@ -64,7 +64,7 @@ public class PlateDO extends BaseDO {
/**
* 价格
*/
// private Double price;
private Double price;
/**
* 品牌
*/
@@ -34,7 +34,7 @@ public interface PlateMapper extends BaseMapperX<PlateDO> {
.likeIfPresent(PlateDO::getBrand, reqVO.getBrand())
.likeIfPresent(PlateDO::getSpec, reqVO.getSpec())
.likeIfPresent(PlateDO::getRemark, reqVO.getRemark())
// .eqIfPresent(PlateDO::getPrice, reqVO.getPrice())
.eqIfPresent(PlateDO::getPrice, reqVO.getPrice())
.eqIfPresent(PlateDO::getTexture, reqVO.getTexture())
.betweenIfPresent(PlateDO::getCreateTime, reqVO.getCreateTime());
@@ -52,6 +52,7 @@ public interface PlateMapper extends BaseMapperX<PlateDO> {
case "height" -> queryWrapper.orderByAsc(PlateDO::getHeight);
case "thickness" -> queryWrapper.orderByAsc(PlateDO::getThickness);
case "brand" -> queryWrapper.orderByAsc(PlateDO::getBrand);
case "price" -> queryWrapper.orderByAsc(PlateDO::getPrice);
default -> {
// default不排序
}
@@ -67,6 +68,7 @@ public interface PlateMapper extends BaseMapperX<PlateDO> {
case "height" -> queryWrapper.orderByDesc(PlateDO::getHeight);
case "thickness" -> queryWrapper.orderByDesc(PlateDO::getThickness);
case "brand" -> queryWrapper.orderByDesc(PlateDO::getBrand);
case "price" -> queryWrapper.orderByDesc(PlateDO::getPrice);
default -> {
// default不排序
}
@@ -35,7 +35,10 @@ public final class PlateExcelListener<T> extends AnalysisEventListener<PlateImpo
checkData(data.getHeight(),"高度",data);
checkData(data.getWidth(),"宽度",data);
checkData(data.getThickness(),"厚度",data);
// checkData(data.getPrice(),"价格",data);
if (data.getPrice() == null || data.getPrice().equals("")) {
data.setPrice("0");
}
checkData(data.getPrice(),"价格",data);
checkTexture(data.getTexture(),"纹理",data);
if (data.getResult() != null)
data.setResult(data.getResult().replace("null,", ""));
@@ -3,6 +3,7 @@ package com.cf.imes.module.manage.service.remainplaten;
import com.cf.imes.framework.organ.core.context.OrganContextHolder;
import com.cf.imes.module.manage.controller.admin.plate.vo.remain.RemainPlatePageReqVO;
import com.cf.imes.module.manage.controller.admin.plate.vo.remain.RemainPlateSaveReqVO;
import com.cf.imes.module.manage.controller.admin.plate.vo.remain.RemainPlateUpSaveVO;
import com.cf.imes.module.manage.dal.dataobject.remainplaten.RemainPlateDO;
import com.cf.imes.module.manage.dal.mysql.remainplaten.RemainPlateMapper;
import com.cf.imes.framework.common.enums.DeletedCodeEnum;
@@ -118,7 +119,10 @@ public class RemainPlateServiceImpl implements RemainPlateService {
updateObj.setRemark(updateReqVO.getRemark());
updateObj.setStore(updateReqVO.getStore());
} else {
updateObj = BeanUtils.toBean(updateReqVO, RemainPlateDO.class);
RemainPlateUpSaveVO updateUpSaveVO = BeanUtils.toBean(updateReqVO, RemainPlateUpSaveVO.class);
updateObj.setWidth(updateUpSaveVO.getWidth()).setLength(updateUpSaveVO.getLength()).setThickness(updateUpSaveVO.getThickness())
.setMaterial(updateUpSaveVO.getMaterial()).setColor(updateUpSaveVO.getColor()).setBrand(updateUpSaveVO.getBrand())
.setRemark(updateUpSaveVO.getRemark()).setStore(updateUpSaveVO.getStore()).setTexture(updateUpSaveVO.getTexture());
}
remainPlateMapper.updateById(updateObj);
}
@@ -10,6 +10,7 @@
goods_name,
material,
color,
price,
width,
height,
texture,