|
|
@@ -1,6 +1,8 @@
|
|
|
package com.goafanti.order.service.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
+import com.fasterxml.jackson.core.JsonProcessingException;
|
|
|
+import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import com.goafanti.admin.service.DepartmentService;
|
|
|
import com.goafanti.business.bo.InputRestrictProject;
|
|
|
import com.goafanti.common.bo.Error;
|
|
|
@@ -148,7 +150,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
|
|
|
@Override
|
|
|
@Transactional
|
|
|
public int updateProjectDistribution(Integer taskId, String taskReceiverId,String remarks,Integer type) {
|
|
|
- TOrderTask t=tOrderTaskMapper.selectByPrimaryKey(taskId);
|
|
|
+ TOrderTask t=tOrderTaskMapper.queryById(taskId);
|
|
|
TOrderNew tn=checkDeleteSign(t.getOrderNo());
|
|
|
Date date=new Date();
|
|
|
t.setTaskStatus(TaskState.DISTRIBUTION.getCode());
|
|
|
@@ -172,7 +174,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
|
|
|
//处理客户已派项目
|
|
|
projectDistributionPushUserMid(tn);
|
|
|
//处理限定项目状态
|
|
|
- BusinessProject businessProject = businessProjectMapper.selectByPrimaryKey(t.getCommodityId());
|
|
|
+ BusinessProject businessProject = businessProjectMapper.queryById(t.getCommodityId());
|
|
|
if (businessProject.getRestrictStatus()==1){
|
|
|
RestrictProject use = restrictProjectMapper.selectByParam(new InputRestrictProject(tn.getBuyerId(), null, t.getCommodityId()));
|
|
|
if (use!=null){
|
|
|
@@ -214,7 +216,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
|
|
|
t.setManagerId(taskReceiverId);
|
|
|
}
|
|
|
t.setReceiverName(a.getName());
|
|
|
- tOrderTaskMapper.updateByPrimaryKey(t);
|
|
|
+ tOrderTaskMapper.update(t);
|
|
|
List<String> aids = new ArrayList<>();
|
|
|
aids.add(taskReceiverId);
|
|
|
TOrderNewBo order = tOrderNewMapper.getSaleIdByOno(t.getOrderNo());
|
|
|
@@ -266,7 +268,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
|
|
|
}
|
|
|
|
|
|
private void projectDistributionPushUserMid(TOrderNew tn) {
|
|
|
- if (tn.getProcessStatus()==ProcessStatus.YPZXSGLY.getCode()){
|
|
|
+ if (Objects.equals(tn.getProcessStatus(), ProcessStatus.YPZXSGLY.getCode())){
|
|
|
UserMid um=new UserMid();
|
|
|
String taskNames=userMidMapper.getUserTaskNames(tn.getBuyerId());
|
|
|
UserMid use=userMidMapper.getUserDtails(tn.getBuyerId());
|
|
|
@@ -277,7 +279,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
|
|
|
um.setLastSalesType(tn.getSalesType());
|
|
|
}
|
|
|
BigDecimal signAmount;
|
|
|
- Integer signNumber;
|
|
|
+ int signNumber;
|
|
|
if (use!=null){
|
|
|
if (use.getFirstSigningTime() != null) {
|
|
|
um.setFirstSigningTime(use.getFirstSigningTime()); }
|
|
|
@@ -305,9 +307,6 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
|
|
|
|
|
|
/**
|
|
|
* 推动客户、业务渠道的锁定
|
|
|
- * @param t
|
|
|
- * @param tn
|
|
|
- * @param date
|
|
|
*/
|
|
|
private void pushUser(TOrderTask t, TOrderNew tn, Date date) {
|
|
|
if (userMapper.checkLock(tn.getBuyerId())<1) {
|
|
|
@@ -423,7 +422,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
|
|
|
if (i==taskBos.size()) {
|
|
|
processStatus=ProcessStatus.YQBFPZXSGLY.getCode();
|
|
|
}else if(i>0&&i<taskBos.size()){
|
|
|
- processStatus=ProcessStatus.YBFPZXSGLY.getCode();;
|
|
|
+ processStatus=ProcessStatus.YBFPZXSGLY.getCode();
|
|
|
}else if(i==0){
|
|
|
processStatus=ProcessStatus.YPZXSGLY.getCode();
|
|
|
}
|
|
|
@@ -442,10 +441,9 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
|
|
|
tTaskLogMapper.insertSelective(tl);
|
|
|
}
|
|
|
|
|
|
- @SuppressWarnings("unchecked")
|
|
|
@Override
|
|
|
public Pagination<TOrderTaskListBo> orderTaskList(inuptTaskListBo ib) {
|
|
|
- Map<String, Object> params = new HashMap<String, Object>();
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
if(ib.getPageSize()==null||ib.getPageSize()<0)ib.setPageSize(10);
|
|
|
if(ib.getPageNo()==null||ib.getPageNo()<0)ib.setPageNo(1);
|
|
|
params.put("outsource", ib.getOutsource()==null?0:ib.getOutsource());
|
|
|
@@ -515,7 +513,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
|
|
|
t.setTimeRecord(JSON.toJSONString(map));
|
|
|
if (TokenManager.hasRole(AFTConstants.SUPERADMIN)||TokenManager.hasRole(AFTConstants.APPROVAL_DECISION)
|
|
|
||TokenManager.hasRole(AFTConstants.CUSTOMER_SERVICE)
|
|
|
- ||TokenManager.getAdminId().equals(t.getTaskReceiver())) {
|
|
|
+ || Objects.equals(TokenManager.getAdminId(), t.getTaskReceiver())) {
|
|
|
return t;
|
|
|
}else {
|
|
|
t.setContacts("***");
|
|
|
@@ -605,7 +603,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
|
|
|
} catch (ParseException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
- tOrderTaskMapper.updateByPrimaryKeySelective(task);
|
|
|
+ tOrderTaskMapper.update(task);
|
|
|
//项目中间表修改
|
|
|
if (t.getUrgentDay()!=null||t.getIfMaterial()!=null||t.getRejectCount()!=null||
|
|
|
t.getAcceptCount()!=null||t.getAuthorizeCount()!=null||t.getSpotCheckStatus()!=null) {
|
|
|
@@ -639,17 +637,20 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
|
|
|
t.setId(b.getTid());
|
|
|
t.setProjectStatus(b.getProjectStatus());
|
|
|
t.setTimeRecord(b.getTimeRecord());
|
|
|
+ updateProjectCompleteDate(t,1);
|
|
|
t.setCertificateNumber(b.getCertificateNumber());
|
|
|
if(b.getSetUpAmount()!=null)t.setSetUpAmount(new BigDecimal(b.getSetUpAmount()));
|
|
|
if (b.getPubicityUrl()!=null)t.setPubicityUrl(b.getPubicityUrl());
|
|
|
- TOrderTask task2=tOrderTaskMapper.selectByPrimaryKey(b.getTid());//查询出项目信息
|
|
|
- if(b.getProjectStatus()!=task2.getProjectStatus()||!b.getTimeRecord().equals(task2.getTimeRecord())){
|
|
|
+ TOrderTask task2=tOrderTaskMapper.queryById(b.getTid());//查询出项目信息
|
|
|
+ if(!Objects.equals(b.getProjectStatus(), task2.getProjectStatus())
|
|
|
+ ||!b.getTimeRecord().equals(task2.getTimeRecord())){
|
|
|
TTaskMid taskMid = new TTaskMid();
|
|
|
taskMid.setTid(b.getTid());
|
|
|
- if(b.getProjectStatus()==NewProjectStatus.YLX.getCode()||b.getProjectStatus()==NewProjectStatus.YNGS.getCode()){
|
|
|
+ if(Objects.equals(b.getProjectStatus(), NewProjectStatus.YLX.getCode())
|
|
|
+ || Objects.equals(b.getProjectStatus(), NewProjectStatus.YNGS.getCode())){
|
|
|
t.setSetUpStatus(1);
|
|
|
taskMid.setSetUpCount(task2.getCommodityQuantity());
|
|
|
- if (b.getProjectStatus()==NewProjectStatus.YNGS.getCode()){
|
|
|
+ if (Objects.equals(b.getProjectStatus(), NewProjectStatus.YNGS.getCode())){
|
|
|
t.setIfPublicity(1);
|
|
|
taskMid.setPromulgateCount(task2.getCommodityQuantity());
|
|
|
}
|
|
|
@@ -671,7 +672,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
|
|
|
}
|
|
|
//做计时处理
|
|
|
pushTaskTimes(t);
|
|
|
- tOrderTaskMapper.updateByPrimaryKeySelective(t);
|
|
|
+ tOrderTaskMapper.update(t);
|
|
|
projectSplitPush(b.getTid(), b.getProjectStatus(),task2);
|
|
|
pushTaskLog(b.getTid(), b.getProjectStatus());
|
|
|
updateMidServiceProject(task2.getOrderNo());
|
|
|
@@ -749,8 +750,8 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
|
|
|
TOrderTask fatherTask=new TOrderTask();
|
|
|
fatherTask.setId(task2.getSplitSuper());
|
|
|
fatherTask.setProjectStatus(i);
|
|
|
- tOrderTaskMapper.updateByPrimaryKeySelective(fatherTask);
|
|
|
- TOrderTask task3=tOrderTaskMapper.selectByPrimaryKey(task2.getSplitSuper());
|
|
|
+ tOrderTaskMapper.update(fatherTask);
|
|
|
+ TOrderTask task3=tOrderTaskMapper.queryById(task2.getSplitSuper());
|
|
|
//设置父任务
|
|
|
TOrderTaskDetailBo t2=new TOrderTaskDetailBo();
|
|
|
t2.setOrderNo(task2.getOrderNo());
|
|
|
@@ -763,8 +764,8 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
|
|
|
TOrderTask task3 =tOrderTaskMapper.selectBySuperId(task2.getSuperId());
|
|
|
task3.setId(Integer.valueOf(task2.getSuperId()));
|
|
|
task3.setSuperId(null);
|
|
|
- tOrderTaskMapper.updateByPrimaryKeySelective(task3);
|
|
|
- TOrderTask task4 = tOrderTaskMapper.selectByPrimaryKey(Integer.valueOf(task2.getSuperId()));
|
|
|
+ tOrderTaskMapper.update(task3);
|
|
|
+ TOrderTask task4 = tOrderTaskMapper.queryById(Integer.valueOf(task2.getSuperId()));
|
|
|
meanwhileUpdateOrder(task4);
|
|
|
}else {
|
|
|
meanwhileUpdateOrder(task2);
|
|
|
@@ -802,7 +803,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
|
|
|
if(ob.getDunType()==3&&projectStatus==NewProjectStatus.YWCXZ.getCode()) {
|
|
|
flag=true;
|
|
|
}else if (ob.getDunType()==2) {
|
|
|
- BusinessProject bp=businessProjectMapper.selectByPrimaryKey(task2.getCommodityId());
|
|
|
+ BusinessProject bp=businessProjectMapper.queryById(task2.getCommodityId());
|
|
|
if (bp.getType()==0&&projectStatus==NewProjectStatus.YWCXZ.getCode()) {
|
|
|
flag=true;
|
|
|
}
|
|
|
@@ -869,7 +870,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
|
|
|
if(op.getDunType()==3&&projectStatus==NewProjectStatus.YWCXZ.getCode()) {
|
|
|
flag=true;
|
|
|
}else if (op.getDunType()==2) {
|
|
|
- BusinessProject bp=businessProjectMapper.selectByPrimaryKey(task2.getCommodityId());
|
|
|
+ BusinessProject bp=businessProjectMapper.queryById(task2.getCommodityId());
|
|
|
if (bp.getType()==0&&projectStatus==NewProjectStatus.YWCXZ.getCode()) {
|
|
|
flag=true;
|
|
|
}
|
|
|
@@ -973,7 +974,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
|
|
|
|
|
|
@Override
|
|
|
public int addTaskHours(TTaskHours t) {
|
|
|
- TOrderTask tt=tOrderTaskMapper.selectByPrimaryKey(Integer.valueOf(t.getTaskId()));
|
|
|
+ TOrderTask tt=tOrderTaskMapper.queryById(Integer.valueOf(t.getTaskId()));
|
|
|
checkDeleteSign(tt.getOrderNo());
|
|
|
t.setAid(TokenManager.getAdminId()==null?"1":TokenManager.getAdminId());
|
|
|
t.setId(UUID.randomUUID().toString());
|
|
|
@@ -1054,7 +1055,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
|
|
|
@Override
|
|
|
public int createTaskProgress(TaskProgressBo t) {
|
|
|
TaskProgress tp=new TaskProgress();
|
|
|
- TOrderTask tt=tOrderTaskMapper.selectByPrimaryKey(t.getTaskId());
|
|
|
+ TOrderTask tt=tOrderTaskMapper.queryById(t.getTaskId());
|
|
|
int count =taskProgressMapper.AlreadyNuberCount(t.getTaskId());
|
|
|
count +=t.getAlreadyNumber();
|
|
|
if(tt.getCommodityQuantity()<count)throw new BusinessException(new Error( "数量不能大于总量!" ,"数量不能大于总量!"));
|
|
|
@@ -1079,7 +1080,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
|
|
|
@Override
|
|
|
public int updateTaskProgress(TaskProgressBo t) {
|
|
|
TaskProgress tp=taskProgressMapper.selectByPrimaryKey(t.getId());
|
|
|
- TOrderTask tt=tOrderTaskMapper.selectByPrimaryKey(t.getTaskId());
|
|
|
+ TOrderTask tt=tOrderTaskMapper.queryById(t.getTaskId());
|
|
|
int count =taskProgressMapper.AlreadyNuberCount(t.getTaskId());
|
|
|
count = count-tp.getAlreadyNumber()+t.getAlreadyNumber();
|
|
|
if(tt.getCommodityQuantity()<count)throw new BusinessException(new Error( "数量不能大于总量!" ,"数量不能大于总量!"));
|
|
|
@@ -1141,7 +1142,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
|
|
|
@Override
|
|
|
public int pushSplitProject(Integer tid, String splitList) {
|
|
|
String[] str=splitList.split(",");
|
|
|
- TOrderTask task=tOrderTaskMapper.selectByPrimaryKey(tid);
|
|
|
+ TOrderTask task=tOrderTaskMapper.queryById(tid);
|
|
|
checkDeleteSign(task.getOrderNo());
|
|
|
TOrderTask usedTask=new TOrderTask();
|
|
|
usedTask.setId(tid);
|
|
|
@@ -1154,7 +1155,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
|
|
|
if (!task.getCommodityQuantity().equals(x)||str.length==1) {
|
|
|
return -1;
|
|
|
}
|
|
|
- tOrderTaskMapper.updateByPrimaryKeySelective(usedTask);
|
|
|
+ tOrderTaskMapper.update(usedTask);
|
|
|
int i=1;
|
|
|
TOrderTask newTask=task;
|
|
|
newTask.setCommodityPrice(new BigDecimal(0));
|
|
|
@@ -1254,7 +1255,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
|
|
|
}
|
|
|
projcetCheckLogMapper.insertSelective(log);
|
|
|
tOrderPaymentMapper.deleteByParam(tid,2);
|
|
|
- return tOrderTaskMapper.updateByPrimaryKeySelective(t);
|
|
|
+ return tOrderTaskMapper.update(t);
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -1406,7 +1407,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
|
|
|
*/
|
|
|
@Override
|
|
|
public int pushExamineMemberProject(InputMenber in) {
|
|
|
- TOrderTask task=tOrderTaskMapper.selectByPrimaryKey(in.getId());
|
|
|
+ TOrderTask task=tOrderTaskMapper.queryById(in.getId());
|
|
|
String aid=TokenManager.getAdminId();
|
|
|
Integer status=1;
|
|
|
boolean appFlag=false;
|
|
|
@@ -1502,7 +1503,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
|
|
|
if (nt.getProcessStatus()!=null&&nt.getProcessStatus()==3){
|
|
|
tTaskMemberMapper.updateServiceYearBySplitSuper(task.getSplitSuper());
|
|
|
}
|
|
|
- tOrderTaskMapper.updateByPrimaryKeySelective(nt);
|
|
|
+ tOrderTaskMapper.update(nt);
|
|
|
if (flag){
|
|
|
addNoticMember(notice, ono, in.getType(),result);
|
|
|
}
|
|
|
@@ -1540,7 +1541,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
|
|
|
|
|
|
@Override
|
|
|
public int updateMemberProject(InputAddTask t) {
|
|
|
- TOrderTask task=tOrderTaskMapper.selectByPrimaryKey(t.getId());
|
|
|
+ TOrderTask task=tOrderTaskMapper.queryById(t.getId());
|
|
|
if(task.getProcessStatus()!=4)throw new BusinessException("审核状态错误,无法提交。");
|
|
|
addMemberLog(t.getId(),0,"修改重新发起",TokenManager.getAdminId());
|
|
|
t.setProcessStatus(1);
|
|
|
@@ -1572,11 +1573,11 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
|
|
|
@Override
|
|
|
public TOrderTask addMemberSonProject(Integer tid, String serviceYear, String taskComment,Integer memberType,String pictureUrl) {
|
|
|
Date date =new Date();
|
|
|
- TOrderTask tOrderTask = tOrderTaskMapper.selectByPrimaryKey(tid);
|
|
|
+ TOrderTask tOrderTask = tOrderTaskMapper.queryById(tid);
|
|
|
tOrderTask.setSplitStatus(1);
|
|
|
tOrderTask.setSplitAid(TokenManager.getAdminId());
|
|
|
tOrderTask.setSplitTime(date);
|
|
|
- tOrderTaskMapper.updateByPrimaryKey(tOrderTask);
|
|
|
+ tOrderTaskMapper.update(tOrderTask);
|
|
|
tOrderTask.setId(null);
|
|
|
tOrderTask.setSplitStatus(2);
|
|
|
tOrderTask.setSplitSuper(tid);
|
|
|
@@ -1657,7 +1658,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
|
|
|
}
|
|
|
tOrderTask.setId(t.getId());
|
|
|
|
|
|
- tOrderTaskMapper.updateByPrimaryKeySelective(tOrderTask);
|
|
|
+ tOrderTaskMapper.update(tOrderTask);
|
|
|
tOrderExamineMapper.insertBatch(list);
|
|
|
}
|
|
|
|
|
|
@@ -1807,15 +1808,15 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
|
|
|
|
|
|
@Override
|
|
|
public int deleteMemberSonProject(Integer id) {
|
|
|
- TOrderTask task = tOrderTaskMapper.selectByPrimaryKey(id);
|
|
|
- tOrderTaskMapper.deleteByPrimaryKey(id);
|
|
|
+ TOrderTask task = tOrderTaskMapper.queryById(id);
|
|
|
+ tOrderTaskMapper.deleteById(id);
|
|
|
List<TOrderTaskListBo> tOrderTaskListBos = tOrderTaskMapper.splitProjectList(task.getSplitSuper(),null);
|
|
|
//如果没有子项目则修改上级
|
|
|
if (tOrderTaskListBos==null||tOrderTaskListBos.isEmpty()){
|
|
|
TOrderTask tOrderTask=new TOrderTask();
|
|
|
tOrderTask.setId(task.getSplitSuper());
|
|
|
tOrderTask.setSplitStatus(0);
|
|
|
- tOrderTaskMapper.updateByPrimaryKeySelective(tOrderTask);
|
|
|
+ tOrderTaskMapper.update(tOrderTask);
|
|
|
}
|
|
|
tTaskMidMapper.deleteByPrimaryKey(id);
|
|
|
tTaskMemberMapper.deleteByPrimaryKey(id);
|
|
|
@@ -1974,7 +1975,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
|
|
|
TaskStop use = taskStopMapper.selectByPrimaryKey(in.getTaskStopId());
|
|
|
TaskStop t=new TaskStop();
|
|
|
t.setId(use.getId());
|
|
|
- TOrderTask task = tOrderTaskMapper.selectByPrimaryKey(use.getTid());
|
|
|
+ TOrderTask task = tOrderTaskMapper.queryById(use.getTid());
|
|
|
if (in.getStatus()==1){
|
|
|
t.setStatus(1);
|
|
|
StringBuffer str =new StringBuffer();
|
|
|
@@ -1999,7 +2000,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
|
|
|
task2.setId(task.getId());
|
|
|
task2.setProjectStatus(task.getProjectStatus());
|
|
|
|
|
|
- tOrderTaskMapper.updateByPrimaryKeySelective(task2);
|
|
|
+ tOrderTaskMapper.update(task2);
|
|
|
tOrderMidMapper.updateStopProjectByOrderNo(task.getOrderNo());
|
|
|
if (task.getSplitStatus()==1){
|
|
|
TOrderTask tot=new TOrderTask();
|
|
|
@@ -2055,7 +2056,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
|
|
|
}else if (formRetrieve==4){
|
|
|
in.setSatisfactionDegreeUrl(satisfactionDegreeUrl);
|
|
|
}
|
|
|
- return tOrderTaskMapper.updateByPrimaryKeySelective(in);
|
|
|
+ return tOrderTaskMapper.update(in);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -2063,4 +2064,68 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
|
|
|
return tTaskLogMapper.selectByTid(id);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void pushProjectCompleteDate() {
|
|
|
+ List<TOrderTask> tOrderTasks = tOrderTaskMapper.selectAll();
|
|
|
+ for (TOrderTask e : tOrderTasks) {
|
|
|
+ updateProjectCompleteDate(e,0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @param e
|
|
|
+ * @param type =0 是批量处理会修改 =1是修改属性,外部一起修改
|
|
|
+ */
|
|
|
+ private void updateProjectCompleteDate(TOrderTask e ,Integer type) {
|
|
|
+ if (StringUtils.isNotEmpty(e.getTimeRecord())) {
|
|
|
+ ObjectMapper mapper = new ObjectMapper();
|
|
|
+ try {
|
|
|
+ Map map = mapper.readValue(e.getTimeRecord(), Map.class);
|
|
|
+
|
|
|
+ String[] str={"4","5","6","7","8","9","10","11","13","14","15","16","17","18","19","20","27"};
|
|
|
+ String date = null;
|
|
|
+ boolean flag = false;
|
|
|
+ for (String s : str) {
|
|
|
+ if (StringUtils.isEmpty(date)){
|
|
|
+ String s1 = pushStr(s, map);
|
|
|
+ if (s1!=null)date=s1;
|
|
|
+ }
|
|
|
+ for (String string : str) {
|
|
|
+ if (string.equals(s)) {
|
|
|
+ flag = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ //如果是完成则修改成完成
|
|
|
+ if(flag){
|
|
|
+ if (type==1){
|
|
|
+ e.setCompleteStatus(1);
|
|
|
+ e.setCompleteDate(DateUtils.parseDate(date));
|
|
|
+ }else {
|
|
|
+ TOrderTask t=new TOrderTask();
|
|
|
+ t.setId(e.getId());
|
|
|
+ t.setCompleteStatus(1);
|
|
|
+ t.setCompleteDate(DateUtils.parseDate(date));
|
|
|
+ tOrderTaskMapper.update(t);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (JsonProcessingException ex) {
|
|
|
+ throw new RuntimeException(ex);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ private String pushStr(String s,Map map) {
|
|
|
+ String date=null;
|
|
|
+ Map map2 = (Map) map.get(s);
|
|
|
+ if (map2!=null){
|
|
|
+ date = (String) map2.get("date");
|
|
|
+ }
|
|
|
+ return date;
|
|
|
+ }
|
|
|
+
|
|
|
}
|