Browse Source

添加节点类型、标签等

master
陈裕财 4 years ago
parent
commit
81185d938e
  1. 4
      xm-core/src/main/java/com/xm/core/ctrl/XmIterationController.java
  2. 14
      xm-core/src/main/java/com/xm/core/service/XmIterationService.java
  3. 6
      xm-core/src/main/java/com/xm/core/service/XmProductService.java
  4. 6
      xm-core/src/main/java/com/xm/core/service/XmProjectService.java

4
xm-core/src/main/java/com/xm/core/ctrl/XmIterationController.java

@ -163,14 +163,12 @@ public class XmIterationController {
Map<String,Object> m = new HashMap<>();
Tips tips=new Tips("成功新增一条数据");
try{
if(StringUtils.isEmpty(xmIteration.getId())) {
xmIteration.setId(xmIterationService.createKey("id"));
}
XmIteration q=new XmIteration();
User user= LoginUtils.getCurrentUserInfo();
q.setBranchId(user.getBranchId());
Long count=this.xmIterationService.countByWhere(q);
xmIteration.setId(this.xmIterationService.createIterationId(count));
xmIteration.setSeqNo(Long.toString(count+1));
xmIteration.setCtime(new Date());
xmIteration.setCuserid(user.getUserid());

14
xm-core/src/main/java/com/xm/core/service/XmIterationService.java

@ -4,6 +4,7 @@ import com.mdp.core.entity.Tips;
import com.mdp.core.service.BaseService;
import com.mdp.safe.client.entity.User;
import com.xm.core.entity.XmIteration;
import com.xm.core.entity.XmProduct;
import com.xm.core.entity.XmProject;
import com.xm.core.vo.XmIterationVo;
import org.springframework.beans.factory.annotation.Autowired;
@ -51,5 +52,18 @@ public class XmIterationService extends BaseService {
this.xmIterationLinkService.batchInsert(xmIteration.getLinks());
}
public String createIterationId( Long count){
String seq=(count%10000+1)+"";
int preLength=4-seq.length();
if(preLength>0){
for (int i = 0; i < preLength; i++) {
seq="0"+seq;
}
}
String code=sequenceService.getCommonNo("IT{date:yyyy}-"+seq+"-{rands:4}");
return code;
}
}

6
xm-core/src/main/java/com/xm/core/service/XmProductService.java

@ -258,15 +258,15 @@ public class XmProductService extends BaseService {
XmProduct product=new XmProduct();
product.setBranchId(branchId);
long count=this.countByWhere(product);
String seq=(count+1)+"";
int preLength=6-seq.length();
String seq=(count%10000+1)+"";
int preLength=4-seq.length();
if(preLength>0){
for (int i = 0; i < preLength; i++) {
seq="0"+seq;
}
}
String code=sequenceService.getCommonNo("pro-{date:yyyyMMdd}-"+seq+"-{rand:2}");
String code=sequenceService.getCommonNo("PD{date:yyyy}-"+seq+"-{rands:2}");
return code;
}

6
xm-core/src/main/java/com/xm/core/service/XmProjectService.java

@ -296,15 +296,15 @@ public class XmProjectService extends BaseService {
XmProject projectQ=new XmProject();
projectQ.setBranchId(branchId);
long count=this.countByWhere(projectQ);
String seq=(count+1)+"";
int preLength=6-seq.length();
String seq=(count%10000+1)+"";
int preLength=4-seq.length();
if(preLength>0){
for (int i = 0; i < preLength; i++) {
seq="0"+seq;
}
}
String code=sequenceService.getCommonNo("prj-{date:yyyyMMdd}-"+seq+"-{rand:2}");
String code=sequenceService.getCommonNo("PJ{date:yyyy}-"+seq+"-{rands:2}");
return code;
}

Loading…
Cancel
Save