Commit 4f02a306 authored by hezhuozhi's avatar hezhuozhi

Merge remote-tracking branch 'origin/developer' into developer

parents 61d035e8 d75d6595
...@@ -10,6 +10,7 @@ import lombok.Value; ...@@ -10,6 +10,7 @@ import lombok.Value;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* *
...@@ -20,7 +21,7 @@ import java.util.List; ...@@ -20,7 +21,7 @@ import java.util.List;
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@Accessors(chain = true) @Accessors(chain = true)
@TableName("hygf_replenishment") @TableName(value="hygf_replenishment",autoResultMap = true)
public class HygfReplenishment extends BaseEntity { public class HygfReplenishment extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -41,6 +42,6 @@ public class HygfReplenishment extends BaseEntity { ...@@ -41,6 +42,6 @@ public class HygfReplenishment extends BaseEntity {
* 补货文件 * 补货文件
*/ */
@TableField(value = "file" , typeHandler = FastjsonTypeHandler.class) @TableField(value = "file" , typeHandler = FastjsonTypeHandler.class)
private List<Object> file; private List<Map> file;
} }
...@@ -151,7 +151,8 @@ public class PreparationMoney extends BaseEntity { ...@@ -151,7 +151,8 @@ public class PreparationMoney extends BaseEntity {
private List<PreparationMoneyLog> preparationMoneyLog; //发货单流水 private List<PreparationMoneyLog> preparationMoneyLog; //发货单流水
@TableField(exist = false) @TableField(exist = false)
private List<HygfReplenishmentDto> files; //发货单流水 private List<HygfReplenishment> files;
@TableField(exist = false) @TableField(exist = false)
private String instanceId; //发货单流水 private String instanceId; //发货单流水
......
...@@ -45,7 +45,9 @@ LEFT JOIN hygf_document_station on hygf_document_station.station_id=hygf_peasan ...@@ -45,7 +45,9 @@ LEFT JOIN hygf_document_station on hygf_document_station.station_id=hygf_peasan
hygf_peasant_household.peasant_household_no as peasantHouseholdNo, hygf_peasant_household.peasant_household_no as peasantHouseholdNo,
hygf_peasant_household.owners_name as ownersName, hygf_peasant_household.owners_name as ownersName,
hygf_peasant_household.regional_companies_name as regionalCompaniesName, hygf_peasant_household.regional_companies_name as regionalCompaniesName,
hygf_peasant_household.regional_companies_seq as regionalCompaniesSeq,
hygf_peasant_household.developer_name as developerName, hygf_peasant_household.developer_name as developerName,
hygf_peasant_household.developer_id as developeId,
hygf_peasant_household.sequence_nbr as sequenceNbr, hygf_peasant_household.sequence_nbr as sequenceNbr,
concat_ws('/',hygf_peasant_household.project_address_name,hygf_peasant_household.project_address_detail) as address, concat_ws('/',hygf_peasant_household.project_address_name,hygf_peasant_household.project_address_detail) as address,
hygf_peasant_household.project_address_name as sequenceNbr, hygf_peasant_household.project_address_name as sequenceNbr,
......
...@@ -30,11 +30,13 @@ import com.yeejoin.amos.boot.module.hygf.api.entity.FinancingRectificationOrder; ...@@ -30,11 +30,13 @@ import com.yeejoin.amos.boot.module.hygf.api.entity.FinancingRectificationOrder;
import com.yeejoin.amos.boot.module.hygf.api.entity.StdUserEmpower; import com.yeejoin.amos.boot.module.hygf.api.entity.StdUserEmpower;
import com.yeejoin.amos.boot.module.hygf.api.mapper.FinancingInfoMapper; import com.yeejoin.amos.boot.module.hygf.api.mapper.FinancingInfoMapper;
import com.yeejoin.amos.boot.module.hygf.api.service.IFinancingInfoService; import com.yeejoin.amos.boot.module.hygf.api.service.IFinancingInfoService;
import com.yeejoin.amos.boot.module.hygf.api.util.RedisLockUtil;
import com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO; import com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO;
import com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO; import com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO;
import com.yeejoin.amos.feign.workflow.model.ProcessTaskDTO; import com.yeejoin.amos.feign.workflow.model.ProcessTaskDTO;
import com.yeejoin.amos.feign.workflow.model.TaskResultDTO; import com.yeejoin.amos.feign.workflow.model.TaskResultDTO;
import io.seata.spring.annotation.GlobalTransactional; import io.seata.spring.annotation.GlobalTransactional;
import org.apache.commons.lang3.BooleanUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -42,6 +44,7 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -42,6 +44,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import javax.annotation.Resource;
import java.util.*; import java.util.*;
/** /**
...@@ -71,6 +74,9 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina ...@@ -71,6 +74,9 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina
@Autowired @Autowired
private CommonServiceImpl commonService; private CommonServiceImpl commonService;
@Resource(type = RedisLockUtil.class)
private RedisLockUtil redisLockUtil;
@UserLimits @UserLimits
public Page<Map<String, Object>> queryForFinancingInfoPage(Page<Map<String, Object>> page, String type, String status, String regionalCompaniesCode, String ownersName) { public Page<Map<String, Object>> queryForFinancingInfoPage(Page<Map<String, Object>> page, String type, String status, String regionalCompaniesCode, String ownersName) {
StdUserEmpower orgCode = (StdUserEmpower) redisUtils.get("Emp_" + RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())); StdUserEmpower orgCode = (StdUserEmpower) redisUtils.get("Emp_" + RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken()));
...@@ -115,6 +121,13 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina ...@@ -115,6 +121,13 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina
} }
public FinancingInfoDto saveModel(FinancingInfoDto model) { public FinancingInfoDto saveModel(FinancingInfoDto model) {
String lockName = String.format("LockName:powerStationExamine");
try{
Boolean isLocked = redisLockUtil.tryLock(lockName, lockName, 10, 1);
if (BooleanUtils.isNotTrue(isLocked)) {
throw new com.yeejoin.amos.component.robot.BadRequest("其他用户正在操作,请刷新后再试!");
}
List<String> ids; List<String> ids;
if (model.getPeasantHouseholdIds().contains(",")) { if (model.getPeasantHouseholdIds().contains(",")) {
ids = Arrays.asList(model.getPeasantHouseholdIds().split(",")); ids = Arrays.asList(model.getPeasantHouseholdIds().split(","));
...@@ -179,12 +192,12 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina ...@@ -179,12 +192,12 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina
map.put("instanceId",financingInfos1.getInstanceId()); map.put("instanceId",financingInfos1.getInstanceId());
this.execueFlow(map); this.execueFlow(map);
} }
//发起待办 //发起待办
// commonService.buildTaskModel(buildDZTRZTaskModel(model, workflowResultDto, date)); // commonService.buildTaskModel(buildDZTRZTaskModel(model, workflowResultDto, date));
}); });
}finally {
redisLockUtil.releaseLock(lockName);
}
return model; return model;
} }
......
...@@ -190,19 +190,13 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto ...@@ -190,19 +190,13 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
List<DocumentStation> li = documentStationMapper.selectList(q); List<DocumentStation> li = documentStationMapper.selectList(q);
preparationMoney.setPeasantHouseholdId(li); preparationMoney.setPeasantHouseholdId(li);
List<HygfReplenishment> hygfReplenishments = new ArrayList<>();
List<HygfReplenishmentDto> hygfReplenishmentDtos = hygfReplenishmentMapper.selectData(sequenceNbr);
if (CollectionUtil.isNotEmpty(hygfReplenishmentDtos) && !hygfReplenishmentDtos.isEmpty() ){ LambdaQueryWrapper<HygfReplenishment> files = new LambdaQueryWrapper<>();
files.eq(HygfReplenishment::getPreparationMoneyId,sequenceNbr);
List<HygfReplenishment> hygfReplenishments1 = hygfReplenishmentMapper.selectList(files);
hygfReplenishmentDtos.forEach(e->{ if (CollectionUtil.isNotEmpty(hygfReplenishments1) && !hygfReplenishments1.isEmpty() ){
HygfReplenishment hygfReplenishment = new HygfReplenishment(); preparationMoney.setFiles(hygfReplenishments1);
BeanUtils.copyProperties(e,hygfReplenishment);
hygfReplenishment.setFile(JSON.parseArray(e.getFile()));
hygfReplenishments.add(hygfReplenishment);
});
preparationMoney.setFiles(hygfReplenishmentDtos);
} }
return preparationMoney; return preparationMoney;
...@@ -321,22 +315,14 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto ...@@ -321,22 +315,14 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
Map<String, Object> map2 = Bean.BeantoMap(preparationMoney); Map<String, Object> map2 = Bean.BeantoMap(preparationMoney);
List<HygfReplenishment> hygfReplenishments = new ArrayList<>(); LambdaQueryWrapper<HygfReplenishment> files = new LambdaQueryWrapper<>();
List<HygfReplenishmentDto> hygfReplenishmentDtos = hygfReplenishmentMapper.selectData(Long.valueOf(sequenceNbr)); files.eq(HygfReplenishment::getPreparationMoneyId,sequenceNbr);
List<HygfReplenishment> hygfReplenishments = hygfReplenishmentMapper.selectList(files);
if (CollectionUtil.isNotEmpty(hygfReplenishmentDtos) && !hygfReplenishmentDtos.isEmpty() ) {
hygfReplenishmentDtos.forEach(e -> { if (CollectionUtil.isNotEmpty(hygfReplenishments) && !hygfReplenishments.isEmpty() ){
HygfReplenishment hygfReplenishment = new HygfReplenishment();
BeanUtils.copyProperties(e, hygfReplenishment);
hygfReplenishment.setFile(JSON.parseArray(e.getFile()));
hygfReplenishments.add(hygfReplenishment);
});
map2.put("files",hygfReplenishments); map2.put("files",hygfReplenishments);
} }
map.put("preparationMoney", map2); map.put("preparationMoney", map2);
map.put("designInformation", designInformation); map.put("designInformation", designInformation);
Map<String, Object> map1 = new HashMap<>(); Map<String, Object> map1 = new HashMap<>();
......
...@@ -315,6 +315,8 @@ public class SurveyInformationServiceImpl ...@@ -315,6 +315,8 @@ public class SurveyInformationServiceImpl
} }
peasantHouseholdServiceImpl.saveOrUpdate(peasantHousehold); peasantHouseholdServiceImpl.saveOrUpdate(peasantHousehold);
} catch (BadRequest e1) {
throw e1;
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} finally { } finally {
......
...@@ -126,7 +126,7 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W ...@@ -126,7 +126,7 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
} }
if (!workorderPeasant.isEmpty()) { if (!workorderPeasant.isEmpty()) {
String names = workorderPeasant.stream().map(i -> i.getOwnersName()).collect(Collectors.joining(",")); String names = workorderPeasant.stream().map(i -> i.getOwnersName()).collect(Collectors.joining(","));
throw new Exception("电站" + names + ",已被工单关联"); throw new Exception("电站" + names + ",已被工单关联,请重新选择电站");
} }
// 保存派工单 // 保存派工单
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment