Bläddra i källkod

发运明细调整,推书调整

zengtx 2 år sedan
förälder
incheckning
edfaad07c6
17 ändrade filer med 491 tillägg och 96 borttagningar
  1. 4 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/seclarationElements/mapper/SyDeclarationElementsMapper.java
  2. 8 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/seclarationElements/mapper/xml/SyDeclarationElementsMapper.xml
  3. 38 24
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/seclarationElements/service/impl/SyDeclarationElementsServiceImpl.java
  4. 151 27
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/controller/SyShippingDetailsController.java
  5. 1 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/entity/SyShippingDetailsItem.java
  6. 207 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/entity/VO/SyPreAssembledPackingListVo.java
  7. 13 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/entity/VO/SyShippingDetailsVo.java
  8. 5 4
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/mapper/SyShippingDetailsMapper.java
  9. 19 9
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/mapper/xml/SyShippingDetailsMapper.xml
  10. 3 4
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/service/ISyShippingDetailsService.java
  11. 9 4
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/service/impl/SyShippingDetailsServiceImpl.java
  12. 0 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/syShippingOrder/controller/SyShippingOrderController.java
  13. 3 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/syShippingOrder/entity/SyShippingOrder.java
  14. 3 3
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/syShippingOrder/mapper/xml/SyShippingOrderMapper.xml
  15. 3 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/syShippingOrder/service/impl/SyShippingOrderServiceImpl.java
  16. 22 16
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/controller/PurchaseWarehousingController.java
  17. 2 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/service/impl/PurchaseWarehousingServiceImpl.java

+ 4 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/seclarationElements/mapper/SyDeclarationElementsMapper.java

@@ -5,6 +5,8 @@ import java.util.List;
 import org.apache.ibatis.annotations.Param;
 import org.jeecg.modules.documents.seclarationElements.entity.SyDeclarationElements;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.modules.documents.shippingDetails.entity.SyShippingDetailsItem;
