jihs 4 jaren geleden
bovenliggende
commit
5c32434531

+ 2 - 0
src/main/java/org/jeecg/modules/prowork/entity/ProWorkLogicContent.java

@@ -54,6 +54,8 @@ public class ProWorkLogicContent implements Serializable {
 	private String delFlag;
 	@ApiModelProperty("组织")
 	private String pkOrg;
+	@ApiModelProperty("排序")
+	private Integer sort;
 
 	public ProWorkLogicContent() {
 	}

+ 5 - 1
src/main/java/org/jeecg/modules/prowork/service/impl/ProWorkLogicServiceImpl.java

@@ -52,9 +52,11 @@ public class ProWorkLogicServiceImpl extends ServiceImpl<ProWorkLogicMapper, Pro
         proWorkLogic.setBillcode(nextSerial.getContent());
         save(proWorkLogic);
         //添加子表
+        int sort = 1;
         for(ProWorkLogicContentAddReqDTO detail : reqDTO.getDetailList()){
             detail.setLogicId(proWorkLogic.getId());
             ProWorkLogicContent proWorkLogicContent =  new ProWorkLogicContent(detail);
+            proWorkLogicContent.setSort(sort++);
             proWorkLogicContentService.save(proWorkLogicContent);
         }
     }
@@ -69,9 +71,11 @@ public class ProWorkLogicServiceImpl extends ServiceImpl<ProWorkLogicMapper, Pro
         //删除子表
         deletChildren(reqDTO.getId());
         //添加子表
+        int sort = 1;
         for(ProWorkLogicContentAddReqDTO detail : reqDTO.getDetailList()){
             detail.setLogicId(proWorkLogic.getId());
             ProWorkLogicContent proWorkLogicContent =  new ProWorkLogicContent(detail);
+            proWorkLogicContent.setSort(sort++);
             proWorkLogicContentService.save(proWorkLogicContent);
         }
         return true;
@@ -100,7 +104,7 @@ public class ProWorkLogicServiceImpl extends ServiceImpl<ProWorkLogicMapper, Pro
         QueryWrapper<ProWorkLogicContent> queryWrapper = new QueryWrapper();
         queryWrapper.eq("del_flag", "0");
         queryWrapper.eq("logic_id", id);
-        queryWrapper.orderByAsc("create_time");
+        queryWrapper.orderByAsc("sort");
         List<ProWorkLogicContent> list = proWorkLogicContentService.list(queryWrapper);
         List<ProWorkLogicContentListRespDTO> contentListRespDTOS = Lists.newArrayList();
         for(ProWorkLogicContent proWorkLogicContent : list){