| | |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.entity.QueryRequest; |
| | | import cc.mrbird.febs.common.enumerates.*; |
| | | import cc.mrbird.febs.common.exception.FebsException; |
| | | import cc.mrbird.febs.common.properties.XcxProperties; |
| | | import cc.mrbird.febs.common.utils.SpringContextHolder; |
| | | import cc.mrbird.febs.common.utils.excl.ExcelSheetPO; |
| | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.hutool.json.JSON; |
| | | import cn.hutool.json.JSONObject; |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | |
| | | import java.io.OutputStream; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.net.URLEncoder; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | |
| | | private final ClothesTypePatternMapper clothesTypePatternMapper; |
| | | private final ClothesTypeLocationMapper clothesTypeLocationMapper; |
| | | private final ClothesOrderMapper clothesOrderMapper; |
| | | private final ClothesOrderItemMapper clothesOrderItemMapper; |
| | | private final MallExpressInfoMapper mallExpressInfoMapper; |
| | | private final ClothesSocialMapper clothesSocialMapper; |
| | | private final ClothesSocialFileMapper clothesSocialFileMapper; |
| | | private final ClothesSocialMuseMapper clothesSocialMuseMapper; |
| | | private final ClothesSocialCategoryMapper clothesSocialCategoryMapper; |
| | | private final ClothesMemberStatureMapper clothesMemberStatureMapper; |
| | | |
| | | private final ClothesPatternRemarkMapper clothesPatternRemarkMapper; |
| | | private final ClothesLocationRemarkMapper clothesLocationRemarkMapper; |
| | |
| | | return new FebsResponse().success().message("操作成功"); |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse printOrder(AdminClothesPrintOrderDto dto) { |
| | | HashMap<String, Object> objectObjectHashMap = new HashMap<>(); |
| | | ClothesOrder order = clothesOrderMapper.selectById(dto.getId()); |
| | | if (ObjectUtil.isNotNull(order)){ |
| | | objectObjectHashMap.put("orderNo", order.getOrderNo()); |
| | | } |
| | | ClothesType clothesType = clothesTypeMapper.selectById(order.getTypeId()); |
| | | if (ObjectUtil.isNotNull(clothesType)) { |
| | | objectObjectHashMap.put("typeName", clothesType.getName()); |
| | | objectObjectHashMap.put("typeFront", clothesType.getImageFront()); |
| | | objectObjectHashMap.put("typeBack", clothesType.getImageBack()); |
| | | } |
| | | List<ClothesOrderItem> clothesOrderItems = clothesOrderItemMapper.selectList( |
| | | Wrappers.lambdaQuery(ClothesOrderItem.class) |
| | | .eq(ClothesOrderItem::getOrderId, order.getId()) |
| | | ); |
| | | if(CollUtil.isNotEmpty(clothesOrderItems)){ |
| | | for (ClothesOrderItem item : clothesOrderItems){ |
| | | if (ClothesOrderItemEnum.CLOTH.getCode() == item.getType()) { |
| | | ClothesCloth cloth = clothesClothMapper.selectById(item.getItemId()); |
| | | if (ObjectUtil.isNotNull(cloth)) { |
| | | objectObjectHashMap.put("clothName", cloth.getName()); |
| | | objectObjectHashMap.put("clothCode", cloth.getCode()); |
| | | } |
| | | continue; |
| | | } else if (ClothesOrderItemEnum.SIZE.getCode() == item.getType()) { |
| | | ClothesSize size = clothesSizeMapper.selectById(item.getItemId()); |
| | | if (ObjectUtil.isNotNull(size)) { |
| | | objectObjectHashMap.put("sizeName", size.getName()); |
| | | objectObjectHashMap.put("sizeCode", size.getCode()); |
| | | } |
| | | continue; |
| | | } else if (ClothesOrderItemEnum.LOCATION.getCode() == item.getType()) { |
| | | ClothesLocation location = clothesLocationMapper.selectById(item.getItemId()); |
| | | if (ObjectUtil.isNotNull(location)) { |
| | | objectObjectHashMap.put("locationName", location.getName()); |
| | | objectObjectHashMap.put("locationCode", location.getCode()); |
| | | |
| | | JSON parse = JSONUtil.parse(item.getRemark()); |
| | | objectObjectHashMap.put("locationText", parse.getByPath("text", String.class)); |
| | | objectObjectHashMap.put("locationImage", parse.getByPath("file", String.class)); |
| | | }else{ |
| | | objectObjectHashMap.put("locationName", ""); |
| | | objectObjectHashMap.put("locationCode", ""); |
| | | objectObjectHashMap.put("locationText", ""); |
| | | objectObjectHashMap.put("locationImage", ""); |
| | | } |
| | | continue; |
| | | } else if (ClothesOrderItemEnum.PATTERN.getCode() == item.getType()) { |
| | | ClothesPattern pattern = clothesPatternMapper.selectById(item.getItemId()); |
| | | if (ObjectUtil.isNotNull(pattern)) { |
| | | objectObjectHashMap.put("patternName", pattern.getName()); |
| | | objectObjectHashMap.put("patternCode", pattern.getCode()); |
| | | |
| | | JSON parse = JSONUtil.parse(item.getRemark()); |
| | | objectObjectHashMap.put("patternText", parse.getByPath("text", String.class)); |
| | | objectObjectHashMap.put("patternImage", parse.getByPath("file", String.class)); |
| | | }else{ |
| | | objectObjectHashMap.put("patternName", ""); |
| | | objectObjectHashMap.put("patternCode", ""); |
| | | objectObjectHashMap.put("patternText", ""); |
| | | objectObjectHashMap.put("patternImage", ""); |
| | | } |
| | | continue; |
| | | } else if (ClothesOrderItemEnum.ART.getCode() == item.getType()) { |
| | | ClothesArt art = clothesArtMapper.selectById(item.getItemId()); |
| | | if (ObjectUtil.isNotNull(art)) { |
| | | objectObjectHashMap.put("artName", art.getName()); |
| | | objectObjectHashMap.put("artCode", art.getCode()); |
| | | } |
| | | continue; |
| | | } else if (ClothesOrderItemEnum.CUSTOMIZE.getCode() == item.getType()) { |
| | | ClothesMemberStature clothesMemberStature = clothesMemberStatureMapper.selectById(item.getItemId()); |
| | | if (ObjectUtil.isNotNull(clothesMemberStature)) { |
| | | objectObjectHashMap.put("statureName", clothesMemberStature.getName()); |
| | | } |
| | | continue; |
| | | } else { |
| | | continue; |
| | | } |
| | | } |
| | | } |
| | | return new FebsResponse().success().data(objectObjectHashMap); |
| | | } |
| | | |
| | | } |