+import org.jeecg.modules.documents.shippingDetails.entity.VO.SyShippingDetailsVo;
 
 /**
  * @Description: 报关要素
@@ -14,4 +16,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface SyDeclarationElementsMapper extends BaseMapper<SyDeclarationElements> {
 
+    //查询发运明细
+    public List<SyShippingDetailsVo> queryList(@Param("elmentId") String elmentId);
 }

+ 8 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/seclarationElements/mapper/xml/SyDeclarationElementsMapper.xml

@@ -2,4 +2,12 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="org.jeecg.modules.documents.seclarationElements.mapper.SyDeclarationElementsMapper">
 
+    <select id="queryList" resultType="org.jeecg.modules.documents.shippingDetails.entity.VO.SyShippingDetailsVo">
+
+        select a.push_state as pushState,b.id as itemIds from sy_shipping_details a
+        left join sy_shipping_details_item b
+        on a.id = b.shipping_details_id
+        where a.del_flag = '0' and b.del_flag = '0' and b.elements_id = #{elmentId}
+
+    </select>
 </mapper>

+ 38 - 24
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/seclarationElements/service/impl/SyDeclarationElementsServiceImpl.java

@@ -8,6 +8,8 @@ import org.jeecg.modules.documents.seclarationElements.mapper.SyDeclarationEleme
 import org.jeecg.modules.documents.seclarationElements.service.ISyDeclarationElementsItemService;
 import org.jeecg.modules.documents.seclarationElements.service.ISyDeclarationElementsService;
 import org.jeecg.modules.documents.shippingDetails.entity.SyShippingDetailsItem;
+import org.jeecg.modules.documents.shippingDetails.entity.VO.SyShippingDetailsVo;
+import org.jeecg.modules.documents.shippingDetails.mapper.SyShippingDetailsMapper;
 import org.jeecg.modules.documents.shippingDetails.service.ISyShippingDetailsItemService;
 import org.jeecg.modules.documents.shippingDetails.service.ISyShippingDetailsService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -15,6 +17,7 @@ import org.springframework.stereotype.Service;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 
+import javax.annotation.Resource;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -34,6 +37,10 @@ public class SyDeclarationElementsServiceImpl extends ServiceImpl<SyDeclarationE
     private ISyShippingDetailsItemService syShippingDetailsItemService;
     @Autowired
     private ISyShippingDetailsService syShippingDetailsService;
+    @Resource
+    private SyShippingDetailsMapper syShippingDetailsMapper;
+    @Resource
+    private SyDeclarationElementsMapper syDeclarationElementsMapper;
 
     /**
      * 新增(发运明细调用)
@@ -117,11 +124,9 @@ public class SyDeclarationElementsServiceImpl extends ServiceImpl<SyDeclarationE
                 }
 
                 //查询其他发运明细是否有相同
-                QueryWrapper<SyShippingDetailsItem> queryWrapper = new QueryWrapper<>();
-                queryWrapper.eq("item_number",zero.getItemNumber()).eq("inventory_name",zero.getInventoryName()).eq("ompo_account",zero.getOmpoAccount());
-                List<SyShippingDetailsItem> list2 = syShippingDetailsItemService.list(queryWrapper);
-                for(SyShippingDetailsItem li2:list2){
-                    shippingList.add(li2.getId());
+                List<SyShippingDetailsVo> list2 = syShippingDetailsMapper.queryAllsyShippingDeial(zero.getItemNumber(),zero.getInventoryName(),zero.getOmpoAccount());
+                for(SyShippingDetailsVo li2:list2){
+                    shippingList.add(li2.getItemIds());
                 }
                //修改发运明细报关要素ID
                 syShippingDetailsService.writeBackElenmentId(id,shippingList);
@@ -133,30 +138,39 @@ public class SyDeclarationElementsServiceImpl extends ServiceImpl<SyDeclarationE
 
         }else{ //修改
 
-             //删除子表
-            QueryWrapper<SyDeclarationElementsItem> queryWrapperItem = new QueryWrapper<SyDeclarationElementsItem>();
-            queryWrapperItem.eq("sy_declaration_elements_id", elementid).eq("del_flag", 0);
-            List<SyDeclarationElementsItem> syDeclarationElementsItemsList = syDeclarationElementsItemService.list(queryWrapperItem);
+            //记录未推送的发运明细子表ID集合
+            List<String> itemIdsZeor = new ArrayList<>();
 
-            for(SyDeclarationElementsItem li:syDeclarationElementsItemsList){
-               // li.setDelFlag("1");
-                syDeclarationElementsItemService.removeById(li.getId());
-            }
-            //syDeclarationElementsItemService.updateBatchById(syDeclarationElementsItemsList);
+            //查询发运明细
+           List<SyShippingDetailsVo> list1= syDeclarationElementsMapper.queryList(elementid);
 
-            //新增子表
-            List<SyDeclarationElementsItem> list = syDeclarationElements.getSyDeclarationElementsItemList();
-            for (SyDeclarationElementsItem item:list){
-                item.setId(oConvertUtils.id());
-                item.setSyDeclarationElementsId(syDeclarationElements.getId());
-                syDeclarationElementsItemList.add(item);
+            for(SyShippingDetailsVo li: list1){
+                if(li.getPushState().equals("0")){
+                    itemIdsZeor.add(li.getItemIds());
+                }
             }
-            if(syDeclarationElementsItemList.size()!=0){
-                syDeclarationElementsItemService.saveBatch(syDeclarationElementsItemList);
+
+            if(itemIdsZeor.size()!=0){
+                String uuid = oConvertUtils.id();
+                //新增子表
+                List<SyDeclarationElementsItem> list = syDeclarationElements.getSyDeclarationElementsItemList();
+                for (SyDeclarationElementsItem item:list){
+                    item.setId(oConvertUtils.id());
+                    item.setSyDeclarationElementsId(uuid);
+                    syDeclarationElementsItemList.add(item);
+                }
+                if(syDeclarationElementsItemList.size()!=0){
+                    syDeclarationElementsItemService.saveBatch(syDeclarationElementsItemList);
+                }
+                //新增主表
+                syDeclarationElements.setId(uuid);
+                save(syDeclarationElements);
+
+                //修改发运明细报关要素ID
+                syShippingDetailsService.writeBackElenmentId(uuid,itemIdsZeor);
+
             }
 
-            //修改主表
-            updateById(syDeclarationElements);
         }
         return syDeclarationElements;
     }

+ 151 - 27
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/controller/SyShippingDetailsController.java

@@ -1,18 +1,25 @@
 package org.jeecg.modules.documents.shippingDetails.controller;
 
+import java.io.File;
+import java.lang.reflect.Field;
+import java.text.DateFormat;
 import java.text.SimpleDateFormat;
 import java.util.*;
 import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 import java.net.URLDecoder;
 import javax.annotation.Resource;
+import javax.servlet.ServletOutputStream;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
 import com.alibaba.fastjson.JSONObject;
 import com.google.gson.Gson;
 import com.google.gson.GsonBuilder;
 //import org.apache.shiro.SecurityUtils;
+import org.apache.poi.hssf.util.HSSFColor;
+import org.apache.poi.ss.usermodel.*;
 import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.exception.JeecgBootException;
@@ -29,17 +36,19 @@ import org.jeecg.modules.documents.seclarationElements.service.ISyDeclarationEle
 import org.jeecg.modules.documents.seclarationElements.service.ISyDeclarationElementsService;
 import org.jeecg.modules.documents.shippingDetails.entity.SyShippingDetails;
 import org.jeecg.modules.documents.shippingDetails.entity.SyShippingDetailsItem;
-import org.jeecg.modules.documents.shippingDetails.entity.VO.OrderDataVo;
-import org.jeecg.modules.documents.shippingDetails.entity.VO.PushShippingDeialVo;
-import org.jeecg.modules.documents.shippingDetails.entity.VO.PushShippingVO;
-import org.jeecg.modules.documents.shippingDetails.entity.VO.SyShippingDetailsVo;
+import org.jeecg.modules.documents.shippingDetails.entity.VO.*;
 import org.jeecg.modules.documents.shippingDetails.mapper.SyShippingDetailsMapper;
 import org.jeecg.modules.documents.shippingDetails.service.ISyShippingDetailsItemService;
 import org.jeecg.modules.documents.shippingDetails.service.ISyShippingDetailsService;
 
 import java.util.logging.SimpleFormatter;
 
+import org.jeecg.modules.documents.syShippingOrder.entity.SyShippingOrderItem;
+import org.jeecg.modules.monitor.service.impl.RedisServiceImpl;
+import org.jeecg.modules.spapl.entity.SizeTable;
+import org.jeecg.modules.spapl.entity.SyPreAssembledPackingList;
 import org.jeecg.modules.spapl.entity.SyPreAssembledPackingListItem;
+import org.jeecg.modules.spapl.mapper.SyPreAssembledPackingListItemMapper;
 import org.jeecg.modules.spapl.service.impl.SyPreAssembledPackingListItemServiceImpl;
 import org.jeecg.modules.spapl.vo.SyPreAssembledPackingListPage;
 import org.jeecg.modules.splfi.entity.SyPackingListFabricItem;
@@ -57,10 +66,12 @@ import org.jeecg.modules.system.entity.SysUser;
 import org.jeecg.modules.system.util.InterfaceConnUtils;
 import org.jeecg.modules.system.util.JsonChangeUtils;
 import org.jeecg.modules.system.util.SecurityUtil;
+import org.jeecgframework.poi.excel.ExcelExportUtil;
 import org.jeecgframework.poi.excel.ExcelImportUtil;
 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
 import org.jeecgframework.poi.excel.entity.ExportParams;
 import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.entity.enmus.ExcelType;
 import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
 
 import org.springframework.beans.factory.annotation.Autowired;
@@ -101,6 +112,9 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
 	 private SyPreAssembledPackingListItemServiceImpl syPreAssembledPackingListItemService;
 	 @Autowired
 	 private SyPackingListFabricItemServiceImpl syPackingListFabricItemService;
+
+	 @Autowired
+	 private SyPreAssembledPackingListItemMapper syPreAssembledPackingListItemMapper;
 	
 	/**
 	 * 分页列表查询
@@ -159,6 +173,9 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
 			}
 
 		}
+		if(oConvertUtils.isNotEmpty(syShippingDetails.getSubmitStatus())){
+			queryWrapper.eq("t.submitStatus",syShippingDetails.getSubmitStatus());
+		}
 
 		Page<SyShippingDetailsVo> page = new Page<SyShippingDetailsVo>(1, -1);
 		if(flourOrGarment.equals("0")){//面辅料
@@ -410,52 +427,159 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
   /**
    * 导出excel
    *
-   * @param request
+   * @param req
    * @param syShippingDetails
    */
   @AutoLog(value = "发运明细主表-导出")
   @ApiOperation(value="发运明细主表-导出", notes="发运明细主表-导出")
   @RequestMapping(value = "/exportXls")
