mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-13 21:32:07 +08:00
Merge remote-tracking branch 'origin/main'
This commit is contained in:
+5
@@ -241,6 +241,7 @@ public class OrderController {
|
|||||||
public void exportTest(@RequestPart("file") MultipartFile file,
|
public void exportTest(@RequestPart("file") MultipartFile file,
|
||||||
@RequestParam(value = "type", required = false, defaultValue = "true") Integer type,
|
@RequestParam(value = "type", required = false, defaultValue = "true") Integer type,
|
||||||
HttpServletResponse response) throws IOException {
|
HttpServletResponse response) throws IOException {
|
||||||
|
System.out.println("kkkkkkkk");
|
||||||
|
|
||||||
List<?> list = null;
|
List<?> list = null;
|
||||||
OrderDO orderDO = new OrderDO();
|
OrderDO orderDO = new OrderDO();
|
||||||
@@ -263,6 +264,10 @@ public class OrderController {
|
|||||||
// 获取数据
|
// 获取数据
|
||||||
list = (List<?>) map.get("plate");
|
list = (List<?>) map.get("plate");
|
||||||
orderDO = excelReadUtil.changeOrderDO((Map<Object, Object>) map.get("order")).setOrderType(0).setStatus(1);
|
orderDO = excelReadUtil.changeOrderDO((Map<Object, Object>) map.get("order")).setOrderType(0).setStatus(1);
|
||||||
|
if (!orderService.customOrderNoIsExists(orderDO.getCustomOrderNo())){
|
||||||
|
ExcelWriterUtil.writeErr(response, "自定义生产单号存在", orderService.getSavePath() + File.separator + "错误文件.xlsx");
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (type == 1) { // json
|
} else if (type == 1) { // json
|
||||||
|
|
||||||
|
|||||||
+1
-5
@@ -7,11 +7,7 @@ import lombok.Data;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
|
||||||
* @projectName: cf_imes_server
|
|
||||||
* @author: 晨丰科技
|
|
||||||
* @date: 2024/3/6 10:03
|
|
||||||
*/
|
|
||||||
@Schema(description = "管理后台 - 生产单导入 Response VO")
|
@Schema(description = "管理后台 - 生产单导入 Response VO")
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
|
|||||||
+1
-1
@@ -56,7 +56,7 @@ public class GoodsDO extends BaseDO {
|
|||||||
/**
|
/**
|
||||||
* 纹路 0 正纹 1 可翻转 2 反纹
|
* 纹路 0 正纹 1 可翻转 2 反纹
|
||||||
*/
|
*/
|
||||||
private Integer texture;
|
private Boolean texture;
|
||||||
/**
|
/**
|
||||||
* 颜色
|
* 颜色
|
||||||
*/
|
*/
|
||||||
|
|||||||
+1
-1
@@ -43,7 +43,7 @@ public class PlateGoodDO extends BaseDO {
|
|||||||
/**
|
/**
|
||||||
* 纹路
|
* 纹路
|
||||||
*/
|
*/
|
||||||
private String texture;
|
private Boolean texture;
|
||||||
/**
|
/**
|
||||||
* 宽度
|
* 宽度
|
||||||
*/
|
*/
|
||||||
|
|||||||
+1
-1
@@ -54,7 +54,7 @@ public class RawGoodsDO extends BaseDO {
|
|||||||
/**
|
/**
|
||||||
* 纹路 0 正纹 1 可翻转 2 反纹
|
* 纹路 0 正纹 1 可翻转 2 反纹
|
||||||
*/
|
*/
|
||||||
private Integer texture;
|
private Boolean texture;
|
||||||
/**
|
/**
|
||||||
* 厚度
|
* 厚度
|
||||||
*/
|
*/
|
||||||
|
|||||||
+1
-1
@@ -25,7 +25,7 @@ public interface PlateGoodMapper extends BaseMapperX<PlateGoodDO> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 其他信息匹配
|
// 其他信息匹配
|
||||||
default PlateGoodDO selectGood(String goodsName, String material, String color, Integer texture, BigDecimal width,
|
default PlateGoodDO selectGood(String goodsName, String material, String color, Boolean texture, BigDecimal width,
|
||||||
BigDecimal thickness, BigDecimal height, String brand, String spec, Long organId) {
|
BigDecimal thickness, BigDecimal height, String brand, String spec, Long organId) {
|
||||||
return selectOne(new LambdaQueryWrapper<PlateGoodDO>()
|
return selectOne(new LambdaQueryWrapper<PlateGoodDO>()
|
||||||
.eq(PlateGoodDO::getGoodsName, goodsName)
|
.eq(PlateGoodDO::getGoodsName, goodsName)
|
||||||
|
|||||||
+4
@@ -157,4 +157,8 @@ public interface OrderService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自定义单号是否存在
|
||||||
|
*/
|
||||||
|
Boolean customOrderNoIsExists(String customOrderNo);
|
||||||
}
|
}
|
||||||
+14
-3
@@ -3,7 +3,6 @@ package com.cf.imes.module.executor.service.order;
|
|||||||
import cn.smallbun.screw.core.util.CollectionUtils;
|
import cn.smallbun.screw.core.util.CollectionUtils;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
|
import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
|
||||||
import com.cf.imes.framework.common.pojo.PageParam;
|
|
||||||
import com.cf.imes.framework.mybatis.core.generator.SnowFlakeGenerator;
|
import com.cf.imes.framework.mybatis.core.generator.SnowFlakeGenerator;
|
||||||
import com.cf.imes.framework.organ.core.context.OrganContextHolder;
|
import com.cf.imes.framework.organ.core.context.OrganContextHolder;
|
||||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.*;
|
import com.cf.imes.module.executor.controller.admin.order.vo.order.*;
|
||||||
@@ -34,10 +33,8 @@ import com.cf.imes.module.executor.dal.mysql.processStep.ProcessStepMapper;
|
|||||||
import com.cf.imes.module.executor.dal.mysql.rawgoods.RawGoodsMapper;
|
import com.cf.imes.module.executor.dal.mysql.rawgoods.RawGoodsMapper;
|
||||||
import com.cf.imes.module.executor.enums.OrderDeletedEnum;
|
import com.cf.imes.module.executor.enums.OrderDeletedEnum;
|
||||||
import com.cf.imes.module.executor.enums.OrderStatusEnum;
|
import com.cf.imes.module.executor.enums.OrderStatusEnum;
|
||||||
import com.cf.imes.module.executor.util.ExcelWriterUtil;
|
|
||||||
import com.cf.imes.module.executor.util.deviseData.dataTwo.PlateDetail;
|
import com.cf.imes.module.executor.util.deviseData.dataTwo.PlateDetail;
|
||||||
import com.cf.imes.module.executor.util.fileConversion.admin.files.excel.ExcelTypeRealize;
|
import com.cf.imes.module.executor.util.fileConversion.admin.files.excel.ExcelTypeRealize;
|
||||||
import com.cf.imes.module.executor.util.fileConversion.admin.files.excel.OrderPlateImportExcelVO;
|
|
||||||
import com.cf.imes.module.system.api.dict.DictDataApi;
|
import com.cf.imes.module.system.api.dict.DictDataApi;
|
||||||
import com.cf.imes.module.system.api.user.AdminUserApi;
|
import com.cf.imes.module.system.api.user.AdminUserApi;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -486,6 +483,20 @@ public class OrderServiceImpl implements OrderService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean customOrderNoIsExists(String customOrderNo) {
|
||||||
|
if (customOrderNo != null) {
|
||||||
|
if (!customOrderNo.isEmpty()) {
|
||||||
|
if (orderMapper.selectCount(new LambdaQueryWrapper<OrderDO>()
|
||||||
|
.eq(OrderDO::getCustomOrderNo, customOrderNo)
|
||||||
|
.eq(OrderDO::getDeleted, false)
|
||||||
|
.eq(OrderDO::getOrganId, OrganContextHolder.getOrganId())) > 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
// 业务员是否存在
|
// 业务员是否存在
|
||||||
private void validateSalesmanOrderNoExists(String salesman, Long organId) {
|
private void validateSalesmanOrderNoExists(String salesman, Long organId) {
|
||||||
if (adminUserApi.validateUser(salesman, organId).getData() == null) {
|
if (adminUserApi.validateUser(salesman, organId).getData() == null) {
|
||||||
|
|||||||
+2
-2
@@ -341,7 +341,7 @@ public class ApiTypeRealize {
|
|||||||
.goodsName(goods.getString("GoodsName"))
|
.goodsName(goods.getString("GoodsName"))
|
||||||
.material(goods.getString("Material"))
|
.material(goods.getString("Material"))
|
||||||
.color(goods.getString("Color"))
|
.color(goods.getString("Color"))
|
||||||
.texture(goods.getInteger("Wave"))
|
.texture(false)
|
||||||
.thickness(goods.getDouble("Thickness"))
|
.thickness(goods.getDouble("Thickness"))
|
||||||
.price(goods.getDouble("Price"))
|
.price(goods.getDouble("Price"))
|
||||||
.brand(goods.getString("Brand"))
|
.brand(goods.getString("Brand"))
|
||||||
@@ -357,7 +357,7 @@ public class ApiTypeRealize {
|
|||||||
.goodsName(goods.getString("GoodsName"))
|
.goodsName(goods.getString("GoodsName"))
|
||||||
.material(goods.getString("Material"))
|
.material(goods.getString("Material"))
|
||||||
.color(goods.getString("Color"))
|
.color(goods.getString("Color"))
|
||||||
.texture(goods.getInteger("Wave"))
|
.texture(false)
|
||||||
.width(BigDecimal.valueOf(goods.getDouble("Width")))
|
.width(BigDecimal.valueOf(goods.getDouble("Width")))
|
||||||
.height(BigDecimal.valueOf(goods.getDouble("Height")))
|
.height(BigDecimal.valueOf(goods.getDouble("Height")))
|
||||||
.thickness(BigDecimal.valueOf(goods.getDouble("Thickness")))
|
.thickness(BigDecimal.valueOf(goods.getDouble("Thickness")))
|
||||||
|
|||||||
+49
-43
@@ -53,7 +53,7 @@ public class ExcelReadUtil { // 文件读取
|
|||||||
}
|
}
|
||||||
if (index.get()) {
|
if (index.get()) {
|
||||||
orderMap.put(item.get(0), item.get(1));
|
orderMap.put(item.get(0), item.get(1));
|
||||||
orderMap.put(item.get(12), item.get(13));
|
orderMap.put(item.get(13), item.get(14));
|
||||||
} else {
|
} else {
|
||||||
if (!(item.get(0).equals("序号") || item.get(0).equals("###"))) {
|
if (!(item.get(0).equals("序号") || item.get(0).equals("###"))) {
|
||||||
list.add(changeValue(item));
|
list.add(changeValue(item));
|
||||||
@@ -130,110 +130,112 @@ public class ExcelReadUtil { // 文件读取
|
|||||||
case 4:// 材质
|
case 4:// 材质
|
||||||
vo.setMaterial(value);
|
vo.setMaterial(value);
|
||||||
break;
|
break;
|
||||||
case 5:// 颜色
|
case 5:// 纹理
|
||||||
|
vo.setWave(value);
|
||||||
|
break;
|
||||||
|
case 6:// 颜色
|
||||||
vo.setColor(value);
|
vo.setColor(value);
|
||||||
break;
|
break;
|
||||||
case 6:// 厂家
|
case 7:// 厂家
|
||||||
vo.setFactory(value);
|
vo.setFactory(value);
|
||||||
break;
|
break;
|
||||||
case 7:// 品牌
|
case 8:// 品牌
|
||||||
vo.setBrand(value);
|
vo.setBrand(value);
|
||||||
break;
|
break;
|
||||||
case 8:// 型号
|
case 9:// 型号
|
||||||
vo.setModel(value);
|
vo.setModel(value);
|
||||||
break;
|
break;
|
||||||
case 9:// 规格
|
case 10:// 规格
|
||||||
vo.setSpec(value);
|
vo.setSpec(value);
|
||||||
break;
|
break;
|
||||||
case 10:// 单位
|
case 11:// 单位
|
||||||
vo.setUnit(value);
|
vo.setUnit(value);
|
||||||
break;
|
break;
|
||||||
case 11:// 数量
|
case 12:// 数量
|
||||||
vo.setGoodsNumber(value);
|
vo.setGoodsNumber(value);
|
||||||
break;
|
break;
|
||||||
case 12:// 房间
|
case 13:// 房间
|
||||||
vo.setRoomsName(value);
|
vo.setRoomsName(value);
|
||||||
break;
|
break;
|
||||||
case 13:// 柜体
|
case 14:// 柜体
|
||||||
vo.setCabinetsName(value);
|
vo.setCabinetsName(value);
|
||||||
break;
|
break;
|
||||||
case 14:// 加工组类型
|
case 15:// 加工组类型
|
||||||
|
|
||||||
vo.setSynthesisTypeName(value);
|
vo.setSynthesisTypeName(value);
|
||||||
break;
|
break;
|
||||||
case 15:// 加工组名称
|
case 16:// 加工组名称
|
||||||
vo.setCombinationName(value);
|
vo.setCombinationName(value);
|
||||||
break;
|
break;
|
||||||
case 16://板名称
|
case 17://板名称
|
||||||
vo.setName(value);
|
vo.setName(value);
|
||||||
break;
|
break;
|
||||||
case 17:// 自定义板编号
|
case 18:// 自定义板编号
|
||||||
vo.setPlateNo(value);
|
vo.setPlateNo(value);
|
||||||
break;
|
break;
|
||||||
case 18:// 成品长
|
case 19:// 成品长
|
||||||
vo.setHeight(value);
|
vo.setHeight(value);
|
||||||
break;
|
break;
|
||||||
case 19:// 成品宽
|
case 20:// 成品宽
|
||||||
vo.setWidth(value);
|
vo.setWidth(value);
|
||||||
break;
|
break;
|
||||||
case 20:// 拆单长
|
case 21:// 拆单长
|
||||||
vo.setSplitHeight(value);
|
vo.setSplitHeight(value);
|
||||||
break;
|
break;
|
||||||
case 21:// 拆单宽
|
case 22:// 拆单宽
|
||||||
vo.setSplitWidth(value);
|
vo.setSplitWidth(value);
|
||||||
break;
|
break;
|
||||||
case 22:// 厚
|
case 23:// 厚
|
||||||
vo.setThickness(value);
|
vo.setThickness(value);
|
||||||
break;
|
break;
|
||||||
case 23:// 左封边
|
case 24:// 左封边
|
||||||
vo.setSealLeft(value);
|
vo.setSealLeft(value);
|
||||||
break;
|
break;
|
||||||
case 24:// 右封边
|
case 25:// 右封边
|
||||||
vo.setSealRight(value);
|
vo.setSealRight(value);
|
||||||
break;
|
break;
|
||||||
case 25:// 上封边
|
case 26:// 上封边
|
||||||
vo.setSealUp(value);
|
vo.setSealUp(value);
|
||||||
break;
|
break;
|
||||||
case 26:// 下封边
|
case 27:// 下封边
|
||||||
vo.setSealDown(value);
|
vo.setSealDown(value);
|
||||||
break;
|
break;
|
||||||
case 27:// 排版面
|
case 28:// 排版面
|
||||||
vo.setTypographicFace(value);
|
vo.setTypographicFace(value);
|
||||||
break;
|
break;
|
||||||
case 28:// 纹路
|
case 29:// 纹路
|
||||||
vo.setTexture(value);
|
vo.setTexture(value);
|
||||||
break;
|
break;
|
||||||
case 29:// 开门方向
|
case 30:// 开门方向
|
||||||
vo.setOpenDoorType(value);
|
vo.setOpenDoorType(value);
|
||||||
break;
|
break;
|
||||||
case 30://备注1
|
case 31://备注1
|
||||||
vo.setRemark1(value);
|
vo.setRemark1(value);
|
||||||
break;
|
break;
|
||||||
case 31://备注2
|
case 32://备注2
|
||||||
vo.setRemark2(value);
|
vo.setRemark2(value);
|
||||||
break;
|
break;
|
||||||
case 32://备注3
|
case 33://备注3
|
||||||
vo.setRemark3(value);
|
vo.setRemark3(value);
|
||||||
break;
|
break;
|
||||||
case 33://备注4
|
case 34://备注4
|
||||||
vo.setRemark4(value);
|
vo.setRemark4(value);
|
||||||
break;
|
break;
|
||||||
case 34://备注5
|
case 35://备注5
|
||||||
vo.setRemark5(value);
|
vo.setRemark5(value);
|
||||||
break;
|
break;
|
||||||
case 35://备注6
|
case 36://备注6
|
||||||
vo.setRemark6(value);
|
vo.setRemark6(value);
|
||||||
break;
|
break;
|
||||||
case 36://备注7
|
case 37://备注7
|
||||||
vo.setRemark7(value);
|
vo.setRemark7(value);
|
||||||
break;
|
break;
|
||||||
case 37://备注8
|
case 38://备注8
|
||||||
vo.setRemark8(value);
|
vo.setRemark8(value);
|
||||||
break;
|
break;
|
||||||
case 38://备注9
|
case 39://备注9
|
||||||
vo.setRemark9(value);
|
vo.setRemark9(value);
|
||||||
break;
|
break;
|
||||||
case 39://备注10
|
case 40://备注10
|
||||||
vo.setRemark10(value);
|
vo.setRemark10(value);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -262,6 +264,16 @@ public class ExcelReadUtil { // 文件读取
|
|||||||
}
|
}
|
||||||
// 若商品类型为板材,需检查房间、柜体、板名称、成品长、成品宽、拆单长、拆单宽、厚、左封边、右封边、上封边、下封边、排版面、纹路、开门方向不能为空
|
// 若商品类型为板材,需检查房间、柜体、板名称、成品长、成品宽、拆单长、拆单宽、厚、左封边、右封边、上封边、下封边、排版面、纹路、开门方向不能为空
|
||||||
if (StringUtils.equals(vo.getGoodType(), "板材")) {
|
if (StringUtils.equals(vo.getGoodType(), "板材")) {
|
||||||
|
// 纹理有效性判断
|
||||||
|
if (StringUtils.isEmpty(vo.getWave())) {
|
||||||
|
errList.add("板材纹理不可为空");
|
||||||
|
flag = false;
|
||||||
|
}else {
|
||||||
|
if (!StringUtils.equals(vo.getWave().trim(), "无") && !StringUtils.equals(vo.getWave().trim(), "有")) {
|
||||||
|
flag = false;
|
||||||
|
errList.add("纹理无效");
|
||||||
|
}
|
||||||
|
}
|
||||||
if (StringUtils.isEmpty(vo.getRoomsName()) && StringUtils.isEmpty(vo.getCabinetsName()) && StringUtils.isEmpty(vo.getName())) {
|
if (StringUtils.isEmpty(vo.getRoomsName()) && StringUtils.isEmpty(vo.getCabinetsName()) && StringUtils.isEmpty(vo.getName())) {
|
||||||
flag = false;
|
flag = false;
|
||||||
errList.add("房间、柜体、板名称不能为空");
|
errList.add("房间、柜体、板名称不能为空");
|
||||||
@@ -365,22 +377,16 @@ public class ExcelReadUtil { // 文件读取
|
|||||||
if (typographyDTO == null) {
|
if (typographyDTO == null) {
|
||||||
flag = false;
|
flag = false;
|
||||||
errList.add("排版面数据不存在");
|
errList.add("排版面数据不存在");
|
||||||
} else {
|
|
||||||
vo.setTypographicFace(typographyDTO.getValue());
|
|
||||||
}
|
}
|
||||||
DictDataRespDTO grainDTO = dictDataApi.parseDictData(DictTypeConstants.GRAIN_TYPE, vo.getTexture()).getData();// 纹路
|
DictDataRespDTO grainDTO = dictDataApi.parseDictData(DictTypeConstants.GRAIN_TYPE, vo.getTexture()).getData();// 纹路
|
||||||
if (grainDTO == null) {
|
if (grainDTO == null) {
|
||||||
flag = false;
|
flag = false;
|
||||||
errList.add("纹路数据不存在");
|
errList.add("纹路数据不存在");
|
||||||
} else {
|
|
||||||
vo.setTexture(grainDTO.getValue());
|
|
||||||
}
|
}
|
||||||
DictDataRespDTO doorDTO = dictDataApi.parseDictData(DictTypeConstants.DOOR_OPENING_DIRECTIONS, vo.getOpenDoorType()).getData();
|
DictDataRespDTO doorDTO = dictDataApi.parseDictData(DictTypeConstants.DOOR_OPENING_DIRECTIONS, vo.getOpenDoorType()).getData();
|
||||||
if (doorDTO == null) {
|
if (doorDTO == null) {
|
||||||
flag = false;
|
flag = false;
|
||||||
errList.add("开门方向数据不存在");
|
errList.add("开门方向数据不存在");
|
||||||
} else {
|
|
||||||
vo.setOpenDoorType(doorDTO.getValue());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+31
-28
@@ -1,6 +1,7 @@
|
|||||||
package com.cf.imes.module.executor.util.fileConversion.admin.files.excel;
|
package com.cf.imes.module.executor.util.fileConversion.admin.files.excel;
|
||||||
|
|
||||||
import cn.hutool.json.JSONObject;
|
import cn.hutool.json.JSONObject;
|
||||||
|
import com.alibaba.nacos.common.utils.StringUtils;
|
||||||
import com.cf.imes.framework.mybatis.core.generator.SnowFlakeGenerator;
|
import com.cf.imes.framework.mybatis.core.generator.SnowFlakeGenerator;
|
||||||
import com.cf.imes.framework.organ.core.context.OrganContextHolder;
|
import com.cf.imes.framework.organ.core.context.OrganContextHolder;
|
||||||
import com.cf.imes.module.executor.controller.admin.orderParts.vo.OrderPartsRemark;
|
import com.cf.imes.module.executor.controller.admin.orderParts.vo.OrderPartsRemark;
|
||||||
@@ -16,6 +17,9 @@ 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.dal.dataobject.rawgoods.RawGoodsDO;
|
||||||
import com.cf.imes.module.executor.enums.OrderItemTypeEnum;
|
import com.cf.imes.module.executor.enums.OrderItemTypeEnum;
|
||||||
import com.cf.imes.module.executor.util.fileConversion.admin.SnowflakeIdWorker3rd;
|
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;
|
||||||
|
import com.cf.imes.module.system.enums.DictTypeConstants;
|
||||||
import io.swagger.v3.oas.models.security.SecurityScheme;
|
import io.swagger.v3.oas.models.security.SecurityScheme;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@@ -41,6 +45,9 @@ public class ExcelTypeRealize {
|
|||||||
@Resource
|
@Resource
|
||||||
SnowflakeIdWorker3rd idWorker;
|
SnowflakeIdWorker3rd idWorker;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private DictDataApi dictDataApi;
|
||||||
|
|
||||||
// 数据转换 + 错误验证
|
// 数据转换 + 错误验证
|
||||||
public Map<String, List<?>> changeDate(List<?> list, Long orderId) {
|
public Map<String, List<?>> changeDate(List<?> list, Long orderId) {
|
||||||
if (list.isEmpty()){
|
if (list.isEmpty()){
|
||||||
@@ -82,7 +89,7 @@ public class ExcelTypeRealize {
|
|||||||
p.getMaterial(),
|
p.getMaterial(),
|
||||||
p.getColor(),
|
p.getColor(),
|
||||||
p.getSpec(),
|
p.getSpec(),
|
||||||
p.getTexture(),
|
p.getWave(), // 纹理
|
||||||
// p.getModel(),
|
// p.getModel(),
|
||||||
p.getBrand()),
|
p.getBrand()),
|
||||||
Collectors.toList()
|
Collectors.toList()
|
||||||
@@ -114,7 +121,6 @@ public class ExcelTypeRealize {
|
|||||||
.setRawGoodsId(String.valueOf(rawGoodsDO.getId())).setGoodsId(String.valueOf(rawGoodsDO.getRawGoodsId()))
|
.setRawGoodsId(String.valueOf(rawGoodsDO.getId())).setGoodsId(String.valueOf(rawGoodsDO.getRawGoodsId()))
|
||||||
.setHeight(BigDecimal.valueOf(specList.get(0))).setWidth(BigDecimal.valueOf(specList.get(1)));
|
.setHeight(BigDecimal.valueOf(specList.get(0))).setWidth(BigDecimal.valueOf(specList.get(1)));
|
||||||
goodsDOS.add(plateDO);
|
goodsDOS.add(plateDO);
|
||||||
|
|
||||||
// 赋值给板件未对应前order_raw_goods的id
|
// 赋值给板件未对应前order_raw_goods的id
|
||||||
for (OrderPlateImportExcelVO reqVO : value) {
|
for (OrderPlateImportExcelVO reqVO : value) {
|
||||||
reqVO.setGoodId(goodId);
|
reqVO.setGoodId(goodId);
|
||||||
@@ -186,6 +192,11 @@ public class ExcelTypeRealize {
|
|||||||
.movePointLeft(6)
|
.movePointLeft(6)
|
||||||
.setScale(2, RoundingMode.HALF_UP);
|
.setScale(2, RoundingMode.HALF_UP);
|
||||||
Long plateId = (Long) snowFlakeGenerator.nextId(null);
|
Long plateId = (Long) snowFlakeGenerator.nextId(null);
|
||||||
|
// 排版面 纹路 开门方向转换
|
||||||
|
DictDataRespDTO typographyDTO = dictDataApi.parseDictData(DictTypeConstants.TYPOGRAPHY_TYPE, combination.getTypographicFace()).getData();// 排版面
|
||||||
|
DictDataRespDTO grainDTO = dictDataApi.parseDictData(DictTypeConstants.GRAIN_TYPE, combination.getTexture()).getData();// 纹路
|
||||||
|
DictDataRespDTO doorDTO = dictDataApi.parseDictData(DictTypeConstants.DOOR_OPENING_DIRECTIONS, combination.getOpenDoorType()).getData();
|
||||||
|
|
||||||
PlateDO plateDO = PlateDO.builder()
|
PlateDO plateDO = PlateDO.builder()
|
||||||
.id(plateId).orderId(orderId)
|
.id(plateId).orderId(orderId)
|
||||||
.name(combination.getName())
|
.name(combination.getName())
|
||||||
@@ -202,10 +213,10 @@ public class ExcelTypeRealize {
|
|||||||
.sealRight(BigDecimal.valueOf(Double.parseDouble(combination.getSealRight())))
|
.sealRight(BigDecimal.valueOf(Double.parseDouble(combination.getSealRight())))
|
||||||
.sealUp(BigDecimal.valueOf(Double.parseDouble(combination.getSealUp())))
|
.sealUp(BigDecimal.valueOf(Double.parseDouble(combination.getSealUp())))
|
||||||
.sealDown(BigDecimal.valueOf(Double.parseDouble(combination.getSealDown())))
|
.sealDown(BigDecimal.valueOf(Double.parseDouble(combination.getSealDown())))
|
||||||
.holeFace(Integer.valueOf(combination.getTypographicFace()))
|
.holeFace(Integer.valueOf(typographyDTO.getValue()))
|
||||||
.texture(Integer.valueOf(combination.getTexture()))
|
.texture(Integer.valueOf(grainDTO.getValue()))
|
||||||
.area(area)
|
.area(area)
|
||||||
.openDoorType(Integer.valueOf(combination.getOpenDoorType()))
|
.openDoorType(Integer.valueOf(doorDTO.getValue()))
|
||||||
.isSpecialShaped(false)
|
.isSpecialShaped(false)
|
||||||
.isSculpt(false)
|
.isSculpt(false)
|
||||||
.remark(remarkExtract(combination.remarkJSON()))
|
.remark(remarkExtract(combination.remarkJSON()))
|
||||||
@@ -217,14 +228,13 @@ public class ExcelTypeRealize {
|
|||||||
.num(1.0).groupId(groupId).build();
|
.num(1.0).groupId(groupId).build();
|
||||||
orderItemDOS.add(orderItemDO);
|
orderItemDOS.add(orderItemDO);
|
||||||
orderModelDOS.add(OrderModelDO.builder().orderId(orderId).plateId(plateId)
|
orderModelDOS.add(OrderModelDO.builder().orderId(orderId).plateId(plateId)
|
||||||
.typographicFace(Integer.valueOf(combination.getTypographicFace())).build());
|
.typographicFace(Integer.valueOf(typographyDTO.getValue())).build());
|
||||||
}
|
}
|
||||||
plateCountByCabinetName[0] = plateCountByCabinetName[0] + plateCountByCombination[0];
|
plateCountByCabinetName[0] = plateCountByCabinetName[0] + plateCountByCombination[0];
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
//配件
|
//配件
|
||||||
Long partsId = (Long) snowFlakeGenerator.nextId(null);
|
Long partsId = (Long) snowFlakeGenerator.nextId(null);
|
||||||
System.err.println(" remark " + combination.remarkJSON());
|
|
||||||
OrderPartsDO orderPartsDO = OrderPartsDO.builder().id(partsId).orderId(orderId).goodsId(combination.getGoodsId())
|
OrderPartsDO orderPartsDO = OrderPartsDO.builder().id(partsId).orderId(orderId).goodsId(combination.getGoodsId())
|
||||||
.name(combination.getGoodsName()).material(combination.getMaterial()).type(combination.getGoodType())
|
.name(combination.getGoodsName()).material(combination.getMaterial()).type(combination.getGoodType())
|
||||||
.model(combination.getModel()).spec(combination.getSpec()).brand(combination.getBrand()).factory(combination.getFactory())
|
.model(combination.getModel()).spec(combination.getSpec()).brand(combination.getBrand()).factory(combination.getFactory())
|
||||||
@@ -265,7 +275,8 @@ public class ExcelTypeRealize {
|
|||||||
map.put("orderModuleExtraDOS", orderModuleExtraDOS);
|
map.put("orderModuleExtraDOS", orderModuleExtraDOS);
|
||||||
map.put("orderModelDOS", orderModelDOS);
|
map.put("orderModelDOS", orderModelDOS);
|
||||||
map.put("orderPartsRemarks", orderPartsRemarks);
|
map.put("orderPartsRemarks", orderPartsRemarks);
|
||||||
System.out.println(" orderGroupDOS " + orderGroupDOS);
|
System.out.println(" goodsDOS " + goodsDOS);
|
||||||
|
System.out.println(" rawGoodsDOS " + rawGoodsDOS);
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -284,43 +295,35 @@ public class ExcelTypeRealize {
|
|||||||
return nonNullJsonObject.toString();
|
return nonNullJsonObject.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 板材库数据
|
|
||||||
private PlateGoodDO setPlateGoodDO(OrderPlateImportExcelVO excelVO) {
|
|
||||||
return PlateGoodDO.builder()
|
|
||||||
// .id(plateGoodId)
|
|
||||||
.goodsId("")
|
|
||||||
.goodsName(excelVO.getGoodsName())
|
|
||||||
.material(excelVO.getMaterial())
|
|
||||||
.color(excelVO.getColor())
|
|
||||||
.width(Double.valueOf(excelVO.getWidth()))
|
|
||||||
.height(Double.valueOf(excelVO.getHeight()))
|
|
||||||
.thickness(Double.valueOf(excelVO.getThickness()))
|
|
||||||
.spec(excelVO.getSpec())
|
|
||||||
.brand(excelVO.getBrand())
|
|
||||||
.texture(excelVO.getTexture())
|
|
||||||
// .organId(organId)
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
|
|
||||||
// RawGoodsDO数据
|
// RawGoodsDO数据
|
||||||
private RawGoodsDO setRawGoodsDO(OrderPlateImportExcelVO excelVO) {
|
private RawGoodsDO setRawGoodsDO(OrderPlateImportExcelVO excelVO) {
|
||||||
|
if (StringUtils.equals(excelVO.getWave().trim(), "无")) {
|
||||||
|
excelVO.setWave("false");
|
||||||
|
} else if (StringUtils.equals(excelVO.getWave().trim(), "有")) {
|
||||||
|
excelVO.setWave("true");
|
||||||
|
}
|
||||||
return RawGoodsDO.builder()
|
return RawGoodsDO.builder()
|
||||||
// .id(rawGoodsId)
|
// .id(rawGoodsId)
|
||||||
// .orderId(orderId)
|
// .orderId(orderId)
|
||||||
.rawGoodsId(excelVO.getGoodsId())
|
.rawGoodsId(excelVO.getGoodsId())
|
||||||
.goodsName(excelVO.getGoodsName())
|
.goodsName(excelVO.getGoodsName())
|
||||||
.material(excelVO.getMaterial())
|
.material(excelVO.getMaterial())
|
||||||
.texture(Integer.valueOf(excelVO.getTexture()))
|
.texture(Boolean.valueOf(excelVO.getWave()))
|
||||||
.color(excelVO.getColor())
|
.color(excelVO.getColor())
|
||||||
.thickness(Double.valueOf(excelVO.getThickness()))
|
.thickness(Double.valueOf(excelVO.getThickness()))
|
||||||
.spec(excelVO.getSpec())
|
.spec(excelVO.getSpec())
|
||||||
.brand(excelVO.getBrand())
|
.brand(excelVO.getBrand())
|
||||||
.texture(Integer.valueOf(excelVO.getTexture()))
|
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
// GoodsDO数据
|
// GoodsDO数据
|
||||||
private GoodsDO setGoodsDO(OrderPlateImportExcelVO excelVO) {
|
private GoodsDO setGoodsDO(OrderPlateImportExcelVO excelVO) {
|
||||||
|
if (StringUtils.equals(excelVO.getWave().trim(), "无")) {
|
||||||
|
excelVO.setWave("false");
|
||||||
|
} else if (StringUtils.equals(excelVO.getWave().trim(), "有")) {
|
||||||
|
excelVO.setWave("true");
|
||||||
|
}
|
||||||
return GoodsDO.builder()
|
return GoodsDO.builder()
|
||||||
// .id(goodId)
|
// .id(goodId)
|
||||||
// .orderId(orderId)
|
// .orderId(orderId)
|
||||||
@@ -328,7 +331,7 @@ public class ExcelTypeRealize {
|
|||||||
// .goodsId(plateGoodId)
|
// .goodsId(plateGoodId)
|
||||||
.goodsName(excelVO.getGoodsName())
|
.goodsName(excelVO.getGoodsName())
|
||||||
.material(excelVO.getMaterial())
|
.material(excelVO.getMaterial())
|
||||||
.texture(Integer.valueOf(excelVO.getTexture()))
|
.texture(Boolean.valueOf(excelVO.getWave()))
|
||||||
.color(excelVO.getColor())
|
.color(excelVO.getColor())
|
||||||
.width(BigDecimal.valueOf(Double.valueOf(excelVO.getWidth())))
|
.width(BigDecimal.valueOf(Double.valueOf(excelVO.getWidth())))
|
||||||
.height(BigDecimal.valueOf(Double.valueOf(excelVO.getHeight())))
|
.height(BigDecimal.valueOf(Double.valueOf(excelVO.getHeight())))
|
||||||
|
|||||||
+4
@@ -49,6 +49,10 @@ public class OrderPlateImportExcelVO {
|
|||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
private String material;
|
private String material;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "纹理")
|
||||||
|
@JsonIgnore
|
||||||
|
private String wave;
|
||||||
|
|
||||||
@ExcelProperty(value = "颜色")
|
@ExcelProperty(value = "颜色")
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
private String color;
|
private String color;
|
||||||
|
|||||||
BIN
Binary file not shown.
BIN
Binary file not shown.
+9
-3
@@ -114,9 +114,9 @@ public class PlateController {
|
|||||||
// 手动创建导出 demo
|
// 手动创建导出 demo
|
||||||
List<PlateImportExcelVO> list = Arrays.asList(
|
List<PlateImportExcelVO> list = Arrays.asList(
|
||||||
PlateImportExcelVO.builder().goodsId("SP1123456").goodsName("xixih").material("颗粒板").width(String.valueOf(1212.3)).height(String.valueOf(12131.6))
|
PlateImportExcelVO.builder().goodsId("SP1123456").goodsName("xixih").material("颗粒板").width(String.valueOf(1212.3)).height(String.valueOf(12131.6))
|
||||||
.thickness(String.valueOf(0.2)).brand("鹅厂").spec("大厂").remark("测试").price(String.valueOf(33333.2)).color("黑色").texture("交换机1").build(),
|
.thickness(String.valueOf(0.2)).brand("鹅厂").spec("大厂").remark("测试").price(String.valueOf(33333.2)).color("黑色").texture("有").build(),
|
||||||
PlateImportExcelVO.builder().goodsId("SP1123457").goodsName("2L").material("yuanma@cf.com").width(String.valueOf(21.6)).height(String.valueOf(12231.6))
|
PlateImportExcelVO.builder().goodsId("SP1123457").goodsName("2L").material("yuanma@cf.com").width(String.valueOf(21.6)).height(String.valueOf(12231.6))
|
||||||
.thickness(String.valueOf(5.3)).brand("kkkkkk").spec("大厂").remark("测试").price(String.valueOf(333.555)).color("黑色").texture("交换机2").build()
|
.thickness(String.valueOf(5.3)).brand("kkkkkk").spec("大厂").remark("测试").price(String.valueOf(333.555)).color("黑色").texture("无").build()
|
||||||
);
|
);
|
||||||
// 输出
|
// 输出
|
||||||
ExcelUtils.write(response, "板材导入模板.xlsx", "板材列表", PlateImportExcelVO.class, list);
|
ExcelUtils.write(response, "板材导入模板.xlsx", "板材列表", PlateImportExcelVO.class, list);
|
||||||
@@ -141,7 +141,13 @@ public class PlateController {
|
|||||||
if (!plateExcelUtil.getFlag())
|
if (!plateExcelUtil.getFlag())
|
||||||
ExcelUtils.write(response, "板材导入模板.xlsx", "板材列表", PlateImportExcelVO.class, list);
|
ExcelUtils.write(response, "板材导入模板.xlsx", "板材列表", PlateImportExcelVO.class, list);
|
||||||
else {
|
else {
|
||||||
PlateImportRespVO respVO = plateService.importPlateList(list, updateSupport, organId);// 成功,批量导入
|
if (list.size() == 0){
|
||||||
|
PlateImportExcelVO plateImportExcelVO = PlateImportExcelVO.builder().result("导入失败,请保证导入文件中包含板材数据").build();
|
||||||
|
list.add(plateImportExcelVO);
|
||||||
|
ExcelUtils.write(response, "板材导入模板.xlsx", "板材列表", PlateImportExcelVO.class, list);
|
||||||
|
}else {
|
||||||
|
plateService.importPlateList(list, updateSupport, organId);// 成功,批量导入
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
plateExcelUtil.clear();
|
plateExcelUtil.clear();
|
||||||
|
|||||||
+2
-2
@@ -36,8 +36,8 @@ public class PlateImportExcelVO {
|
|||||||
@NotEmpty(message = "颜色不能为空")
|
@NotEmpty(message = "颜色不能为空")
|
||||||
private String color;
|
private String color;
|
||||||
|
|
||||||
@ExcelProperty("纹路")
|
@ExcelProperty("纹理")
|
||||||
@NotEmpty(message = "纹路不能为空")
|
@NotEmpty(message = "纹路不能为空,填 有 无")
|
||||||
private String texture;
|
private String texture;
|
||||||
|
|
||||||
@ExcelProperty("宽度")
|
@ExcelProperty("宽度")
|
||||||
|
|||||||
+2
-2
@@ -30,8 +30,8 @@ public class PlatePageReqVO extends PageParam {
|
|||||||
@Schema(description = "颜色")
|
@Schema(description = "颜色")
|
||||||
private String color;
|
private String color;
|
||||||
|
|
||||||
@Schema(description = "纹路")
|
@Schema(description = "纹理")
|
||||||
private String texture;
|
private Boolean texture;
|
||||||
|
|
||||||
@Schema(description = "宽度")
|
@Schema(description = "宽度")
|
||||||
private Double width;
|
private Double width;
|
||||||
|
|||||||
+2
-2
@@ -31,8 +31,8 @@ public class PlateRespVO {
|
|||||||
@ExcelProperty("颜色")
|
@ExcelProperty("颜色")
|
||||||
private String color;
|
private String color;
|
||||||
|
|
||||||
@Schema(description = "纹路", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "纹理", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
@ExcelProperty("纹路")
|
@ExcelProperty("纹理")
|
||||||
private String texture;
|
private String texture;
|
||||||
|
|
||||||
@Schema(description = "宽度", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "宽度", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
|||||||
+3
-3
@@ -29,9 +29,9 @@ public class PlateSaveReqVO {
|
|||||||
@NotEmpty(message = "颜色不能为空")
|
@NotEmpty(message = "颜色不能为空")
|
||||||
private String color;
|
private String color;
|
||||||
|
|
||||||
@Schema(description = "纹路", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "纹理", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
@NotEmpty(message = "纹路不能为空")
|
@NotEmpty(message = "纹理路不能为空")
|
||||||
private String texture;
|
private Boolean texture;
|
||||||
|
|
||||||
@Schema(description = "宽度", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "宽度", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
@NotNull(message = "宽度不能为空")
|
@NotNull(message = "宽度不能为空")
|
||||||
|
|||||||
+2
-2
@@ -42,9 +42,9 @@ public class PlateDO extends BaseDO {
|
|||||||
*/
|
*/
|
||||||
private String color;
|
private String color;
|
||||||
/**
|
/**
|
||||||
* 纹路
|
* 纹理
|
||||||
*/
|
*/
|
||||||
private String texture;
|
private Boolean texture;
|
||||||
/**
|
/**
|
||||||
* 宽度
|
* 宽度
|
||||||
*/
|
*/
|
||||||
|
|||||||
+1
-1
@@ -34,7 +34,7 @@ public interface PlateMapper extends BaseMapperX<PlateDO> {
|
|||||||
.likeIfPresent(PlateDO::getSpec, reqVO.getSpec())
|
.likeIfPresent(PlateDO::getSpec, reqVO.getSpec())
|
||||||
.likeIfPresent(PlateDO::getRemark, reqVO.getRemark())
|
.likeIfPresent(PlateDO::getRemark, reqVO.getRemark())
|
||||||
.eqIfPresent(PlateDO::getPrice, reqVO.getPrice())
|
.eqIfPresent(PlateDO::getPrice, reqVO.getPrice())
|
||||||
.likeIfPresent(PlateDO::getTexture, reqVO.getTexture())
|
.eqIfPresent(PlateDO::getTexture, reqVO.getTexture())
|
||||||
.betweenIfPresent(PlateDO::getCreateTime, reqVO.getCreateTime());
|
.betweenIfPresent(PlateDO::getCreateTime, reqVO.getCreateTime());
|
||||||
|
|
||||||
if (reqVO.getOrder() == null) {
|
if (reqVO.getOrder() == null) {
|
||||||
|
|||||||
+17
@@ -36,6 +36,7 @@ public final class PlateExcelListener<T> extends AnalysisEventListener<PlateImpo
|
|||||||
checkData(data.getWidth(),"宽度",data);
|
checkData(data.getWidth(),"宽度",data);
|
||||||
checkData(data.getThickness(),"厚度",data);
|
checkData(data.getThickness(),"厚度",data);
|
||||||
checkData(data.getPrice(),"价格",data);
|
checkData(data.getPrice(),"价格",data);
|
||||||
|
checkTexture(data.getTexture(),"纹理",data);
|
||||||
if (data.getResult() != null)
|
if (data.getResult() != null)
|
||||||
data.setResult(data.getResult().replace("null,", ""));
|
data.setResult(data.getResult().replace("null,", ""));
|
||||||
valueMap.put(context.getCurrentRowNum(), data.getResult());
|
valueMap.put(context.getCurrentRowNum(), data.getResult());
|
||||||
@@ -61,6 +62,22 @@ public final class PlateExcelListener<T> extends AnalysisEventListener<PlateImpo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void checkTexture(String valueCheck, String head, PlateImportExcelVO data) {
|
||||||
|
String value = valueCheck.trim();
|
||||||
|
if (value.equals("")) {
|
||||||
|
this.flag = false;
|
||||||
|
data.setResult(data.getResult() + "," + head + "信息缺少");
|
||||||
|
} else {
|
||||||
|
if (!value.equals("有") && !value.equals("无")) {
|
||||||
|
this.flag = false;
|
||||||
|
data.setResult(data.getResult() + "," + head + "信息有误");
|
||||||
|
} else if (value.equals("有")) {
|
||||||
|
data.setTexture("true");
|
||||||
|
} else {
|
||||||
|
data.setTexture("false");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 读取完后操作
|
* 读取完后操作
|
||||||
*
|
*
|
||||||
|
|||||||
+6
-5
@@ -116,9 +116,10 @@ public class PlateServiceImpl implements PlateService {
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class) // 添加事务,异常则回滚所有导入
|
@Transactional(rollbackFor = Exception.class) // 添加事务,异常则回滚所有导入
|
||||||
public PlateImportRespVO importPlateList(List<PlateImportExcelVO> importPlates, boolean isUpdateSupport , Long organId) {
|
public PlateImportRespVO importPlateList(List<PlateImportExcelVO> importPlates, boolean isUpdateSupport , Long organId) {
|
||||||
if (CollUtil.isEmpty(importPlates)) {
|
System.out.println(" importPlates " + importPlates);
|
||||||
throw ServiceExceptionUtil.exception(ErrorCodeConstants.PLATE_IMPORT_LIST_IS_EMPTY);
|
// if (CollUtil.isEmpty(importPlates)) {
|
||||||
}
|
// throw ServiceExceptionUtil.exception(ErrorCodeConstants.PLATE_IMPORT_LIST_IS_EMPTY);
|
||||||
|
// }
|
||||||
validateOrganExists(organId);
|
validateOrganExists(organId);
|
||||||
PlateImportRespVO respVO = PlateImportRespVO.builder().createPlateNames(new ArrayList<>())
|
PlateImportRespVO respVO = PlateImportRespVO.builder().createPlateNames(new ArrayList<>())
|
||||||
.updatePlateNames(new ArrayList<>()).failurePlateNames(new LinkedHashMap<>()).build();
|
.updatePlateNames(new ArrayList<>()).failurePlateNames(new LinkedHashMap<>()).build();
|
||||||
@@ -131,13 +132,13 @@ public class PlateServiceImpl implements PlateService {
|
|||||||
PlateDO existPlate = plateMapper.selectByGoodID(importPlate.getGoodsId(), organId);
|
PlateDO existPlate = plateMapper.selectByGoodID(importPlate.getGoodsId(), organId);
|
||||||
if (existPlate == null) {
|
if (existPlate == null) {
|
||||||
respVO.getCreatePlateNames().add(importPlate.getGoodsName());
|
respVO.getCreatePlateNames().add(importPlate.getGoodsName());
|
||||||
insertList.add(BeanUtils.toBean(importPlate, PlateDO.class).setOrganId(organId));
|
insertList.add(BeanUtils.toBean(importPlate, PlateDO.class).setOrganId(organId).setTexture(Boolean.valueOf(importPlate.getTexture())));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 判断是否允许更新
|
// 判断是否允许更新
|
||||||
if (!isUpdateSupport) {
|
if (!isUpdateSupport) {
|
||||||
respVO.getFailurePlateNames().put(importPlate.getGoodsName(), ErrorCodeConstants.PLATE_EXISTS.getMsg());
|
respVO.getFailurePlateNames().put(importPlate.getGoodsName(), ErrorCodeConstants.PLATE_EXISTS.getMsg());
|
||||||
PlateDO plateDO = BeanUtils.toBean(importPlate, PlateDO.class).setOrganId(organId).setId(existPlate.getId());
|
PlateDO plateDO = BeanUtils.toBean(importPlate, PlateDO.class).setOrganId(organId).setId(existPlate.getId()).setTexture(Boolean.valueOf(importPlate.getTexture()));
|
||||||
updateList.add(plateDO);
|
updateList.add(plateDO);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user