|
|
@@ -4,6 +4,7 @@ import com.aliyuncs.exceptions.ClientException;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
@@ -642,8 +643,16 @@ public class IndustrialLandSupplyDetailService extends BaseService<IndustrialLan
|
|
|
boolean consulApproveFlag = false;
|
|
|
for (Approval approval : consulApprovalList) {
|
|
|
if (Objects.equals(entity.getId(), approval.getApply_id())) {
|
|
|
- consulApproveFlag = true;
|
|
|
- break;
|
|
|
+ try {
|
|
|
+ Date d1 = DateUtil.parseTimeStringToDate(entity.getUpdate_time(), "yyyy-MM-dd hh:mm:ss");
|
|
|
+ Date d2 = DateUtil.parseTimeStringToDate(approval.getCreate_time(), "yyyy-MM-dd hh:mm:ss");
|
|
|
+ if (d1.before(d2)) {
|
|
|
+ consulApproveFlag = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ } catch (ParseException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -831,7 +840,7 @@ public class IndustrialLandSupplyDetailService extends BaseService<IndustrialLan
|
|
|
* @Return: void
|
|
|
**/
|
|
|
@Transactional
|
|
|
- public Integer update(IndustrialLandSupplyDetail apply, String status) throws ClientException, InterruptedException {
|
|
|
+ public Integer update(IndustrialLandSupplyDetail apply, String status) {
|
|
|
|
|
|
Integer userType = ShiroUtils.getUserType();
|
|
|
if (Objects.equals(status, Constant.PublishStatus.DRAFT)) {
|
|
|
@@ -871,7 +880,7 @@ public class IndustrialLandSupplyDetailService extends BaseService<IndustrialLan
|
|
|
String dateTime = DateUtil.getTimeString(new Date());
|
|
|
List<IndustrialLandSupplyConsultation> industrialLandSupplyConsultationList = apply.getConsultationList();
|
|
|
if (!CollectionUtils.isEmpty(industrialLandSupplyConsultationList)) {
|
|
|
-
|
|
|
+ //过滤空的
|
|
|
Iterator<IndustrialLandSupplyConsultation> it = industrialLandSupplyConsultationList.iterator();
|
|
|
while (it.hasNext()) {
|
|
|
if (CommonUtils.isNull(it.next().getConsultation())) {
|
|
|
@@ -881,6 +890,13 @@ public class IndustrialLandSupplyDetailService extends BaseService<IndustrialLan
|
|
|
for (IndustrialLandSupplyConsultation industrialLandSupplyConsultation : industrialLandSupplyConsultationList) {
|
|
|
|
|
|
industrialLandSupplyConsultation.setIndustrial_land_supply_id(apply.getId() + "");
|
|
|
+ if (industrialLandSupplyConsultation.getId() != null) {
|
|
|
+ IndustrialLandSupplyConsultation industrialLandSupplyConsultation1 = industrialLandSupplyConsultationService.findById(industrialLandSupplyConsultation.getId());
|
|
|
+ //如果问的问题没变则保留id等信息 不然作为新的处理
|
|
|
+ if (Objects.equals(industrialLandSupplyConsultation1.getConsultation(), industrialLandSupplyConsultation.getConsultation())) {
|
|
|
+ BeanUtils.copyProperties(industrialLandSupplyConsultation1, industrialLandSupplyConsultation);
|
|
|
+ }
|
|
|
+ }
|
|
|
if (CommonUtils.isNull(industrialLandSupplyConsultation.getConsultation_time())) {
|
|
|
industrialLandSupplyConsultation.setConsultation_time(dateTime);
|
|
|
}
|
|
|
@@ -1290,39 +1306,43 @@ public class IndustrialLandSupplyDetailService extends BaseService<IndustrialLan
|
|
|
approvalService.insertAndGetId(newApproval);
|
|
|
return true;
|
|
|
} else if (Objects.equals(Constant.LandSupplyApproveStatus.MANAGEMENT_COMMITTEE_LEADER_RETURN, approval.getAfter_approvalstatus())) {
|
|
|
- //预审退回 --》 待咨询反馈
|
|
|
+ //预审退回 --》 待咨询反馈 或 咨询汇总
|
|
|
|
|
|
IndustrialLandSupplyConsultation industrialLandSupplyConsultation = new IndustrialLandSupplyConsultation();
|
|
|
industrialLandSupplyConsultation.setIndustrial_land_supply_id(applyId + "");
|
|
|
industrialLandSupplyConsultation.setDel_flag(false);
|
|
|
List<IndustrialLandSupplyConsultation> industrialLandSupplyConsultationList = industrialLandSupplyConsultationService.findListByWhere(industrialLandSupplyConsultation);
|
|
|
- boolean sumbitToLeader = false;
|
|
|
- if (CollectionUtils.isEmpty(industrialLandSupplyConsultationList)) {
|
|
|
- sumbitToLeader = true;
|
|
|
+ boolean sumbitToSummary = true;
|
|
|
+ for (IndustrialLandSupplyConsultation landSupplyConsultation : industrialLandSupplyConsultationList) {
|
|
|
+ //如果所有咨询都已回答 进入待汇总
|
|
|
+ if (CommonUtils.isNull(landSupplyConsultation.getFeedback()) || CommonUtils.isNull(landSupplyConsultation.getUpdate_by())) {
|
|
|
+ sumbitToSummary = false;
|
|
|
+ break;
|
|
|
+ } else {
|
|
|
+ sumbitToSummary = true;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
Group group = null;
|
|
|
+ newApproval.setOper_type(Constant.OperType.SUBMIT);
|
|
|
newApproval.setBefore_approvalstatus(Constant.LandSupplyApproveStatus.MANAGEMENT_COMMITTEE_LEADER_RETURN);
|
|
|
- if (sumbitToLeader) {
|
|
|
- newApproval.setOper_type(Constant.OperType.SUBMIT);
|
|
|
- //newApproval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_LEADER_PENDING_HANDLE);
|
|
|
- //临时跳过商务领导审核
|
|
|
- newApproval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.MANAGEMENT_COMMITTEE_LEADER_PENDING_HANDLE);
|
|
|
- //group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_3);
|
|
|
- //临时跳过商务领导审核
|
|
|
- group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_4);
|
|
|
- if (null == group) {
|
|
|
- //throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_3 + "没有该项目责任单位的人员,请联系管理员配置");
|
|
|
- //临时跳过商务领导审核
|
|
|
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_4 + "没有该项目责任单位的人员,请联系管理员配置");
|
|
|
- }
|
|
|
+ if (sumbitToSummary) {
|
|
|
+ newApproval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_SUMMARY);
|
|
|
} else {
|
|
|
- newApproval.setOper_type(Constant.OperType.DISTRIBUTE);
|
|
|
newApproval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_FEEDBACK);
|
|
|
+ }
|
|
|
+ if (sumbitToSummary) {
|
|
|
+ group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_1);
|
|
|
+ } else {
|
|
|
group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_2);
|
|
|
- if (null == group) {
|
|
|
+ }
|
|
|
+ if (null == group) {
|
|
|
+ if (sumbitToSummary) {
|
|
|
+ throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_1 + "没有该项目责任单位的人员,请联系管理员配置");
|
|
|
+ } else {
|
|
|
throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_2 + "没有该项目责任单位的人员,请联系管理员配置");
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
List<UserGroup> userGroups = userGroupService.findByGroupId(group.getId());
|
|
|
List<User> users = userService.findListByWhere(new User());
|
|
|
@@ -1335,24 +1355,17 @@ public class IndustrialLandSupplyDetailService extends BaseService<IndustrialLan
|
|
|
}
|
|
|
}
|
|
|
newApproval.setNextchecker(sb.toString());
|
|
|
- if (sumbitToLeader) {
|
|
|
- if (sb.length() == 0) {
|
|
|
- //throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_3 + "没有该项目责任单位的人员,请联系管理员配置");
|
|
|
- //临时跳过商务领导审核
|
|
|
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_4 + "没有该项目责任单位的人员,请联系管理员配置");
|
|
|
- }
|
|
|
- } else {
|
|
|
- if (sb.length() == 0) {
|
|
|
+ if (sb.length() == 0) {
|
|
|
+ if (sumbitToSummary) {
|
|
|
+ throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_1 + "没有该项目责任单位的人员,请联系管理员配置");
|
|
|
+ } else {
|
|
|
throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_2 + "没有该项目责任单位的人员,请联系管理员配置");
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
IndustrialLandSupplyDetail entity = new IndustrialLandSupplyDetail();
|
|
|
entity.setId(applyId);
|
|
|
- if (sumbitToLeader) {
|
|
|
- //entity.setApprove_status(Constant.LandSupplyApproveStatus.COMMERCE_LEADER_PENDING_HANDLE);
|
|
|
- //临时跳过商务领导审核
|
|
|
- entity.setApprove_status(Constant.LandSupplyApproveStatus.MANAGEMENT_COMMITTEE_LEADER_PENDING_HANDLE);
|
|
|
+ if (sumbitToSummary) {
|
|
|
+ entity.setApprove_status(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_SUMMARY);
|
|
|
} else {
|
|
|
entity.setApprove_status(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_FEEDBACK);
|
|
|
}
|
|
|
@@ -2481,6 +2494,13 @@ public class IndustrialLandSupplyDetailService extends BaseService<IndustrialLan
|
|
|
for (IndustrialLandSupplyConsultation industrialLandSupplyConsultation : industrialLandSupplyConsultationList) {
|
|
|
|
|
|
industrialLandSupplyConsultation.setIndustrial_land_supply_id(id + "");
|
|
|
+ if (industrialLandSupplyConsultation.getId() != null) {
|
|
|
+ IndustrialLandSupplyConsultation industrialLandSupplyConsultation1 = industrialLandSupplyConsultationService.findById(industrialLandSupplyConsultation.getId());
|
|
|
+ //如果问的问题没变则保留id等信息 不然作为新的处理
|
|
|
+ if (Objects.equals(industrialLandSupplyConsultation1.getConsultation(), industrialLandSupplyConsultation.getConsultation())) {
|
|
|
+ BeanUtils.copyProperties(industrialLandSupplyConsultation1, industrialLandSupplyConsultation);
|
|
|
+ }
|
|
|
+ }
|
|
|
if (CommonUtils.isNull(industrialLandSupplyConsultation.getConsultation_time())) {
|
|
|
industrialLandSupplyConsultation.setConsultation_time(dateTime);
|
|
|
}
|