-  public ModelAndView exportXls(HttpServletRequest request,SyShippingDetailsVo syShippingDetails,String startTime,String endTime) {
+  public Result<String> exportXls(SyShippingDetailsVo syShippingDetails,String startTime,String endTime,String flourOrGarment,
+								String refer,String preDeliveryDateB,String preDeliveryDateE,String supplier,String isElement,
+								@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								HttpServletResponse req) {
+
+	  Result<String> result = new Result<String>();
+
+	  IPage<SyShippingDetailsVo> pageList = null;
+
+	  List<SyPreAssembledPackingListVo> syPreList = new ArrayList<>();
+
+	  DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
 
 	  QueryWrapper<SyShippingDetailsVo> queryWrapper = new QueryWrapper<>();
+	  SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
 	  if(oConvertUtils.isNotEmpty(syShippingDetails.getDocumentNo())){
-		  queryWrapper.eq("t.documentNo",syShippingDetails.getDocumentNo());
+		  queryWrapper.like("t.documentNo",syShippingDetails.getDocumentNo());
+	  }
+	  if(oConvertUtils.isNotEmpty(syShippingDetails.getOrderNumber())){
+		  queryWrapper.like("t.orderNumber",syShippingDetails.getOrderNumber());
 	  }
 	  if(oConvertUtils.isNotEmpty(startTime)){
-
 		  queryWrapper.ge("t.documentDate",startTime);
 		  queryWrapper.le("t.documentDate",endTime);
 	  }
-	  if(oConvertUtils.isNotEmpty(syShippingDetails.getPreDeliveryDate())){
-		  queryWrapper.eq("t.preDeliveryDate",syShippingDetails.getPreDeliveryDate());
+	  if(oConvertUtils.isNotEmpty(preDeliveryDateB)){
+		  queryWrapper.ge("t.preDeliveryDate",preDeliveryDateB);
+		  queryWrapper.le("t.preDeliveryDate",preDeliveryDateE);
 	  }
+
 	  if(oConvertUtils.isNotEmpty(syShippingDetails.getSalesman())){
-		  queryWrapper.eq("t.salesman",syShippingDetails.getSalesman());
+		  queryWrapper.like("t.salesman",syShippingDetails.getSalesman());
 	  }
 	  if(oConvertUtils.isNotEmpty(syShippingDetails.getItemNumber())){
-		  queryWrapper.eq("t.itemNumber",syShippingDetails.getItemNumber());
+		  queryWrapper.like("t.itemNumber",syShippingDetails.getItemNumber());
+	  }
+	  if(oConvertUtils.isNotEmpty(refer)){
+		  queryWrapper.eq("t.isReference",refer);
+	  }
+	  if(oConvertUtils.isNotEmpty(supplier)){
+		  queryWrapper.like("t.supplier",supplier);
 	  }
+	  if(oConvertUtils.isNotEmpty(isElement)){
+		  if(isElement.equals("0")){//没有维护
+			  queryWrapper.isNull("t.elementsId");
+		  }else{
+			  queryWrapper.isNotNull("t.elementsId");
+		  }
 
-	  Page<SyShippingDetailsVo> page = new Page<SyShippingDetailsVo>(1, -1);
-	  IPage<SyShippingDetailsVo> pageList = syShippingDetailsMapper.exCelQuery(page, queryWrapper);
-	  for(SyShippingDetailsVo li:pageList.getRecords()){
-	  	if(oConvertUtils.isNotEmpty(li.getIsTc())){
-			if(li.getIsTc().equals("0")){
-				li.setIsTc("否");
-			}else{
-				li.setIsTc("是");
-			}
+	  }
+	  	if(oConvertUtils.isNotEmpty(syShippingDetails.getSubmitStatus())){
+			queryWrapper.eq("t.submitStatus",syShippingDetails.getSubmitStatus());
 		}
 
+	  try {
+		  Page<SyShippingDetailsVo> page = new Page<SyShippingDetailsVo>(1, -1);
+		  if(flourOrGarment.equals("0")){//面辅料
+			  pageList = syShippingDetailsService.queryShippingDetailsGarment(page, queryWrapper);
+		  }else{//成衣
+			  pageList = syShippingDetailsService.queryShippingDetails(page, queryWrapper);
+		  }
+		  for(SyShippingDetailsVo li:pageList.getRecords()){
+		  	String pre = sf.format(li.getPreDeliveryDate());
+		  	//用到货日期代替一下预发货日期
+		  	li.setArrivalDate(pre);
+			if(oConvertUtils.isNotEmpty(li.getIsTc())){
+				if(li.getIsTc().equals("0")){
+					li.setIsTc("否");
+				}else{
+					li.setIsTc("是");
+				}
+			}
+			  //转换数据
+			  SyPreAssembledPackingListVo entity = new SyPreAssembledPackingListVo(li);
+			  syPreList.add(entity);
+		  }
+
+		  String load="D:\\单证模板\\发运明细数据.xlsx";
+		  int count = syPreList.size();//分几条sheet
+		  File file=new File(load);
+		  cn.afterturn.easypoi.excel.entity.TemplateExportParams templateExcelConstants=new TemplateExportParams(file.getAbsolutePath(),true,"发运明细");
+		  List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>();
+		  Map<Integer, List<Map<String, Object>>> maps = new HashMap<Integer, List<Map<String, Object>>>();
+		  for (int i = 0; i < count ; i++) {
+			  List<SyPreAssembledPackingListVo> exportList=new ArrayList<>();
+			  exportList.add(syPreList.get(i));
+			  SyPreAssembledPackingListVo exportList2=syPreList.get(i);
+			  Map<String, Object> map = new HashMap<String, Object>();
+			  map.put("entity", exportList2);
+			  listMap.add(map);
+		  }
+		  maps.put(0,listMap);
+		  templateExcelConstants.setColForEach(true);
+		  Workbook workbook = cn.afterturn.easypoi.excel.ExcelExportUtil.exportExcelClone(maps,templateExcelConstants);
+
+		  Iterator sheets=workbook.sheetIterator();
+
+		  int index = 0;
+		  while (sheets.hasNext()){
+			  Sheet sheet=(Sheet) sheets.next();
+			  workbook.setSheetName(index,"数据源"+(index+1));
+			  StringBuilder builder = new StringBuilder();
+			  //获取尺码组
+			  List<SizeTable> sizeGroup = syPreAssembledPackingListItemMapper.querySize(syPreList.get(index).getId(),syPreList.get(index).getGroupId());
+			  for(SizeTable si:sizeGroup){
+				  builder.append(si.getSize());
+				  builder.append("*");
+			  }
+			  //创建列名放在第一行
+			  String[] params =("账套*成衣工厂*预发货日期*款号*小po*分销点*起始箱号*结束箱号*item NO./SKU NO./UPC NO./PACKS CODE*PREACKSKU*"+builder+"颜色*配码规则*计划尺码数量*计划装箱数量*件数/箱*箱数*总件数*净重/箱*毛重/箱*总毛重*外箱长度*外箱宽度*外箱高度*总体积*净净重*单价*总价*备注*发运明细子表ID*发运明细分组ID*发运明细主表ID*订单号*款号*尺码范围*客户*客户简称*申报要素ID").split("\\*");
+			  String[] params1 =syPreList.get(index).toString(builder.toString()).split("\\*");
+			  Row row1 = sheet.createRow(0);
+			  Row row2 = sheet.createRow(1);
+
+			  for (int x=0;x<params.length;x++){
+				  Cell cell = row1.createCell(x);
+				  cell.setCellValue(params[x]);
+
+				  if(x > 9 && x < params.length-27){
+					  Cell cell1 = row2.createCell(x);
+					  cell1.setCellValue(" ");
+				  }else{
+					  Cell cell1 = row2.createCell(x);
+					  cell1.setCellValue(params1[x]);
+
+				  }
+
+			  }
+			  index++;
+		  }
+
+		  ServletOutputStream outputStream = req.getOutputStream();
+		  workbook.write(outputStream);
+
+	  }catch (Exception ex){
+
+		  ex.printStackTrace();
+		  log.error("异常:" + ex.getMessage());
+		  result.error500("异常:" + ex.getMessage());
 	  }
 
-	  ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
-	  mv.addObject(NormalExcelConstants.FILE_NAME, "发运明细");
-	  mv.addObject(NormalExcelConstants.CLASS, SyShippingDetailsVo.class);
-	  mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("发运明细列表", "导出人:admin", "发运明细列表"));
-	  mv.addObject(NormalExcelConstants.DATA_LIST, pageList.getRecords());
-	  return mv;
+	  result.setSuccess(true);
+	  result.setMessage("导出成功!");
+	  result.setResult("导出成功!");
+
+	  return result;
 
   }
 

+ 1 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/entity/SyShippingDetailsItem.java

@@ -442,6 +442,7 @@ public class SyShippingDetailsItem {
         this.rSupplier = orderDataVo.getRSupplier();
         this.rSupplierCode = orderDataVo.getRSupplierCode();
         this.orderDate = orderDataVo.getOrderDate();
+        this.factoryUnitPrice = orderDataVo.getITaxPrice().toString();
 
 	}
 }

+ 207 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/entity/VO/SyPreAssembledPackingListVo.java

@@ -0,0 +1,207 @@
+package org.jeecg.modules.documents.shippingDetails.entity.VO;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.jeecg.modules.spapl.entity.SizeTable;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.List;
+
+
+/**
+ * 导出实体类
+ * 给装箱单导入使用
+ */
+@Data
+public class SyPreAssembledPackingListVo {
+
+    /**账套*/
+    @Excel(name = "账套", width = 15)
+    @ApiModelProperty(value = "账套")
+    private java.lang.String account;
+
+    @Excel(name = "成衣工厂", width = 15)
+    @ApiModelProperty(value = "成衣工厂")
+    private String garmentFactory;
+
+    /**预发货日期*/
+    @Excel(name = "预发货日期", width = 20)
+    @ApiModelProperty(value = "预发货日期")
+    private String preDeliveryDate;
+
+
+    @Excel(name = "款号", width = 15)
+    @ApiModelProperty(value = "款号")
+    private String itemNumber;
+
+    /**小po*/
+    @Excel(name = "小po", width = 15)
+    @ApiModelProperty(value = "小po")
+    private java.lang.String smallPo;
+
+
+    @Excel(name = "分销点", width = 15)
+    @ApiModelProperty(value = "分销点")
+    private String distributionPoint;
+
+    @Excel(name = "起始箱号", width = 15)
+    @ApiModelProperty(value = "起始箱号")
+    private String beginBox;
+
+    @Excel(name = "结束箱号", width = 15)
+    @ApiModelProperty(value = "结束箱号")
+    private String endBox;
+
+    @Excel(name = "item NO./SKU NO./UPC NO./PACKS CODE", width = 15)
+    @ApiModelProperty(value = "item NO./SKU NO./UPC NO./PACKS CODE")
+    private String itemCode;
+
+    @Excel(name = "PREACKSKU", width = 15)
+    @ApiModelProperty(value = "PREACKSKU")
+    private String prepackSku;
+
+    @Excel(name = "颜色", width = 15)
+    @ApiModelProperty(value = "颜色")
+    private String color;
+
+    @Excel(name = "配码规则", width = 15)
+    @ApiModelProperty(value = "配码规则")
+    private String codingRules;
+
+    @Excel(name = "计划尺码数量", width = 15)
+    @ApiModelProperty(value = "计划尺码数量")
+    private String plannedSizeQuantity;
+
+    @Excel(name = "计划装箱数量", width = 15)
+    @ApiModelProperty(value = "计划装箱数量")
+    private String plannedShippingQuantity;
+
+    @Excel(name = "件数/箱", width = 15)
+    @ApiModelProperty(value = "件数/箱")
+    private String piecesBox;
+
+    @Excel(name = "箱数", width = 15)
+    @ApiModelProperty(value = "箱数")
+    private String boxNumber;
+
+    @Excel(name = "总件数", width = 15)
+    @ApiModelProperty(value = "总件数")
+    private String total;
+
+    @Excel(name = "净重/箱", width = 15)
+    @ApiModelProperty(value = "净重/箱")
+    private java.math.BigDecimal netWeight;
+
+    @Excel(name = "毛重/箱", width = 15)
+    @ApiModelProperty(value = "毛重/箱")
+    private java.math.BigDecimal grossWeight;
+
+    /**总毛重*/
+    @Excel(name = "总毛重", width = 15)
+    @ApiModelProperty(value = "总毛重")
+    private java.math.BigDecimal totalGrossWeight;
+
+    @Excel(name = "外箱长度", width = 15)
+    @ApiModelProperty(value = "外箱长度")
+    private java.math.BigDecimal outerBoxLength;
+
+    @Excel(name = "外箱宽度", width = 15)
+    @ApiModelProperty(value = "外箱宽度")
+    private java.math.BigDecimal outerBoxWidth;
+
+    @Excel(name = "外箱高度", width = 15)
+    @ApiModelProperty(value = "外箱高度")
+    private java.math.BigDecimal outerBoxHeight;
+
+    @Excel(name = "总体积", width = 15)
+    @ApiModelProperty(value = "总体积")
+    private java.math.BigDecimal totalVolume;
+
+    @Excel(name = "净净重", width = 15)
+    @ApiModelProperty(value = "净净重")
+    private java.math.BigDecimal netWeightToo;
+
+    @Excel(name = "单价", width = 15)
+    @ApiModelProperty(value = "单价")
+    private String unitPrice;
+
+    @Excel(name = "总价", width = 15)
+    @ApiModelProperty(value = "总价")
+    private java.math.BigDecimal totalPrice;
+
+    @Excel(name = "备注", width = 15)
+    @ApiModelProperty(value = "备注")
+    private Object memo;
+
+    @Excel(name = "发运明细子表ID", width = 15)
+    @ApiModelProperty(value = "发运明细子表ID")
+    private String itemId;
+
+    @Excel(name = "发运明细分组ID", width = 15)
+    @ApiModelProperty(value = "发运明细分组ID")
+    private String groupId;
+
+    @Excel(name = "发运明细主表ID", width = 15)
+    @ApiModelProperty(value = "发运明细主表ID")
+    private String id;
+
+    @Excel(name = "数组", width = 15)
+    @ApiModelProperty(value = "数组")
+    private List<SizeTable> sizeTables;
+
+    //订单号
+    private String orderNumber;
+    //款号
+    private String itemNuber;
+    //尺码范围
+    private String sizeRange;
+    //客户
+    private String customer;
+    //客户简称
+    private String customerAbb;
+   //申报要素ID
+    private String elenmentId;
+
+    //发运明细单据号
+    private String documentNo;
+
+
+    public SyPreAssembledPackingListVo(SyShippingDetailsVo syShippingDetailsVo){
+
+        this.account = syShippingDetailsVo.getAccount();
+        this.garmentFactory = syShippingDetailsVo.getGarmentFactory();
+        this.preDeliveryDate = syShippingDetailsVo.getArrivalDate();
+        this.itemNumber = syShippingDetailsVo.getItemNumber();
+        this.smallPo = syShippingDetailsVo.getSmallPo();
+        this.distributionPoint = syShippingDetailsVo.getDistributionPoint();
+        this.color = syShippingDetailsVo.getColour();
+        this.codingRules = syShippingDetailsVo.getCodingRules();
+        this.plannedShippingQuantity= syShippingDetailsVo.getShipmentQuantity().toString();
+        this.unitPrice = syShippingDetailsVo.getSalesUnitPrice();
+        this.itemId = syShippingDetailsVo.getItemIds();
+        this.groupId = syShippingDetailsVo.getGroupId();
+        this.id = syShippingDetailsVo.getId();
+        this.documentNo = syShippingDetailsVo.getDocumentNo();
+        this.orderNumber = syShippingDetailsVo.getOrderNumber();
+        this.itemNuber = syShippingDetailsVo.getItemNumber();
+        this.customer = syShippingDetailsVo.getCustomer();
+        this.customerAbb = syShippingDetailsVo.getCustomerAbbreviation();
+        this.elenmentId = syShippingDetailsVo.getElementsId();
+
+    }
+
+    public SyPreAssembledPackingListVo(){
+    }
+
+    public String toString(String builder){
+        String fw[] = builder.split("\\*");
+        String fwSplit = fw[0]+"~"+fw[fw.length-1];
+
+        return account+"*"+garmentFactory+"*"+preDeliveryDate+"*"+itemNumber+"*"+smallPo+"*"+distributionPoint+
+                "*"+""+"*"+""+"*"+""+"*"+""+"*"+builder+color+"*"+codingRules+"*"+""+"*"+plannedShippingQuantity+
+                "*"+""+"*"+""+"*"+""+"*"+""+"*"+""+"*"+""+"*"+""+"*"+""+"*"+""+"*"+""+"*"+""+"*"+unitPrice+
+                "*"+""+"*"+""+"*"+itemId+"*"+groupId+"*"+id+"*"+orderNumber+"*"+itemNuber+"*"+fwSplit+"*"+customer+"*"+customerAbb+"*"+elenmentId;
+    }
+}

+ 13 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/entity/VO/SyShippingDetailsVo.java

@@ -4,9 +4,12 @@ package org.jeecg.modules.documents.shippingDetails.entity.VO;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
+import org.jeecg.modules.spapl.entity.SizeTable;
 import org.jeecgframework.poi.excel.annotation.Excel;
 import org.springframework.format.annotation.DateTimeFormat;
 
+import java.util.List;
+
 @Data
 public class SyShippingDetailsVo {
 
@@ -82,8 +85,6 @@ public class SyShippingDetailsVo {
 
     /**预发货日期*/
     @Excel(name = "预发货日期", width = 20, format = "yyyy-MM-dd")
-    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
-    @DateTimeFormat(pattern="yyyy-MM-dd")
     @ApiModelProperty(value = "预发货日期")
     private java.util.Date preDeliveryDate;
 
@@ -284,4 +285,14 @@ public class SyShippingDetailsVo {
     @Excel(name = "制单人", width = 15)
     @ApiModelProperty(value = "制单人")
     private java.lang.String createBy;
+
+    @Excel(name = "配码规则", width = 15)
+    @ApiModelProperty(value = "配码规则")
+    private  String codingRules;
+    @Excel(name = "颜色", width = 15)
+    @ApiModelProperty(value = "颜色")
+    private String colour;
+
+    @ApiModelProperty(value = "二维表格")
+    private List<SizeTable> sizeTables;
 }

+ 5 - 4
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/mapper/SyShippingDetailsMapper.java

@@ -7,10 +7,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.apache.ibatis.annotations.Param;
 import org.jeecg.modules.documents.shippingDetails.entity.SyShippingDetails;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.jeecg.modules.documents.shippingDetails.entity.VO.OrderDataVo;
-import org.jeecg.modules.documents.shippingDetails.entity.VO.PushShippingDeialVo;
-import org.jeecg.modules.documents.shippingDetails.entity.VO.PushShippingVO;
-import org.jeecg.modules.documents.shippingDetails.entity.VO.SyShippingDetailsVo;
+import org.jeecg.modules.documents.shippingDetails.entity.VO.*;
 
 /**
  * @Description: 发运明细主表
@@ -55,4 +52,8 @@ public interface SyShippingDetailsMapper extends BaseMapper<SyShippingDetails> {
 
     //批量提交/取消提交
     public int batchSubmission(@Param("submitListId") List<String> submitListId,@Param("type") String type);
+
+    //查询其他发运明细(维护报关要素,其他所有一样的条件全部更新掉)
+    public List<SyShippingDetailsVo> queryAllsyShippingDeial(@Param("itemNumber") String itemNumber,@Param("inventoryName") String inventoryName,@Param("ompoAccount") String ompoAccount);
+
 }

+ 19 - 9
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/mapper/xml/SyShippingDetailsMapper.xml

@@ -53,7 +53,7 @@
 <select id="queryShippingDetails" resultType="org.jeecg.modules.documents.shippingDetails.entity.VO.SyShippingDetailsVo">
     select t.* from(select b.is_reference as isReference,a.id as id,GROUP_CONCAT(b.id) as itemIds,a.document_no as documentNo,a.document_date as documentDate,b.order_number as orderNumber,a.push_state,b.submit_status as submitStatus,
     b.customer_abbreviation as customerAbbreviation,b.sales_department as salesDepartment,b.salesman as salesman,a.customer as customer,b.specification_and_model as specificationAndModel,
-    b.small_po as smallPo,b.pack_id as packId,b.pre_delivery_date as preDeliveryDate,b.order_date as orderDate,
+    b.small_po as smallPo,b.pack_id as packId,b.pre_delivery_date as preDeliveryDate,b.order_date as orderDate,b.inventory_ccode as inventoryCcode,
     sum(b.shipment_quantity) as shipmentQuantity,b.customs_declaration_unit_price as customsDeclarationUnitPrice,b.order_quantity as orderQuantity,
     b.is_tc as isTc,b.distribution_point as distributionPoint,b.item_number as itemNumber,b.business_type_text as businessTypeText,
     b.arrival_date as arrivalDate,b.inventory_name as inventoryName,b.sales_unit_price as salesUnitPrice,b.order_remaining_quantity as orderRemainingQuantity,
@@ -63,7 +63,7 @@
     b.order_remarks as orderRemarks,b.price_remarks as priceRemarks,b.order_change_description as orderChangeDescription,b.pre_completion_date as preCompletionDate,
     b.sales_type_text as salesTypeText,b.customer_name as customerName,b.exchange_rate as exchangeRate,a.whole_order_total as wholeOrderTotal,
     b.declaration_elements as declarationElements,b.number_of_sets as numberOfSets,a.chinese_name as chineseName,b.account as account,b.supplier as supplier,
-    b.garment_factory as garmentFactory,b.elements_id as elementsId,
+    b.garment_factory as garmentFactory,b.elements_id as elementsId,b.coding_rules as codingRules,b.colour as colour,b.group_id as groupId,
      c.declaration_name as declarationName,c.hs_code as hsCode,c.english_product_name as englishProductName
      from sy_shipping_details a
 left join sy_shipping_details_item b
@@ -71,18 +71,16 @@ on a.id = b.shipping_details_id and b.del_flag = 0
 left join sy_declaration_elements c
 on b.elements_id = c.id
 where a.del_flag = 0
-  AND b.inventory_ccode like '19%'
-
 GROUP BY b.group_id
  order by a.create_time desc) as t
-${ew.customSqlSegment}
+${ew.customSqlSegment} and  t.inventoryCcode LIKE '19%'
 
 </select>
 
     <select id="queryShippingDetailsGarment" resultType="org.jeecg.modules.documents.shippingDetails.entity.VO.SyShippingDetailsVo">
     select t.* from(select b.is_reference as isReference,a.id as id,GROUP_CONCAT(b.id) as itemIds,a.document_no as documentNo,a.document_date as documentDate,b.order_number as orderNumber,a.push_state,b.submit_status as submitStatus,
     b.customer_abbreviation as customerAbbreviation,b.sales_department as salesDepartment,b.salesman as salesman,a.customer as customer,b.specification_and_model as specificationAndModel,
-    b.small_po as smallPo,b.pack_id as packId,b.pre_delivery_date as preDeliveryDate,b.order_date as orderDate,
+    b.small_po as smallPo,b.pack_id as packId,b.pre_delivery_date as preDeliveryDate,b.order_date as orderDate,b.inventory_ccode as inventoryCcode,
     sum(b.shipment_quantity) as shipmentQuantity,b.customs_declaration_unit_price as customsDeclarationUnitPrice,b.order_quantity as orderQuantity,
     b.is_tc as isTc,b.distribution_point as distributionPoint,b.item_number as itemNumber,b.business_type_text as businessTypeText,
     b.arrival_date as arrivalDate,b.inventory_name as inventoryName,b.sales_unit_price as salesUnitPrice,b.order_remaining_quantity as orderRemainingQuantity,
@@ -92,17 +90,17 @@ ${ew.customSqlSegment}
     b.order_remarks as orderRemarks,b.price_remarks as priceRemarks,b.order_change_description as orderChangeDescription,b.pre_completion_date as preCompletionDate,
     b.sales_type_text as salesTypeText,b.customer_name as customerName,b.exchange_rate as exchangeRate,a.whole_order_total as wholeOrderTotal,
     b.declaration_elements as declarationElements,b.number_of_sets as numberOfSets,a.chinese_name as chineseName,b.account as account,b.supplier as supplier,
-    b.garment_factory as garmentFactory,b.elements_id as elementsId,
+    b.garment_factory as garmentFactory,b.elements_id as elementsId,b.coding_rules as codingRules,b.colour as colour,b.group_id as groupId,
      c.declaration_name as declarationName,c.hs_code as hsCode,c.english_product_name as englishProductName
      from sy_shipping_details a
 left join sy_shipping_details_item b
 on a.id = b.shipping_details_id and b.del_flag = 0
 left join sy_declaration_elements c
 on b.elements_id = c.id
-  AND b.inventory_ccode not like '19%'
+where a.del_flag = 0
 GROUP BY b.group_id
  order by a.create_time desc) as t
-${ew.customSqlSegment}
+${ew.customSqlSegment} and  t.inventoryCcode not LIKE '19%'
 
 </select>
     
@@ -221,4 +219,16 @@ ${ew.customSqlSegment}
 
     </update>
 
+
+    <select id="queryAllsyShippingDeial" resultType="org.jeecg.modules.documents.shippingDetails.entity.VO.SyShippingDetailsVo">
+
+        select b.id as itemIds from sy_shipping_details a
+        left join sy_shipping_details_item b
+        on a.id = b.shipping_details_id
+        where a.del_flag = 0 and b.del_flag = 0 and b.item_number = #{itemNumber}
+        and b.inventory_name = #{inventoryName} and b.ompo_account = #{ompoAccount}
+        and a.push_state != '1'
+
+    </select>
+
 </mapper>

+ 3 - 4
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/service/ISyShippingDetailsService.java

@@ -7,10 +7,7 @@ import org.jeecg.modules.documents.orderData.entity.SyOrderData;
 import org.jeecg.modules.documents.seclarationElements.entity.SyDeclarationElements;
 import org.jeecg.modules.documents.shippingDetails.entity.SyShippingDetails;
 import com.baomidou.mybatisplus.extension.service.IService;
-import org.jeecg.modules.documents.shippingDetails.entity.VO.OrderDataVo;
-import org.jeecg.modules.documents.shippingDetails.entity.VO.PushShippingDeialVo;
-import org.jeecg.modules.documents.shippingDetails.entity.VO.PushShippingVO;
-import org.jeecg.modules.documents.shippingDetails.entity.VO.SyShippingDetailsVo;
+import org.jeecg.modules.documents.shippingDetails.entity.VO.*;
 
 import java.text.ParseException;
 import java.util.List;
@@ -62,4 +59,6 @@ public interface ISyShippingDetailsService extends IService<SyShippingDetails> {
 
     //批量提交/取消提交
     public int batchSubmission(List<String> submitListId,String type);
+
+
 }

+ 9 - 4
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/service/impl/SyShippingDetailsServiceImpl.java

@@ -140,7 +140,7 @@ public class SyShippingDetailsServiceImpl extends ServiceImpl<SyShippingDetailsM
                 entity.setShippingDetailsId(id);
                 entity.setId(oConvertUtils.id());
                 sort++;
-                //设置报关单价 = 销售单价-佣金
+                //设置报关单价 = 含税单价-佣金
                 BigDecimal yj = li.getYmoney();
                 if(oConvertUtils.isEmpty(yj)){
                     yj = BigDecimal.ZERO;
@@ -148,7 +148,7 @@ public class SyShippingDetailsServiceImpl extends ServiceImpl<SyShippingDetailsM
                 if(oConvertUtils.isEmpty(li.getITaxPrice())){
                     li.setITaxPrice(BigDecimal.ZERO);
                 }
-                BigDecimal customsDeclarationUnitPrice = li.getITaxPrice().subtract(yj);
+                BigDecimal customsDeclarationUnitPrice = li.getUnitPriceIncludingTax().subtract(yj);
                 entity.setCustomsDeclarationUnitPrice(customsDeclarationUnitPrice);
 
                 //获取报关要素ID
@@ -166,6 +166,13 @@ public class SyShippingDetailsServiceImpl extends ServiceImpl<SyShippingDetailsM
                 syShippingDetailsItemList.add(entity);
                 //设置主表客户
                 syShippingDetails.setCustomer(li.getCustomerName());
+
+                //回写订单剩余数量
+                //查询订单子表信息
+                SyOrderDataItem orderDataItem = syOrderDataItemService.getById(li.getSyOrderDataItemId());
+                //直接设置为0,因为参照直接生成单据,数量不能更改,所以剩余数量会全部参照完
+                orderDataItem.setSurplusNum(BigDecimal.ZERO);
+                syOrderDataItemService.updateById(orderDataItem);
             }
 
         }
@@ -174,8 +181,6 @@ public class SyShippingDetailsServiceImpl extends ServiceImpl<SyShippingDetailsM
 
              }
 
-
-
         boolean ok = save(syShippingDetails);
         if(ok){
             return syShippingDetails;

+ 0 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/syShippingOrder/controller/SyShippingOrderController.java

@@ -640,8 +640,6 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
 			 }
 			 else if(testName.equals("报关信息-申报要素-成衣")){
 
-				 List<Map<String, Object>> listMap1 = new ArrayList<Map<String, Object>>();
-
 				 TemplateExportParams params = new TemplateExportParams("D:\\单证模板\\"+testName+".xlsx");
 
 				 QueryWrapper<SyShippingOrderItem> queryWrapper = new QueryWrapper<>();

+ 3 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/syShippingOrder/entity/SyShippingOrder.java

@@ -235,6 +235,9 @@ public class SyShippingOrder {
 	@TableField(exist = false)
 	private List<String> ids;
 
+	//成衣工厂
+	private String garmentFactory;
+
 	//运输方式
 	private String typeOfShipping;
 

+ 3 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/syShippingOrder/mapper/xml/SyShippingOrderMapper.xml

@@ -4,7 +4,7 @@
 
     <select id="syShippingOrderPageList" resultType="org.jeecg.modules.documents.syShippingOrder.entity.SyShippingOrder">
   select a.id,a.shipping_order_number as shippingOrderNumber,b.order_number as orderNumber,a.export_invoice_no as exportInvoiceNo,
-  b.distribution_point as distributionPoint,a.unit_in_operation as unitInOperation,a.box_number as boxNumber,
+  b.distribution_point as distributionPoint,a.unit_in_operation as unitInOperation,a.box_number as boxNumber,b.garment_factory as garmentFactory,
   sum(b.gross_weight) as totalGrossWeight,sum(b.volume) as totalVolume,b.box_number as planQuantity,b.client_abbreviation as clientAbbreviation,
   a.money,a.the_actual_shipping_date as theActualShippingDate,a.exchange_earnings_text as exchangeEarningsText,
   a.consignee,a.bill_of_lading_or_carriage_receipt as billOfLadingOrCarriageReceipt,a.the_final_shipping_date as theFinalShippingDate,
@@ -42,8 +42,8 @@ c.english_product_name as englishProductName,'成衣' as readyFabric,b.supplier
   select a.id as id ,GROUP_CONCAT(b.id) as itemId,a.document_No as documentNo,a.create_by as createBy,
   a.export_invoice_no as exportInvoiceNo,a.container_number as containerNumber,a.garment_Factory as garmentFactory,
   b.supplier as supplier,a.plumbum_No as plumbumNo,a.customer_abbreviation as customerAbbreviation,
-  case when b.u8_Pid is null then sum(b.inventory_quantity) else sum(b.gross_weight) end as Total,b.inventory_quantity as number,
-   case when b.u8_Pid is null then '0' else sum(b.rolls) end as planQuantity,
+  case when b.u8_Pid is null then sum(b.actual_declared_quantity) else sum(b.gross_weight) end as Total,b.actual_declared_quantity as number,
+   sum(b.rolls) as planQuantity,
   b.item_Number as itemNumber,b.small_Po as smallPo,sum(b.gross_weight) as grossWeight,
   sum(b.net_weight) as netWeight,'0' as totalVolume,b.distribution_Point as distributionPoint,
   a.container_Code as containerCode,b.price,b.total_Price as totalPrice,b.pre_Delivery_Date as preDeliveryDate,

+ 3 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/syShippingOrder/service/impl/SyShippingOrderServiceImpl.java

@@ -187,7 +187,9 @@ public class SyShippingOrderServiceImpl extends ServiceImpl<SyShippingOrderMappe
                         syShippingOrderItem.setVolume(BigDecimal.ZERO);
                         totalVolume.add(BigDecimal.ZERO);
                         syShippingOrderItem.setDistributionPoint(itemli.getDistributionPoint());
-                        syShippingOrderItem.setUnitPrice(itemli.getPrice());
+                        //单价 = 总金额/净重
+                        BigDecimal price = itemli.getTotalPrice().divide(itemli.getNetWeight(),4,BigDecimal.ROUND_DOWN);
+                        syShippingOrderItem.setUnitPrice(price);
                         syShippingOrderItem.setPreShipmentDate(itemli.getPreDeliveryDate());
                         syShippingOrderItem.setSalesman(itemli.getSalesman());
                         syShippingOrderItem.setOperatingDepartment(itemli.getSalesDepartment());

+ 22 - 16
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/controller/PurchaseWarehousingController.java

@@ -186,6 +186,9 @@ public class PurchaseWarehousingController extends JeecgController<PurchaseWareh
               List<Map<String,Object>> mapListTwo=new ArrayList<>();
               //账套3
               List<Map<String,Object>> mapListThree=new ArrayList<>();
+              String accidOne = "";
+              String accidTwo = "";
+              String accidThree = "";
               for(int i=0;i<json.size();i++){
                   //获取对象
                   JSONObject jsonObject=json.getJSONObject(i);
@@ -194,40 +197,43 @@ public class PurchaseWarehousingController extends JeecgController<PurchaseWareh
                   //转map
                   Map<String,Object> map=updateMap(jsonObject);
                   if(cAccId.equals("901")){
+					  accidOne = cAccId;
                       mapListOne.add(map);
 					  boo = true;
                   }else if(cAccId.equals("902")){
                       mapListTwo.add(map);
+					  accidTwo = cAccId;
 					  boo = true;
                   }else if(cAccId.equals("903")){
                       mapListThree.add(map);
+					  accidThree = cAccId;
 					  boo = true;
                   }
               }
               if(mapListOne.size()>0){
 				  //获取账套
-				  String caccId=sysDictService.queryDictTextByKey("cAccID", "1");
-				  if(StringUtils.isNotBlank(caccId)){
-					  result.error500("未获取到账套");
-				  }
-                  purchaseWarehousingService.savaOne(mapListOne,caccId);
+//				  String caccId=sysDictService.queryDictTextByKey("cAccID", "1");
+//				  if(StringUtils.isNotBlank(caccId)){
+//					  result.error500("未获取到账套");
+//				  }
+                  purchaseWarehousingService.savaOne(mapListOne,accidOne);
               }
               if(mapListTwo.size()>0){
 				  //获取账套
-				  String caccId=sysDictService.queryDictTextByKey("cAccID", "2");
-				  if(StringUtils.isNotBlank(caccId)){
-					  result.error500("未获取到账套");
-				  }
-                  purchaseWarehousingService.savaTwo(mapListTwo,caccId);
+//				  String caccId=sysDictService.queryDictTextByKey("cAccID", "2");
+//				  if(StringUtils.isNotBlank(caccId)){
+//					  result.error500("未获取到账套");
+//				  }
+                  purchaseWarehousingService.savaTwo(mapListTwo,accidTwo);
               }
               if(mapListThree.size()>0){
 				  //获取账套
-				  String caccId=sysDictService.queryDictTextByKey("cAccID", "3");
-
-				  if(StringUtils.isNotBlank(caccId)){
-					  result.error500("未获取到账套");
-				  }
-                  purchaseWarehousingService.savaThree(mapListThree,caccId);
+//				  String caccId=sysDictService.queryDictTextByKey("cAccID", "3");
+//
+//				  if(StringUtils.isNotBlank(caccId)){
+//					  result.error500("未获取到账套");
+//				  }
+                  purchaseWarehousingService.savaThree(mapListThree,accidThree);
               }
               if(boo == false){
               	  result.setSuccess(false);

+ 2 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/service/impl/PurchaseWarehousingServiceImpl.java

@@ -397,7 +397,9 @@ public class PurchaseWarehousingServiceImpl extends ServiceImpl<PurchaseWarehous
                     }
                 }else{
                     //失败
+                    log.info(resturn.getJSONObject(0).get("Description")+"");
                     throw new RuntimeException(resturn.getJSONObject(0).get("Description")+"");
+
                 }
 
             }