|
@@ -10,21 +10,25 @@ import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONException;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
|
|
+import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.dayou.common.BaseEntity;
|
|
|
+import com.dayou.dto.PriceFeedbackDTO;
|
|
|
import com.dayou.dto.history.HisAssetsOrder;
|
|
|
import com.dayou.dto.history.HisMajorOrder;
|
|
|
+import com.dayou.dto.history.HisMajorTarget;
|
|
|
import com.dayou.dto.history.HisOrderParam;
|
|
|
import com.dayou.entity.*;
|
|
|
import com.dayou.enums.MainBusinessEnum;
|
|
|
+import com.dayou.enums.ProductionEnum;
|
|
|
import com.dayou.exception.ErrorCode;
|
|
|
import com.dayou.mapper.DyoaHistoryMapper;
|
|
|
-import com.dayou.service.IDepartmentService;
|
|
|
-import com.dayou.service.IDyoaRecordService;
|
|
|
-import com.dayou.service.IUserService;
|
|
|
+import com.dayou.service.*;
|
|
|
import com.dayou.service.impl.MajorServiceImpl;
|
|
|
import com.dayou.service.workflow.*;
|
|
|
+import com.dayou.utils.DateUtils;
|
|
|
import com.dayou.utils.HttpKit;
|
|
|
import com.sun.corba.se.spi.orbutil.threadpool.Work;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -32,6 +36,7 @@ import org.apache.http.HttpResponse;
|
|
|
import org.apache.http.client.HttpClient;
|
|
|
import org.apache.http.client.methods.HttpPost;
|
|
|
import org.apache.http.impl.client.DefaultHttpClient;
|
|
|
+import org.checkerframework.checker.units.qual.A;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -44,8 +49,7 @@ import java.util.regex.Matcher;
|
|
|
import java.util.regex.Pattern;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
-import static com.dayou.common.Constants.ASSIGN;
|
|
|
-import static com.dayou.common.Constants.BY_TURNS;
|
|
|
+import static com.dayou.common.Constants.*;
|
|
|
import static com.dayou.enums.MainBusinessEnum.MAJOR_BUSINESS;
|
|
|
import static com.dayou.enums.workflow.NodeStateEnum.PENDING;
|
|
|
import static com.dayou.enums.workflow.NodeTaskVersion.LATEST;
|
|
@@ -75,6 +79,12 @@ public class DyoaHistoryServiceImpl implements IDyoaHistoryService{
|
|
|
|
|
|
private static final Map<String,String> MAJOR_ORDER_COLUM = new HashMap<>();
|
|
|
|
|
|
+ private static final Map<String,String> MAJOR_TARGET_LAND_COLUM = new HashMap<>();
|
|
|
+
|
|
|
+ private static final Map<String,String> MAJOR_PRODUCTION_COLUM = new HashMap<>();
|
|
|
+
|
|
|
+ private static final Map<String,String> MAJOR_TARGET_HOUSE_COLUM = new HashMap<>();
|
|
|
+
|
|
|
|
|
|
@Autowired
|
|
|
private IUserService userService;
|
|
@@ -106,6 +116,12 @@ public class DyoaHistoryServiceImpl implements IDyoaHistoryService{
|
|
|
@Autowired
|
|
|
private IWorkTaskRecordService workTaskRecordService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IMajorTargetService majorTargetService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IMajorProductionService majorProductionService;
|
|
|
+
|
|
|
static {
|
|
|
// MAJOR_ORDER_COLUM.put("id","id");
|
|
|
MAJOR_ORDER_COLUM.put("name","name");
|
|
@@ -146,6 +162,74 @@ public class DyoaHistoryServiceImpl implements IDyoaHistoryService{
|
|
|
// MAJOR_ORDER_COLUM.put("terminalContactName","terminalClienteleContactId");
|
|
|
MAJOR_ORDER_COLUM.put("members","members");
|
|
|
MAJOR_ORDER_COLUM.put("description","remark");
|
|
|
+
|
|
|
+ // 大中型估价对象(土地)字段
|
|
|
+ MAJOR_TARGET_LAND_COLUM.put("type","landType");
|
|
|
+ MAJOR_TARGET_LAND_COLUM.put("ownerName","rightToUser");
|
|
|
+ MAJOR_TARGET_LAND_COLUM.put("ownerNo","landCertificateNo");
|
|
|
+ MAJOR_TARGET_LAND_COLUM.put("locations","located");
|
|
|
+ MAJOR_TARGET_LAND_COLUM.put("useArea","useAcreage");
|
|
|
+ MAJOR_TARGET_LAND_COLUM.put("lastYear","residueYears");
|
|
|
+ MAJOR_TARGET_LAND_COLUM.put("plotRate","plotRatio");
|
|
|
+ MAJOR_TARGET_LAND_COLUM.put("landUsage","landUse");
|
|
|
+ MAJOR_TARGET_LAND_COLUM.put("useType","rightType");
|
|
|
+ MAJOR_TARGET_LAND_COLUM.put("masterName","principalId");
|
|
|
+ MAJOR_TARGET_LAND_COLUM.put("surveyName","siteIds");
|
|
|
+ MAJOR_TARGET_LAND_COLUM.put("description","remark");
|
|
|
+ MAJOR_TARGET_LAND_COLUM.put("price","evaluateValue");
|
|
|
+ MAJOR_TARGET_LAND_COLUM.put("approvedPrice","checkValue");
|
|
|
+ MAJOR_TARGET_LAND_COLUM.put("measure","evaluateMethods");
|
|
|
+ MAJOR_TARGET_LAND_COLUM.put("surveyDate","evaluateDate");
|
|
|
+
|
|
|
+ //大中型估价对象(房地产)字段
|
|
|
+ MAJOR_TARGET_HOUSE_COLUM.put("type","housePurpose");
|
|
|
+ MAJOR_TARGET_HOUSE_COLUM.put("ownerName","owner");
|
|
|
+ MAJOR_TARGET_HOUSE_COLUM.put("ownerNo","ownerNo");
|
|
|
+ MAJOR_TARGET_HOUSE_COLUM.put("houseName","targetName");
|
|
|
+ MAJOR_TARGET_HOUSE_COLUM.put("locations","located");
|
|
|
+ MAJOR_TARGET_HOUSE_COLUM.put("landOwnerName","rightToUser");
|
|
|
+ MAJOR_TARGET_HOUSE_COLUM.put("landNo","landCertificateNo");
|
|
|
+ MAJOR_TARGET_HOUSE_COLUM.put("buildYear","buildDoneYear");
|
|
|
+ MAJOR_TARGET_HOUSE_COLUM.put("buildArea","buildAcreage");
|
|
|
+ MAJOR_TARGET_HOUSE_COLUM.put("useType","useRightType");
|
|
|
+ MAJOR_TARGET_HOUSE_COLUM.put("landArea","landAcreage");
|
|
|
+ MAJOR_TARGET_HOUSE_COLUM.put("masterName","principalId");
|
|
|
+ MAJOR_TARGET_HOUSE_COLUM.put("surveyName","siteIds");
|
|
|
+ MAJOR_TARGET_HOUSE_COLUM.put("planUsage","planPurpose");
|
|
|
+ MAJOR_TARGET_HOUSE_COLUM.put("realUsage","realPurpose");
|
|
|
+ MAJOR_TARGET_HOUSE_COLUM.put("surveyAddress","siteLocated");
|
|
|
+ MAJOR_TARGET_HOUSE_COLUM.put("description","remark");
|
|
|
+ MAJOR_TARGET_HOUSE_COLUM.put("price","evaluateValue");
|
|
|
+ MAJOR_TARGET_HOUSE_COLUM.put("approvedPrice","checkValue");
|
|
|
+ MAJOR_TARGET_HOUSE_COLUM.put("measure","evaluateMethods");
|
|
|
+ MAJOR_TARGET_HOUSE_COLUM.put("surveyDate","evaluateDate");
|
|
|
+
|
|
|
+
|
|
|
+ //大中型产品字段
|
|
|
+ MAJOR_PRODUCTION_COLUM.put("pType","production");
|
|
|
+ MAJOR_PRODUCTION_COLUM.put("reportNo","reportNo");
|
|
|
+ MAJOR_PRODUCTION_COLUM.put("signEmpNames","signatory");
|
|
|
+ MAJOR_PRODUCTION_COLUM.put("name","name");
|
|
|
+ MAJOR_PRODUCTION_COLUM.put("principal","clientName");
|
|
|
+ MAJOR_PRODUCTION_COLUM.put("principalAddress","clientAddress");
|
|
|
+ MAJOR_PRODUCTION_COLUM.put("principalMobile","clientTel");
|
|
|
+ MAJOR_PRODUCTION_COLUM.put("propertyName","owner");
|
|
|
+ MAJOR_PRODUCTION_COLUM.put("priceDate","valueTiming");
|
|
|
+ MAJOR_PRODUCTION_COLUM.put("area","evaluateAcreage");
|
|
|
+ MAJOR_PRODUCTION_COLUM.put("money","evaluateAmount");
|
|
|
+ MAJOR_PRODUCTION_COLUM.put("xPrice","evaluatePrice");
|
|
|
+ MAJOR_PRODUCTION_COLUM.put("specDesc","comment");
|
|
|
+ MAJOR_PRODUCTION_COLUM.put("repo","repertoryState");
|
|
|
+ MAJOR_PRODUCTION_COLUM.put("yjsInTime","repertoryInTime");
|
|
|
+ MAJOR_PRODUCTION_COLUM.put("yjsOutTime","repertoryOutTime");
|
|
|
+ MAJOR_PRODUCTION_COLUM.put("bgInTime","repertoryInTime");
|
|
|
+ MAJOR_PRODUCTION_COLUM.put("bgOutTime","repertoryOutTime");
|
|
|
+ MAJOR_PRODUCTION_COLUM.put("archiveTime","saveFileDate");
|
|
|
+ MAJOR_PRODUCTION_COLUM.put("standardPrice","standardAmount");
|
|
|
+ MAJOR_PRODUCTION_COLUM.put("confirmTime","deliveryDate");
|
|
|
+ MAJOR_PRODUCTION_COLUM.put("deliveryState","delivery");
|
|
|
+ MAJOR_PRODUCTION_COLUM.put("printQuantity","printTimes");
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -255,6 +339,8 @@ public class DyoaHistoryServiceImpl implements IDyoaHistoryService{
|
|
|
return resultMap;
|
|
|
}
|
|
|
|
|
|
+ //多数据源切换,主方法用@DSTransactional注解解决事务失效问题
|
|
|
+ @DSTransactional
|
|
|
@Override
|
|
|
public Boolean fetchAboutMajor(String id) {
|
|
|
dyoaRecordService.isExist(MainBusinessEnum.MAJOR_ORDER,id);
|
|
@@ -262,12 +348,18 @@ public class DyoaHistoryServiceImpl implements IDyoaHistoryService{
|
|
|
//1. 获取订单信息,插入major表。
|
|
|
Map<String, Object> dyoaMajorOrder = dyoaHistoryMapper.queryMajorOrder(id);
|
|
|
Long mbsId = this.doCreateMajorOrder(dyoaMajorOrder);
|
|
|
- //2. 创建节点
|
|
|
- String dyoaNodeName = (String) dyoaMajorOrder.get("nowNodeName");
|
|
|
- Long instanceNodeId = this.doCreateMajorInstanceNode(mbsId, dyoaNodeName);
|
|
|
- //3. 创建任务
|
|
|
- String dyoaHandlerName = (String) dyoaMajorOrder.get("nowNodeEmpName");
|
|
|
- this.doCreateNodeTask(instanceNodeId,dyoaNodeName,dyoaHandlerName);
|
|
|
+ //2. 同步估价对象
|
|
|
+ String targetType = (String) dyoaMajorOrder.get("businessType");
|
|
|
+ List<MajorProduction> majorProductions = this.doCreateMajorTarget(targetType, id, mbsId);
|
|
|
+ //3. 创建节点
|
|
|
+ Object node = dyoaMajorOrder.get("nowNodeName");
|
|
|
+ if (node!=null){
|
|
|
+ String dyoaNodeName = (String) node;
|
|
|
+ Long instanceNodeId = this.doCreateMajorInstanceNode(mbsId, dyoaNodeName,majorProductions);
|
|
|
+ //4. 创建任务
|
|
|
+ String dyoaHandlerName = (String) dyoaMajorOrder.get("nowNodeEmpName");
|
|
|
+ this.doCreateNodeTask(instanceNodeId,dyoaNodeName,dyoaHandlerName);
|
|
|
+ }
|
|
|
return Boolean.TRUE;
|
|
|
} catch (NoSuchFieldException e) {
|
|
|
throw new RuntimeException(e);
|
|
@@ -276,7 +368,251 @@ public class DyoaHistoryServiceImpl implements IDyoaHistoryService{
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public Long doCreateMajorOrder(Map<String,Object> dyMajorOrder) throws NoSuchFieldException, IllegalAccessException {
|
|
|
+ public List<MajorProduction> doCreateMajorTarget(String targetType, String id,Long majorId) throws NoSuchFieldException, IllegalAccessException {
|
|
|
+ List<MajorTarget> mts = new ArrayList<>();
|
|
|
+ List<MajorProduction> mps = new ArrayList<>();
|
|
|
+ if ("土地".equals(targetType)){
|
|
|
+ List<HisMajorTarget> majorLandTarget = dyoaHistoryMapper.queryMajorLandTarget(id);
|
|
|
+ Map<String, List<HisMajorTarget>> collect = majorLandTarget.stream()
|
|
|
+ .collect(Collectors.groupingBy(HisMajorTarget::getTId));
|
|
|
+ for (Map.Entry<String, List<HisMajorTarget>> target : collect.entrySet()){
|
|
|
+ MajorTarget majorTarget = new MajorTarget();
|
|
|
+ majorTarget.setTargetType("土地");
|
|
|
+ majorTarget.setMajorId(majorId);
|
|
|
+ for (Map.Entry<String, String> entry : MAJOR_TARGET_LAND_COLUM.entrySet()){
|
|
|
+ Field field = HisMajorTarget.class.getDeclaredField(entry.getKey());
|
|
|
+ field.setAccessible(true);
|
|
|
+ Object value = field.get(target.getValue().get(0));
|
|
|
+ if (value!=null){
|
|
|
+ String mbsColum = entry.getValue();
|
|
|
+ Field xFiled = MajorTarget.class.getDeclaredField(mbsColum);
|
|
|
+ xFiled.setAccessible(true);
|
|
|
+ switch (mbsColum){
|
|
|
+ case "principalId":
|
|
|
+ xFiled.set(majorTarget,getMbsUserId((String) value));
|
|
|
+ break;
|
|
|
+ case "siteIds":
|
|
|
+ xFiled.set(majorTarget,getMbsUserIds((String) value));
|
|
|
+ break;
|
|
|
+ case "evaluateMethods":
|
|
|
+ String methods = (String) value;
|
|
|
+ xFiled.set(majorTarget,JSON.toJSONString(Arrays.asList(methods.split(","))));
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ xFiled.set(majorTarget,value);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ mts.add(majorTarget);
|
|
|
+ //是否有产品
|
|
|
+ for (HisMajorTarget production :target.getValue()){
|
|
|
+ if (StrUtil.isNotBlank(production.getPId())){
|
|
|
+ MajorProduction majorProduction = new MajorProduction();
|
|
|
+ majorProduction.setMajorId(majorId);
|
|
|
+ for (Map.Entry<String, String> entry : MAJOR_PRODUCTION_COLUM.entrySet()){
|
|
|
+ Field field = HisMajorTarget.class.getDeclaredField(entry.getKey());
|
|
|
+ field.setAccessible(true);
|
|
|
+ Object value = field.get(production);
|
|
|
+ if (value!=null){
|
|
|
+ String mbsColum = entry.getValue();
|
|
|
+ Field xFiled = MajorProduction.class.getDeclaredField(mbsColum);
|
|
|
+ xFiled.setAccessible(true);
|
|
|
+ switch (mbsColum){
|
|
|
+ case "production":
|
|
|
+ String productionType = getProductionType((String) value);
|
|
|
+ xFiled.set(majorProduction, productionType);
|
|
|
+ if (ProductionEnum.STATEMENT.name().equals(productionType)){
|
|
|
+ majorTarget.setStatementNo(production.getReportNo());
|
|
|
+ }
|
|
|
+ if (ProductionEnum.REPORT.name().equals(productionType)){
|
|
|
+ majorTarget.setReportNo(production.getReportNo());
|
|
|
+ }
|
|
|
+ if (ProductionEnum.LETTER.name().equals(productionType)){
|
|
|
+ majorTarget.setLetterNo(production.getReportNo());
|
|
|
+ }
|
|
|
+
|
|
|
+ break;
|
|
|
+ case "delivery":
|
|
|
+ xFiled.set(majorProduction,production.getConfirmTime()!=null);
|
|
|
+ break;
|
|
|
+ case "signatory":
|
|
|
+ xFiled.set(majorProduction,getMbsUserIds((String) value));
|
|
|
+ break;
|
|
|
+ case "valueTiming":
|
|
|
+ case "saveFileDate":
|
|
|
+ case "deliveryDate":
|
|
|
+ xFiled.set(majorProduction,DateUtils.dateToLocalDate((Date) value));
|
|
|
+ break;
|
|
|
+ case "repertoryState":
|
|
|
+ String repertoryState = (String) value;
|
|
|
+ xFiled.set(majorProduction,repertoryState.equals("OUT"));
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ xFiled.set(majorProduction,value);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ mps.add(majorProduction);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ if ("房地产".equals(targetType)){
|
|
|
+ List<HisMajorTarget> majorHouseTarget = dyoaHistoryMapper.queryMajorHouseTarget(id);
|
|
|
+ Map<String, List<HisMajorTarget>> collect = majorHouseTarget.stream()
|
|
|
+ .collect(Collectors.groupingBy(HisMajorTarget::getTId));
|
|
|
+ for (Map.Entry<String, List<HisMajorTarget>> target : collect.entrySet()){
|
|
|
+ MajorTarget majorTarget = new MajorTarget();
|
|
|
+ majorTarget.setTargetType("房地产");
|
|
|
+ majorTarget.setMajorId(majorId);
|
|
|
+ for (Map.Entry<String, String> entry : MAJOR_TARGET_HOUSE_COLUM.entrySet()){
|
|
|
+ Field field = HisMajorTarget.class.getDeclaredField(entry.getKey());
|
|
|
+ field.setAccessible(true);
|
|
|
+ Object value = field.get(target.getValue().get(0));
|
|
|
+ if (value!=null){
|
|
|
+ String mbsColum = entry.getValue();
|
|
|
+ Field xFiled = MajorTarget.class.getDeclaredField(mbsColum);
|
|
|
+ xFiled.setAccessible(true);
|
|
|
+ switch (mbsColum){
|
|
|
+ case "principalId":
|
|
|
+ xFiled.set(majorTarget,getMbsUserId((String) value));
|
|
|
+ break;
|
|
|
+ case "siteIds":
|
|
|
+ xFiled.set(majorTarget,getMbsUserIds((String) value));
|
|
|
+ break;
|
|
|
+ case "evaluateMethods":
|
|
|
+ case "housePurpose":
|
|
|
+ String methods = (String) value;
|
|
|
+ xFiled.set(majorTarget,JSON.toJSONString(Arrays.asList(methods.split(","))));
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ xFiled.set(majorTarget,value);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ mts.add(majorTarget);
|
|
|
+ //是否有产品
|
|
|
+ for (HisMajorTarget production :target.getValue()){
|
|
|
+ if (StrUtil.isNotBlank(production.getPId())){
|
|
|
+ MajorProduction majorProduction = new MajorProduction();
|
|
|
+ majorProduction.setMajorId(majorId);
|
|
|
+ for (Map.Entry<String, String> entry : MAJOR_PRODUCTION_COLUM.entrySet()){
|
|
|
+ Field field = HisMajorTarget.class.getDeclaredField(entry.getKey());
|
|
|
+ field.setAccessible(true);
|
|
|
+ Object value = field.get(production);
|
|
|
+ if (value!=null){
|
|
|
+ String mbsColum = entry.getValue();
|
|
|
+ Field xFiled = MajorProduction.class.getDeclaredField(mbsColum);
|
|
|
+ xFiled.setAccessible(true);
|
|
|
+ switch (mbsColum){
|
|
|
+ case "production":
|
|
|
+ String productionType = getProductionType((String) value);
|
|
|
+ xFiled.set(majorProduction, productionType);
|
|
|
+ if (ProductionEnum.STATEMENT.name().equals(productionType)){
|
|
|
+ majorTarget.setStatementNo(production.getReportNo());
|
|
|
+ }
|
|
|
+ if (ProductionEnum.REPORT.name().equals(productionType)){
|
|
|
+ majorTarget.setReportNo(production.getReportNo());
|
|
|
+ }
|
|
|
+ if (ProductionEnum.LETTER.name().equals(productionType)){
|
|
|
+ majorTarget.setLetterNo(production.getReportNo());
|
|
|
+ }
|
|
|
+
|
|
|
+ break;
|
|
|
+ case "delivery":
|
|
|
+ xFiled.set(majorProduction,production.getConfirmTime()!=null);
|
|
|
+ break;
|
|
|
+ case "signatory":
|
|
|
+ xFiled.set(majorProduction,getMbsUserIds((String) value));
|
|
|
+ break;
|
|
|
+ case "valueTiming":
|
|
|
+ case "saveFileDate":
|
|
|
+ case "deliveryDate":
|
|
|
+ xFiled.set(majorProduction,DateUtils.dateToLocalDate((Date) value));
|
|
|
+ break;
|
|
|
+ case "repertoryState":
|
|
|
+ String repertoryState = (String) value;
|
|
|
+ xFiled.set(majorProduction,repertoryState.equals("OUT"));
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ xFiled.set(majorProduction,value);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ mps.add(majorProduction);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (CollectionUtil.isNotEmpty(mts)){
|
|
|
+ majorTargetService.saveBatch(mts);
|
|
|
+ }
|
|
|
+ if (CollectionUtil.isNotEmpty(mps)){
|
|
|
+ majorProductionService.saveBatch(mps);
|
|
|
+ //更新报价反馈
|
|
|
+ List<PriceFeedbackDTO> feedbackDTOS = new ArrayList<>();
|
|
|
+ String statementNo = null;
|
|
|
+ for (MajorProduction majorProduction : mps){
|
|
|
+ if (majorProduction.getProduction().equals(ProductionEnum.STATEMENT.name())){
|
|
|
+ PriceFeedbackDTO feedbackDTO = new PriceFeedbackDTO();
|
|
|
+ feedbackDTO.setProduction(Arrays.asList(ProductionEnum.STATEMENT));
|
|
|
+ feedbackDTO.setMajorId(majorId);
|
|
|
+ feedbackDTO.setPrinting(majorProduction.getPrintTimes());
|
|
|
+ statementNo = majorProduction.getReportNo();
|
|
|
+ feedbackDTOS.add(feedbackDTO);
|
|
|
+ }
|
|
|
+ if (majorProduction.getProduction().equals(ProductionEnum.REPORT.name())){
|
|
|
+ PriceFeedbackDTO feedbackDTO = new PriceFeedbackDTO();
|
|
|
+ List<ProductionEnum> p = new ArrayList<>();
|
|
|
+ if (StrUtil.isNotEmpty(statementNo)){
|
|
|
+ p.add(ProductionEnum.STATEMENT);
|
|
|
+ }
|
|
|
+ p.add(ProductionEnum.REPORT);
|
|
|
+ feedbackDTO.setProduction(p);
|
|
|
+ feedbackDTO.setMajorId(majorId);
|
|
|
+ feedbackDTO.setPrinting(majorProduction.getPrintTimes());
|
|
|
+ feedbackDTO.setReportNo(statementNo);
|
|
|
+ feedbackDTOS.add(feedbackDTO);
|
|
|
+ }
|
|
|
+ if (majorProduction.getProduction().equals(ProductionEnum.LETTER.name())){
|
|
|
+ PriceFeedbackDTO feedbackDTO = new PriceFeedbackDTO();
|
|
|
+ List<ProductionEnum> p = new ArrayList<>();
|
|
|
+ if (StrUtil.isNotEmpty(statementNo)){
|
|
|
+ p.add(ProductionEnum.STATEMENT);
|
|
|
+ }
|
|
|
+ p.add(ProductionEnum.REPORT);
|
|
|
+ feedbackDTO.setProduction(p);
|
|
|
+ feedbackDTO.setMajorId(majorId);
|
|
|
+ feedbackDTO.setPrinting(majorProduction.getPrintTimes());
|
|
|
+ feedbackDTO.setReportNo(statementNo);
|
|
|
+ feedbackDTOS.add(feedbackDTO);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (CollectionUtil.isNotEmpty(feedbackDTOS)){
|
|
|
+ majorServiceImpl.update(new LambdaUpdateWrapper<Major>().set(Major::getFeedbackInfo,JSON.toJSONString(feedbackDTOS))
|
|
|
+ .eq(BaseEntity::getId,majorId));
|
|
|
+ }
|
|
|
+ return mps;
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ private String getProductionType(String value) {
|
|
|
+ if (value.contains(ProductionEnum.REPORT.getMsg())){
|
|
|
+ return ProductionEnum.REPORT.name();
|
|
|
+ }
|
|
|
+ if (value.contains(ProductionEnum.STATEMENT.getMsg())){
|
|
|
+ return ProductionEnum.STATEMENT.name();
|
|
|
+ }
|
|
|
+ return ProductionEnum.LETTER.name();
|
|
|
+ }
|
|
|
+
|
|
|
+ private Long doCreateMajorOrder(Map<String,Object> dyMajorOrder) throws NoSuchFieldException, IllegalAccessException {
|
|
|
Major major = new Major();
|
|
|
Class<Major> mClass = Major.class;
|
|
|
for (Map.Entry<String, String> entry : MAJOR_ORDER_COLUM.entrySet()){
|
|
@@ -353,18 +689,37 @@ public class DyoaHistoryServiceImpl implements IDyoaHistoryService{
|
|
|
private String getMbsUserIds(String userNames){
|
|
|
List<Long> userIds = new ArrayList<>();
|
|
|
Arrays.asList(userNames.split(",")).forEach(userName -> {
|
|
|
- Long mbsUserId = getMbsUserId(userName);
|
|
|
+ Long mbsUserId = getMbsUserId(userName.replaceAll(" ",""));
|
|
|
userIds.add(mbsUserId);
|
|
|
});
|
|
|
return JSON.toJSONString(userIds);
|
|
|
}
|
|
|
|
|
|
- private Long doCreateMajorInstanceNode(Long businessId,String dyoaNodeName){
|
|
|
+ private Long doCreateMajorInstanceNode(Long businessId,String dyoaNodeName,List<MajorProduction> productions){
|
|
|
+ String businessSubId = null;
|
|
|
+ String businessMinId = null;
|
|
|
+ if (CollectionUtil.isNotEmpty(productions)){
|
|
|
+ List<MajorProduction> statement = productions.stream().filter(x -> x.getProduction().equals(ProductionEnum.STATEMENT.name())).collect(Collectors.toList());
|
|
|
+ if (CollectionUtil.isNotEmpty(statement)){
|
|
|
+ businessSubId = statement.get(0).getReportNo();
|
|
|
+ }
|
|
|
+ List<MajorProduction> report = productions.stream().filter(x -> x.getProduction().equals(ProductionEnum.REPORT.name())).collect(Collectors.toList());
|
|
|
+ if (CollectionUtil.isNotEmpty(report)){
|
|
|
+ businessMinId = report.get(0).getReportNo();
|
|
|
+ }
|
|
|
+ List<MajorProduction> letter = productions.stream().filter(x -> x.getProduction().equals(ProductionEnum.LETTER.name())).collect(Collectors.toList());
|
|
|
+ if (CollectionUtil.isNotEmpty(letter)){
|
|
|
+ businessMinId = letter.get(0).getReportNo();
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
Long nodeId = getMbsWorkNodes(dyoaNodeName);
|
|
|
Long flowId = getMbsWorkFlows(MAJOR_BUSINESS.name());
|
|
|
WorkFlowNodeInstance instance = new WorkFlowNodeInstance();
|
|
|
instance.setFlowId(flowId);
|
|
|
instance.setBusinessId(businessId);
|
|
|
+ instance.setBusinessSubId(businessSubId);
|
|
|
+ instance.setBusinessMinId(businessMinId);
|
|
|
instance.setNodeId(nodeId);
|
|
|
instance.setBusinessType(MAJOR_BUSINESS.name());
|
|
|
instance.setSequence(0);
|