瀏覽代碼

修改成衣excel导入和单据流水号

huxy 1 年之前
父節點
當前提交
08fc301a04

+ 3 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/spapl/controller/SyPreAssembledPackingListController.java

@@ -175,7 +175,7 @@ public class SyPreAssembledPackingListController extends JeecgController<SyPreAs
     @GetMapping(value = "/list3")
     public Result<IPage<SyShippingDetailsVo>> queryPageList3(
             String documentNo,
-            String customer,
+            String clientAbbreviation,
             String salesman,
             String garmentFactory,
             String distributionPoint,
@@ -193,8 +193,8 @@ public class SyPreAssembledPackingListController extends JeecgController<SyPreAs
         if(oConvertUtils.isNotEmpty(documentNo)) {
             queryWrapper.like("t.documentNo", documentNo);//单据号
         }
-        if(oConvertUtils.isNotEmpty(customer)){//客户
-            queryWrapper.like("t.customer_Abbreviation",customer);
+        if(oConvertUtils.isNotEmpty(clientAbbreviation)){//客户
+            queryWrapper.like("t.customer_Abbreviation",clientAbbreviation);
         }
         if(oConvertUtils.isNotEmpty(distributionPoint)){//分销点
             queryWrapper.like("t.distributionPoint",distributionPoint);

+ 4 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/spapl/service/impl/SyPreAssembledPackingListServiceImpl.java

@@ -210,7 +210,7 @@ public class SyPreAssembledPackingListServiceImpl extends ServiceImpl<SyPreAssem
 	public synchronized SyPreAssembledPackingList saveMain2(SyPreAssembledPackingList syPreAssembledPackingList) {
 		List<SyPreAssembledPackingListItem> items=syPreAssembledPackingList.getSyPreAssembledPackingListItemList();
 
-		SimpleDateFormat sf = new SimpleDateFormat("yyyyMMddHHmmsss");
+		SimpleDateFormat sf = new SimpleDateFormat("yyMMddHHmmssSSS");
 
 		/*SimpleDateFormat sf= new SimpleDateFormat("yyyyMMdd");
 		QueryWrapper<SyPreAssembledPackingList> queryWrapperCount=new QueryWrapper<>();
@@ -515,6 +515,8 @@ public class SyPreAssembledPackingListServiceImpl extends ServiceImpl<SyPreAssem
 		return syLetterDepositItem;
 	}
 
+
+
 	@Override
 	@Transactional
 	public boolean add(List<SyPreAssembledPackingList> items1) {
@@ -522,7 +524,7 @@ public class SyPreAssembledPackingListServiceImpl extends ServiceImpl<SyPreAssem
 		try{
 
 			for(SyPreAssembledPackingList syPreAssembledPackingList : items1){
-				SimpleDateFormat sf = new SimpleDateFormat("yyyyMMddHHmmsss");
+				SimpleDateFormat sf = new SimpleDateFormat("yyMMddHHmmssSSS");
 				String dateNo ="YCY"+sf.format(System.currentTimeMillis()) ;
 				syPreAssembledPackingList.setDocumentNo(dateNo);//订单号-->单据号
 				syPreAssembledPackingList.setDelFlag("0");//删除状态默认为0

+ 3 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splfi/service/impl/SyPackingListFabricServiceImpl.java

@@ -97,7 +97,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 	@Override
 	@Transactional
 	public synchronized SyPackingListFabric saveMain(SyPackingListFabric syPackingListFabric) {
-		SimpleDateFormat sf = new SimpleDateFormat("yyyyMMddHHmmsss");
+		SimpleDateFormat sf = new SimpleDateFormat("yyMMddHHmmssSSS");
 		String dateNo ="ML"+sf.format(System.currentTimeMillis());//获取单据号
 		syPackingListFabric.setDelFlag("0");
 		syPackingListFabric.setStatus("0");
@@ -454,7 +454,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 	public void saveList(List<SyPackingListFabric> syPackingListTailorings) {
 		for (SyPackingListFabric syPackingListFabric : syPackingListTailorings){
 			syPackingListFabric.setId(null);
-			SimpleDateFormat sf = new SimpleDateFormat("yyyyMMddHHmmsss");
+			SimpleDateFormat sf = new SimpleDateFormat("yyMMddHHmmssSSS");
 			/*SimpleDateFormat sf= new SimpleDateFormat("yyMMdd");
 			QueryWrapper<SyPackingListFabric> queryWrapperCount=new QueryWrapper<>();
 			queryWrapperCount.like("create_time", new SimpleDateFormat("yyyy-MM-dd").format(System.currentTimeMillis()));
@@ -564,7 +564,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 		boolean bool=false;
 		try{
 			for (String str : maps.keySet()){
-				SimpleDateFormat sf = new SimpleDateFormat("yyyyMMddHHmmsss");
+				SimpleDateFormat sf = new SimpleDateFormat("yyMMddHHmmssSSS");
 				String dateNo ="ML"+sf.format(System.currentTimeMillis());//获取单据号
 				SyPackingListFabric syPackingListFabric =maps.get(str);
 				//syPackingListFabric.setGarmentFactory(str);//成衣工厂

+ 2 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splt/controller/SyPackingListTailoringController.java

@@ -62,6 +62,7 @@ import org.jeecg.modules.splt.service.ISyPackingListTailoringItemService;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.servlet.ModelAndView;
 import org.springframework.web.multipart.MultipartFile;
@@ -187,6 +188,7 @@ public class SyPackingListTailoringController {
 	 @AutoLog(value = "预装箱单批量生成数据")
 	 @ApiOperation(value="预装箱单批量生成数据", notes="预装箱单批量生成数据")
 	 @GetMapping(value = "/querySpaplId2")
+	 @Transactional
 	 public Result<?> querySpaplId2(String[] ids) {
 		 Result<SyPackingListTailoring> result=new Result<>();
 		 if(oConvertUtils.isEmpty(ids)){

+ 2 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splt/entity/SyPackingListTailoringItem.java

@@ -347,7 +347,7 @@ public class SyPackingListTailoringItem implements Serializable {
 			grossWeight=new BigDecimal(params1[11]);
 			netWeightToo=new BigDecimal(params1[12].length()==0?"0":params1[12]);
 			syPreAssembledPackingListId=params1[13];
-			boxNumber=new BigDecimal(Integer.parseInt(endCaseNumber)-Integer.parseInt(startingBoxNumber)+1);//箱数
+			boxNumber=new BigDecimal(Double.parseDouble(endCaseNumber)-Double.parseDouble(startingBoxNumber)+1);//箱数
 			sizeTables=new ArrayList<>();
 			String planSize="";
 			int piecesBox=0;
@@ -356,7 +356,7 @@ public class SyPackingListTailoringItem implements Serializable {
 				sizeTable.setSize(params3[i]);//尺码
 				int box=0;
 				if(isNumeric(params2[i])){
-					box=Integer.parseInt(params2[i]);
+					box=new BigDecimal(params2[i]).intValue();
 				}
 				piecesBox+=box;
 				sizeTable.setProportion(box);//比例

+ 11 - 4
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splt/service/impl/SyPackingListTailoringServiceImpl.java

@@ -106,7 +106,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 
 	//获取流水号
 	String randomStr(){
-		SimpleDateFormat sf = new SimpleDateFormat("yyyyMMddHHmmsss");
+		SimpleDateFormat sf = new SimpleDateFormat("yyMMddHHmmssSSS");
 		/*SimpleDateFormat sf= new SimpleDateFormat("yyyyMMdd");
 		QueryWrapper<SyPackingListTailoring> queryWrapperCount=new QueryWrapper<>();
 		queryWrapperCount.like("create_time", new SimpleDateFormat("yyyy-MM-dd").format(System.currentTimeMillis()));
@@ -115,7 +115,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 	}
 
 	@Override
-	@Transactional
+	//@Transactional
 	public synchronized SyPackingListTailoring saveMain2(SyPackingListTailoring syPackingListTailoring){
 		List<SyPackingListTailoringItem> items=syPackingListTailoring.getSyPackingListTailoringItemList();
 		//SyPackingListTailoring.setDocumentNo(oConvertUtils.id());//随机单据号
@@ -556,6 +556,9 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 					BigDecimal boxNumber1=item.getBoxNumber();//获取箱数
 					item.setGroupId(oConvertUtils.id());//分组随机idv1
 					item.setDelFlag("0");//默认为未删除
+					if(item.getTotal()==null){
+						item.setTotal(new BigDecimal("0"));
+					}
 					syPackingListTailoring.setTotal(syPackingListTailoring.getTotal().add(item.getTotal()));
 					item.setSmallPo(syPackingListTailoring.getSmallPo());
 					item.setPoNo(syPackingListTailoring.getSmallPo());
@@ -638,7 +641,11 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 			BigDecimal total2=new BigDecimal("0");
 			BigDecimal total3=new BigDecimal("0");
 			for (SyPackingListTailoringItem item :main.getSyPackingListTailoringItemList()){
-				total3=total3.add(item.getTotal());
+				if(item.getTotal()!=null){
+					total3=total3.add(item.getTotal());
+				}else{
+					total3=total3.add(new BigDecimal("0"));
+				}
 				String ids="";
 				for (SizeTable size : item.getSizeTables()){
 					ids+=size.getItemId()+",";//获取出运明细子表id
@@ -661,7 +668,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 					queryWrapper.eq("del_Flag","0");//未删除
 					SyPackingListTailoringItem syPackingItem=syPackingListTailoringItemMapper.selectOne(queryWrapper);
 					if(syPackingItem!=null){
-						//throw new JeecgBootException("该单据已被成衣参照!请勿重复操作");
+						throw new JeecgBootException("该单据已被成衣参照!请勿重复操作");
 					}
 				}
 			}