Commit 0a1ed137 authored by suhuiguang's avatar suhuiguang

Merge branch 'develop_tzs_register' into develop_tzs_register_jyjc

parents 526e32fc be739e04
...@@ -26,7 +26,7 @@ public interface IJgInstallationNoticeService extends IService<JgInstallationNot ...@@ -26,7 +26,7 @@ public interface IJgInstallationNoticeService extends IService<JgInstallationNot
* @param sequenceNbr 主键 * @param sequenceNbr 主键
* @return 安装告知 * @return 安装告知
*/ */
Map<String, Map<String, Object>> queryBySequenceNbr(Long sequenceNbr); Map<String, Map<String, Object>> queryBySequenceNbr(Long sequenceNbr, String companyLevel);
/** /**
* 更新安装告知 * 更新安装告知
......
...@@ -19,7 +19,7 @@ import java.util.Map; ...@@ -19,7 +19,7 @@ import java.util.Map;
*/ */
public interface IJgTransferNoticeService extends IService<JgTransferNotice> { public interface IJgTransferNoticeService extends IService<JgTransferNotice> {
Map<String, Map<String, Object>> queryBySequenceNbr(Long sequenceNbr); Map<String, Map<String, Object>> queryBySequenceNbr(Long sequenceNbr, String companyLevel);
JgTransferNoticeDto updateTransferNotice(String submitType, JgTransferNoticeDto noticeDto, String op); JgTransferNoticeDto updateTransferNotice(String submitType, JgTransferNoticeDto noticeDto, String op);
......
...@@ -122,8 +122,8 @@ ...@@ -122,8 +122,8 @@
fi.factory_standard AS factoryStandard, fi.factory_standard AS factoryStandard,
fi.product_quality_yield_prove AS productQualityYieldProve, fi.product_quality_yield_prove AS productQualityYieldProve,
fi.ins_use_maintain_explain AS insUseMaintainExplain, fi.ins_use_maintain_explain AS insUseMaintainExplain,
ei.legal_person AS safetyManager, ei.use_contact AS safetyManager,
ei.legal_phone AS safetyManagerPhone, ei.contact_phone AS safetyManagerPhone,
ei.address AS address, ei.address AS address,
ei.use_code AS useCode, ei.use_code AS useCode,
isn.install_unit_credit_code AS installUnitCreditCode, isn.install_unit_credit_code AS installUnitCreditCode,
......
...@@ -154,15 +154,16 @@ ...@@ -154,15 +154,16 @@
fi.factory_standard AS factoryStandard, fi.factory_standard AS factoryStandard,
fi.product_quality_yield_prove AS productQualityYieldProve, fi.product_quality_yield_prove AS productQualityYieldProve,
fi.ins_use_maintain_explain AS insUseMaintainExplain, fi.ins_use_maintain_explain AS insUseMaintainExplain,
ei.legal_person AS safetyManager, ei.use_contact AS safetyManager,
ei.legal_phone AS safetyManagerPhone, ei.contact_phone AS safetyManagerPhone,
ui.PROVINCE_NAME AS useUnitProvinceName, ui.PROVINCE_NAME AS useUnitProvinceName,
ui.CITY_NAME AS useUnitCityName, ui.CITY_NAME AS useUnitCityName,
ui.COUNTY_NAME AS useUnitCountyName, ui.COUNTY_NAME AS useUnitCountyName,
ui.ADDRESS AS useUnitAddress, ui.ADDRESS AS useUnitAddress,
eio.use_code AS useCode, eio.use_code AS useCode,
idi.INSPECT_REPORT as inspectReport, idi.INSPECT_REPORT as inspectReport,
re.equ_id as equId re.equ_id as equId,
ei.address as useUnitLeaderAddress
FROM FROM
tzs_jg_transfer_notice tjtn tzs_jg_transfer_notice tjtn
LEFT JOIN tzs_jg_transfer_notice_eq re ON re.equip_transfer_id = tjtn.sequence_nbr LEFT JOIN tzs_jg_transfer_notice_eq re ON re.equip_transfer_id = tjtn.sequence_nbr
......
...@@ -120,7 +120,8 @@ public class JgInstallationNoticeController extends BaseController { ...@@ -120,7 +120,8 @@ public class JgInstallationNoticeController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询单个安装告知", notes = "根据sequenceNbr查询单个安装告知") @ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询单个安装告知", notes = "根据sequenceNbr查询单个安装告知")
public ResponseModel<Map<String, public ResponseModel<Map<String,
Map<String, Object>>> selectOne(@RequestParam("sequenceNbr") Long sequenceNbr) { Map<String, Object>>> selectOne(@RequestParam("sequenceNbr") Long sequenceNbr) {
return ResponseHelper.buildResponse(iJgInstallationNoticeService.queryBySequenceNbr(sequenceNbr)); String companyLevel = (String) iJgInstallationNoticeService.getCompanyType().get("companyLevel");
return ResponseHelper.buildResponse(iJgInstallationNoticeService.queryBySequenceNbr(sequenceNbr, companyLevel));
} }
......
...@@ -134,7 +134,8 @@ public class JgTransferNoticeController extends BaseController { ...@@ -134,7 +134,8 @@ public class JgTransferNoticeController extends BaseController {
@GetMapping(value = "/details") @GetMapping(value = "/details")
@ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询单个移装造告知", notes = "根据sequenceNbr查询单个移装造告知") @ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询单个移装造告知", notes = "根据sequenceNbr查询单个移装造告知")
public ResponseModel<Map<String, Map<String, Object>>> selectOne(@RequestParam Long sequenceNbr) { public ResponseModel<Map<String, Map<String, Object>>> selectOne(@RequestParam Long sequenceNbr) {
return ResponseHelper.buildResponse(jgTransferNoticeService.queryBySequenceNbr(sequenceNbr)); String companyLevel = (String) iJgInstallationNoticeService.getCompanyType().get("companyLevel");
return ResponseHelper.buildResponse(jgTransferNoticeService.queryBySequenceNbr(sequenceNbr, companyLevel));
} }
......
...@@ -234,9 +234,9 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -234,9 +234,9 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
if (!ValidationUtil.isEmpty(equipParamsMap)) { if (!ValidationUtil.isEmpty(equipParamsMap)) {
// 给技术参数中添加设备种类,标记技术参数属于那个设备 // 给技术参数中添加设备种类,标记技术参数属于那个设备
equipParamsMap.put("EQU_LIST",equIpClassMap.get("EQU_LIST").toString()); equipParamsMap.put("EQU_LIST", String.valueOf(equIpClassMap.get("EQU_LIST")));
equipParamsMap.put("EQU_CATEGORY",equIpClassMap.get("EQU_CATEGORY").toString()); equipParamsMap.put("EQU_CATEGORY", String.valueOf(equIpClassMap.get("EQU_CATEGORY")));
equipParamsMap.put("EQU_DEFINE",equIpClassMap.get("EQU_DEFINE").toString()); equipParamsMap.put("EQU_DEFINE", String.valueOf(equIpClassMap.get("EQU_DEFINE")));
resultMap.put(EQUIP_PARAMS_FORM_ID, equipParamsMap); resultMap.put(EQUIP_PARAMS_FORM_ID, equipParamsMap);
} }
} }
......
...@@ -134,6 +134,9 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -134,6 +134,9 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
IIdxBizJgUseInfoService useInfoService; IIdxBizJgUseInfoService useInfoService;
@Autowired @Autowired
IdxBizJgUseInfoMapper idxBizJgUseInfoMapper;
@Autowired
private DataDictionaryMapper dataDictionaryMapper; private DataDictionaryMapper dataDictionaryMapper;
@Autowired @Autowired
...@@ -168,7 +171,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -168,7 +171,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
* @return 安装告知 * @return 安装告知
*/ */
@Override @Override
public Map<String, Map<String, Object>> queryBySequenceNbr(Long sequenceNbr) { public Map<String, Map<String, Object>> queryBySequenceNbr(Long sequenceNbr, String companyLevel) {
// 安装告知信息 // 安装告知信息
JgInstallationNotice notice = jgInstallationNoticeMapper.selectById(sequenceNbr); JgInstallationNotice notice = jgInstallationNoticeMapper.selectById(sequenceNbr);
if (Objects.isNull(notice)) { if (Objects.isNull(notice)) {
...@@ -217,9 +220,9 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -217,9 +220,9 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
equInfo.put("inspectReport", JSON.parse(String.valueOf(detail.get("inspectReport")))); equInfo.put("inspectReport", JSON.parse(String.valueOf(detail.get("inspectReport"))));
equInfo.put("designStandard", JSON.parse(String.valueOf(detail.get("designStandard")))); equInfo.put("designStandard", JSON.parse(String.valueOf(detail.get("designStandard"))));
equInfo.put("designDoc", JSON.parse(String.valueOf(detail.get("designDoc")))); equInfo.put("designDoc", JSON.parse(String.valueOf(detail.get("designDoc"))));
BeanUtil.copyProperties(equInfo, detail); BeanUtil.copyProperties(equInfo, detail);
BeanUtil.copyProperties(installationInfo, detail, "equList", "supervisoryCode", "factoryNum", "equRegisterCode"); BeanUtil.copyProperties(installationInfo, detail, "equList", "supervisoryCode", "factoryNum", "equRegisterCode");
detail.put("companyLevel", companyLevel);
return new HashMap<String, Map<String, Object>>() {{ return new HashMap<String, Map<String, Object>>() {{
this.put("installationInfo", detail); this.put("installationInfo", detail);
}}; }};
...@@ -861,7 +864,12 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -861,7 +864,12 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
map1.put("USE_UNIT_NAME",jgInstallationNotice.getUseUnitName()); map1.put("USE_UNIT_NAME",jgInstallationNotice.getUseUnitName());
map1.put("USC_UNIT_CREDIT_CODE",jgInstallationNotice.getInstallUnitCreditCode()); map1.put("USC_UNIT_CREDIT_CODE",jgInstallationNotice.getInstallUnitCreditCode());
map1.put("USC_UNIT_NAME",jgInstallationNotice.getInstallUnitName()); map1.put("USC_UNIT_NAME",jgInstallationNotice.getInstallUnitName());
objMap.put(tzsJgOtherInfo.getRecord(),map1); // 安装告知去除该字段,使用登记时添加
// map1.put("ORG_BRANCH_CODE",jgInstallationNotice.getOrgBranchCode());
// map1.put("ORG_BRANCH_NAME",jgInstallationNotice.getOrgBranchCode());
map1.put("USE_PLACE",String.format("%s/%s/%s", jgInstallationNotice.getProvinceName(), jgInstallationNotice.getCityName(), jgInstallationNotice.getCounty()));
map1.put("ADDRESS",String.format("%s/%s", jgInstallationNotice.getStreetName(), jgInstallationNotice.getAddress()));
objMap.put(tzsJgOtherInfo.getRecord(), map1);
jgInstallationNotice.setPromoter(""); jgInstallationNotice.setPromoter("");
tzsServiceFeignClient.commonUpdateEsDataByIds(objMap); tzsServiceFeignClient.commonUpdateEsDataByIds(objMap);
tzsJgOtherInfoMapper.updateById(tzsJgOtherInfo); tzsJgOtherInfoMapper.updateById(tzsJgOtherInfo);
...@@ -890,19 +898,30 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -890,19 +898,30 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
useInfo.setIsNotXiXian(jgInstallationNotice.getIsXixian() == null ? "0" : jgInstallationNotice.getIsXixian()); useInfo.setIsNotXiXian(jgInstallationNotice.getIsXixian() == null ? "0" : jgInstallationNotice.getIsXixian());
useInfoService.saveOrUpdateData(useInfo); useInfoService.saveOrUpdateData(useInfo);
} }
// 修改属地 // 修改属地 - 字段去除
LambdaUpdateWrapper<SuperviseInfo> lambdaUpdateWrapper = new LambdaUpdateWrapper<>(); // LambdaUpdateWrapper<SuperviseInfo> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
lambdaUpdateWrapper.eq(SuperviseInfo::getRecord, jgRelationEquip.getEquId()); // lambdaUpdateWrapper.eq(SuperviseInfo::getRecord, jgRelationEquip.getEquId());
SuperviseInfo superviseInfo = new SuperviseInfo(); // SuperviseInfo superviseInfo = new SuperviseInfo();
superviseInfo.setOrgBranchName(jgInstallationNotice.getOrgBranchName()); // superviseInfo.setOrgBranchName(jgInstallationNotice.getOrgBranchName());
superviseInfo.setOrgBranchCode(jgInstallationNotice.getOrgBranchCode()); // superviseInfo.setOrgBranchCode(jgInstallationNotice.getOrgBranchCode());
superviseInfoMapper.update(superviseInfo, lambdaUpdateWrapper); // superviseInfoMapper.update(superviseInfo, lambdaUpdateWrapper);
HashMap<String, Object> hashMap = new HashMap<>(); // 修改使用信息
Map<String,Map<String,Object>> superMap = new HashMap<>(); LambdaUpdateWrapper<IdxBizJgUseInfo> lambda = new LambdaUpdateWrapper<>();
hashMap.put("ORG_BRANCH_CODE",jgInstallationNotice.getOrgBranchCode()); lambda.eq(IdxBizJgUseInfo::getRecord, jgRelationEquip.getEquId());
hashMap.put("ORG_BRANCH_NAME",jgInstallationNotice.getOrgBranchCode()); IdxBizJgUseInfo idxBizJgUseInfo = new IdxBizJgUseInfo();
superMap.put(jgRelationEquip.getEquId(), hashMap); idxBizJgUseInfo.setProvince(jgInstallationNotice.getProvince());
tzsServiceFeignClient.commonUpdateEsDataByIds(superMap); idxBizJgUseInfo.setProvinceName(jgInstallationNotice.getProvinceName());
idxBizJgUseInfo.setCity(jgInstallationNotice.getCity());
idxBizJgUseInfo.setCityName(jgInstallationNotice.getCityName());
idxBizJgUseInfo.setCounty(jgInstallationNotice.getCounty());
idxBizJgUseInfo.setCountyName(jgInstallationNotice.getCountyName());
idxBizJgUseInfo.setFactoryUseSiteStreet(jgInstallationNotice.getFactoryUseSiteStreet());
idxBizJgUseInfo.setStreetName(jgInstallationNotice.getStreetName());
idxBizJgUseInfo.setAddress(jgInstallationNotice.getAddress());
idxBizJgUseInfo.setIsNotXiXian(jgInstallationNotice.getIsXixian());
idxBizJgUseInfoMapper.update(idxBizJgUseInfo, lambda);
// 上个代办改为已办 // 上个代办改为已办
HashMap<String, Object> taskMap = new HashMap<>(); HashMap<String, Object> taskMap = new HashMap<>();
taskMap.put("taskStatus", FlowStatusEnum.TO_BE_FINISHED.getCode()); taskMap.put("taskStatus", FlowStatusEnum.TO_BE_FINISHED.getCode());
......
...@@ -24,6 +24,7 @@ import com.yeejoin.amos.boot.module.jg.api.service.IJgMaintenanceContractService ...@@ -24,6 +24,7 @@ import com.yeejoin.amos.boot.module.jg.api.service.IJgMaintenanceContractService
import com.yeejoin.amos.boot.module.jg.api.vo.JgMaintenanceContractVo; import com.yeejoin.amos.boot.module.jg.api.vo.JgMaintenanceContractVo;
import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient; import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient;
import com.yeejoin.amos.boot.module.jg.biz.service.ICmWorkflowService; import com.yeejoin.amos.boot.module.jg.biz.service.ICmWorkflowService;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgMaintenanceRecordInfo;
import com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum;
import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum;
import com.yeejoin.amos.feign.systemctl.model.TaskV2Model; import com.yeejoin.amos.feign.systemctl.model.TaskV2Model;
...@@ -81,6 +82,9 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC ...@@ -81,6 +82,9 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
@Autowired @Autowired
IJgInstallationNoticeService jrmInstallationNoticeService; IJgInstallationNoticeService jrmInstallationNoticeService;
@Autowired
private IdxBizJgMaintenanceRecordInfoServiceImpl idxBizJgMaintenanceRecordInfoService;
/** /**
* 分页查询 * 分页查询
*/ */
...@@ -507,10 +511,39 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC ...@@ -507,10 +511,39 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
contract.setApplyDate(new Date()); contract.setApplyDate(new Date());
contract.setStatus(taskCode); contract.setStatus(taskCode);
updateTaskModel(contract, "0"); updateTaskModel(contract, "0");
// 添加设备维保信息
updateEquipMessage(contract.getSequenceNbr());
} }
this.getBaseMapper().updateById(contract); this.getBaseMapper().updateById(contract);
} }
/**
* 流程结束后添加设备维保信息
*
* @param id
*/
private void updateEquipMessage(Long id) {
JgMaintenanceContract jgMaintenanceContract = this.getBaseMapper().selectById(id);
LambdaQueryWrapper<JgMaintenanceContractEq> lambda = new QueryWrapper<JgMaintenanceContractEq>().lambda();
lambda.eq(JgMaintenanceContractEq::getEquipTransferId, id);
List<JgMaintenanceContractEq> list = jgMaintenanceContractEqService.getBaseMapper().selectList(lambda);
ArrayList<IdxBizJgMaintenanceRecordInfo> data = new ArrayList<>();
list.forEach(item -> {
IdxBizJgMaintenanceRecordInfo info = new IdxBizJgMaintenanceRecordInfo();
info.setRecord(item.getEquId());
info.setMeUnitName(ObjectUtils.isEmpty(jgMaintenanceContract.getMaintenanceUnitName()) ? null : jgMaintenanceContract.getMaintenanceUnitName());
info.setMeUnitCreditCode(ObjectUtils.isEmpty(jgMaintenanceContract.getMaintenanceUnitCode()) ? null : jgMaintenanceContract.getMaintenanceUnitCode());
info.setMeMaster(ObjectUtils.isEmpty(jgMaintenanceContract.getMaintenanceManagerOneName()) ? null : jgMaintenanceContract.getMaintenanceManagerOneName());
info.setEmergencycall(ObjectUtils.isEmpty(jgMaintenanceContract.getMaintenanceManagerOnePhone()) ? null : jgMaintenanceContract.getMaintenanceManagerOnePhone());
info.setInformStart(ObjectUtils.isEmpty(jgMaintenanceContract.getInformStart()) ? null : jgMaintenanceContract.getInformStart());
info.setInformEnd(ObjectUtils.isEmpty(jgMaintenanceContract.getInformEnd()) ? null : jgMaintenanceContract.getInformEnd());
info.setRepairInform(ObjectUtils.isEmpty(jgMaintenanceContract.getMaintenanceContract()) ? null : jgMaintenanceContract.getMaintenanceContract());
data.add(info);
});
idxBizJgMaintenanceRecordInfoService.saveBatch(data);
}
private TaskV2Model updateTaskModel(JgMaintenanceContract contract, String operate) { private TaskV2Model updateTaskModel(JgMaintenanceContract contract, String operate) {
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
FlowStatusEnum flowStatusEnum = this.getTaskStatus(operate); FlowStatusEnum flowStatusEnum = this.getTaskStatus(operate);
......
...@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON; ...@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 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.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils; import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
...@@ -25,6 +26,7 @@ import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient; ...@@ -25,6 +26,7 @@ import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient;
import com.yeejoin.amos.boot.module.jg.biz.service.ICmWorkflowService; import com.yeejoin.amos.boot.module.jg.biz.service.ICmWorkflowService;
import com.yeejoin.amos.boot.module.jg.biz.utils.ImageUtils; import com.yeejoin.amos.boot.module.jg.biz.utils.ImageUtils;
import com.yeejoin.amos.boot.module.jg.biz.utils.WordTemplateUtils; import com.yeejoin.amos.boot.module.jg.biz.utils.WordTemplateUtils;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgUseInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.RegistrationInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.RegistrationInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseUnitLicence; import com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseUnitLicence;
import com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum;
...@@ -98,6 +100,10 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto ...@@ -98,6 +100,10 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
@Autowired @Autowired
ICmWorkflowService iCmWorkflowService; ICmWorkflowService iCmWorkflowService;
@Autowired
IdxBizJgUseInfoMapper idxBizJgUseInfoMapper;
/** /**
* 根据sequenceNbr查询 * 根据sequenceNbr查询
* *
...@@ -105,7 +111,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto ...@@ -105,7 +111,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
* @return 移装告知 * @return 移装告知
*/ */
@Override @Override
public Map<String, Map<String, Object>> queryBySequenceNbr(Long sequenceNbr) { public Map<String, Map<String, Object>> queryBySequenceNbr(Long sequenceNbr, String companyLevel) {
// 移装告知信息 // 移装告知信息
JgTransferNotice notice = jgTransferNoticeMapper.selectById(sequenceNbr); JgTransferNotice notice = jgTransferNoticeMapper.selectById(sequenceNbr);
if (Objects.isNull(notice)) { if (Objects.isNull(notice)) {
...@@ -153,6 +159,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto ...@@ -153,6 +159,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
equInfo.put("designDoc", JSON.parse(String.valueOf(detail.get("designDoc")))); equInfo.put("designDoc", JSON.parse(String.valueOf(detail.get("designDoc"))));
BeanUtil.copyProperties(equInfo, detail); BeanUtil.copyProperties(equInfo, detail);
BeanUtil.copyProperties(transferNotice, detail, "equList", "supervisoryCode"); BeanUtil.copyProperties(transferNotice, detail, "equList", "supervisoryCode");
detail.put("companyLevel", companyLevel);
return new HashMap<String, Map<String, Object>>() {{ return new HashMap<String, Map<String, Object>>() {{
this.put("transferNoticeInfo", detail); this.put("transferNoticeInfo", detail);
}}; }};
...@@ -708,6 +715,30 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto ...@@ -708,6 +715,30 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
jgTransferNotice.setHandleDate(new Date()); jgTransferNotice.setHandleDate(new Date());
jgTransferNotice.setNoticeStatus(String.valueOf(FlowStatusEnum.TO_BE_FINISHED.getCode())); jgTransferNotice.setNoticeStatus(String.valueOf(FlowStatusEnum.TO_BE_FINISHED.getCode()));
this.generateTransferNoticeReport(jgTransferNotice.getSequenceNbr()); this.generateTransferNoticeReport(jgTransferNotice.getSequenceNbr());
Map<String,Object> map1 =new HashMap<>();
Map<String,Map<String,Object>> objMap = new HashMap<>();
map1.put("USE_PLACE",String.format("%s/%s/%s", jgTransferNotice.getProvinceName(), jgTransferNotice.getCityName(), jgTransferNotice.getCounty()));
map1.put("ADDRESS",String.format("%s/%s", jgTransferNotice.getStreetName(), jgTransferNotice.getAddress()));
objMap.put(jgTransferNoticeEq.getEquId(), map1);
tzsServiceFeignClient.commonUpdateEsDataByIds(objMap);
// 修改使用信息
LambdaUpdateWrapper<IdxBizJgUseInfo> lambda = new LambdaUpdateWrapper<>();
lambda.eq(IdxBizJgUseInfo::getRecord, jgTransferNoticeEq.getEquId());
IdxBizJgUseInfo idxBizJgUseInfo = new IdxBizJgUseInfo();
idxBizJgUseInfo.setProvince(jgTransferNotice.getProvince());
idxBizJgUseInfo.setProvinceName(jgTransferNotice.getProvinceName());
idxBizJgUseInfo.setCity(jgTransferNotice.getCity());
idxBizJgUseInfo.setCityName(jgTransferNotice.getCityName());
idxBizJgUseInfo.setCounty(jgTransferNotice.getCounty());
idxBizJgUseInfo.setCountyName(jgTransferNotice.getCountyName());
idxBizJgUseInfo.setFactoryUseSiteStreet(jgTransferNotice.getFactoryUseSiteStreet());
idxBizJgUseInfo.setStreetName(jgTransferNotice.getStreetName());
idxBizJgUseInfo.setAddress(jgTransferNotice.getAddress());
idxBizJgUseInfo.setIsNotXiXian(jgTransferNotice.getIsXixian());
idxBizJgUseInfoMapper.update(idxBizJgUseInfo, lambda);
// 上个代办改为已办 // 上个代办改为已办
HashMap<String, Object> taskMap = new HashMap<>(); HashMap<String, Object> taskMap = new HashMap<>();
taskMap.put("taskStatus", FlowStatusEnum.TO_BE_FINISHED.getCode()); taskMap.put("taskStatus", FlowStatusEnum.TO_BE_FINISHED.getCode());
......
...@@ -92,6 +92,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -92,6 +92,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
CommonServiceImpl commonServiceImpl; CommonServiceImpl commonServiceImpl;
@Autowired @Autowired
CmWorkflowServiceImpl cmWorkflowService; CmWorkflowServiceImpl cmWorkflowService;
@Autowired
IdxBizJgSupervisionInfoMapper idxBizJgSupervisionInfoMapper;
private static final String DEFINITION_KEY = "useRegistration"; private static final String DEFINITION_KEY = "useRegistration";
...@@ -166,8 +168,17 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -166,8 +168,17 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
LambdaQueryWrapper<InspectionDetectionInfo> inspectionLambda = new QueryWrapper<InspectionDetectionInfo>().lambda(); LambdaQueryWrapper<InspectionDetectionInfo> inspectionLambda = new QueryWrapper<InspectionDetectionInfo>().lambda();
inspectionLambda.eq(InspectionDetectionInfo::getRecord, map.get("equipId")); inspectionLambda.eq(InspectionDetectionInfo::getRecord, map.get("equipId"));
// 更新检验检测信息 // 更新检验检测信息
inspectionDetectionInfo.setInspectReport(null); // inspectionDetectionInfo.setInspectReport(null);
inspectionDetectionInfoMapper.update(inspectionDetectionInfo, inspectionLambda); inspectionDetectionInfoMapper.update(inspectionDetectionInfo, inspectionLambda);
// 更新设备监管部门
IdxBizJgSupervisionInfo idxBizJgSupervisionInfo = new IdxBizJgSupervisionInfo();
if (map.containsKey("orgBranchCode") && !ObjectUtils.isEmpty(map.get("orgBranchCode"))) {
String[] data = String.valueOf(map.getString("orgBranchCode")).split("_");
idxBizJgSupervisionInfo.setOrgBranchCode(data[0]);
idxBizJgSupervisionInfo.setOrgBranchName(data[1]);
LambdaQueryWrapper<IdxBizJgSupervisionInfo> eq = new QueryWrapper<IdxBizJgSupervisionInfo>().lambda().eq(IdxBizJgSupervisionInfo::getRecord, map.get("equipId"));
idxBizJgSupervisionInfoMapper.update(idxBizJgSupervisionInfo, eq);
}
// 更新设备使用登记证 // 更新设备使用登记证
idxBizJgRegisterInfoMapper.updateUseOrgCodeByEquip(String.valueOf(map.get("equipId")), useOrgCode); idxBizJgRegisterInfoMapper.updateUseOrgCodeByEquip(String.valueOf(map.get("equipId")), useOrgCode);
// 更新es // 更新es
...@@ -274,6 +285,12 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -274,6 +285,12 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
jgUseRegistration.setUseUnitCreditCode(null); jgUseRegistration.setUseUnitCreditCode(null);
jgUseRegistration.setSequenceNbr(Long.valueOf(String.valueOf(map.get("sequenceNbr")))); jgUseRegistration.setSequenceNbr(Long.valueOf(String.valueOf(map.get("sequenceNbr"))));
this.getBaseMapper().updateById(jgUseRegistration); this.getBaseMapper().updateById(jgUseRegistration);
// 更新设备关联表
LambdaQueryWrapper<JgUseRegistrationEq> lambda = new QueryWrapper<JgUseRegistrationEq>().lambda();
lambda.eq(JgUseRegistrationEq::getEquipTransferId, jgUseRegistration.getSequenceNbr());
JgUseRegistrationEq jgUseRegistrationEq = new JgUseRegistrationEq();
jgUseRegistrationEq.setEquId(map.get("equipId").toString());
jgRelationEquipMapper.update(jgUseRegistrationEq, lambda);
} else { } else {
// 业务管理设备信息保存 // 业务管理设备信息保存
......
...@@ -143,7 +143,7 @@ public class JyjcInspectionApplication extends BaseEntity { ...@@ -143,7 +143,7 @@ public class JyjcInspectionApplication extends BaseEntity {
/** /**
* 工作流实例ID * 工作流实例ID
*/ */
@TableField("process_instance_id") @TableField("instance_id")
private String processInstanceId; private String processInstanceId;
/** /**
...@@ -197,4 +197,7 @@ public class JyjcInspectionApplication extends BaseEntity { ...@@ -197,4 +197,7 @@ public class JyjcInspectionApplication extends BaseEntity {
@TableField(value = "next_execute_user_ids") @TableField(value = "next_execute_user_ids")
private String nextExecuteUserIds; private String nextExecuteUserIds;
@TableField(value = "transfer_to_user_ids")
private String transferToUserIds;
} }
...@@ -132,4 +132,7 @@ public class JyjcOpeningApplication extends BaseEntity { ...@@ -132,4 +132,7 @@ public class JyjcOpeningApplication extends BaseEntity {
@TableField(value = "next_execute_user_ids") @TableField(value = "next_execute_user_ids")
private String nextExecuteUserIds; private String nextExecuteUserIds;
@TableField(value = "transfer_to_user_ids")
private String transferToUserIds;
} }
...@@ -17,4 +17,8 @@ public interface JyjcBaseMapper { ...@@ -17,4 +17,8 @@ public interface JyjcBaseMapper {
@MapKey(value = "code") @MapKey(value = "code")
List<Map<String, String>> selectDataDictionaryList(List<String> codes); List<Map<String, String>> selectDataDictionaryList(List<String> codes);
String selectBusinessData(String tableName, String instanceId,String key);
void updateBusinessData(String tableName, String assignee, String transferToUserIds, String instanceId, String nextTaskId,String key);
} }
...@@ -26,5 +26,5 @@ public interface JyjcInspectionApplicationMapper extends BaseMapper<JyjcInspecti ...@@ -26,5 +26,5 @@ public interface JyjcInspectionApplicationMapper extends BaseMapper<JyjcInspecti
void updatePromoter(@org.apache.ibatis.annotations.Param ("id") Long id); void updatePromoter(@org.apache.ibatis.annotations.Param ("id") Long id);
Page<JyjcInspectionApplicationModel> selectForPage(@Param("page") Page<JyjcInspectionApplication> page, @Param("jyjcInspectionApplicationModel") JyjcInspectionApplicationModel jyjcInspectionApplicationModel, @Param("identity") String identity, @Param("currentApplicationUnitCode") String currentApplicationUnitCode, @Param("currentInspectionUnitCode") String currentInspectionUnitCode); Page<JyjcInspectionApplicationModel> selectForPage(@Param("page") Page<JyjcInspectionApplication> page, @Param("jyjcInspectionApplicationModel") JyjcInspectionApplicationModel jyjcInspectionApplicationModel, @Param("identity") String identity, @Param("currentApplicationUnitCode") String currentApplicationUnitCode, @Param("currentInspectionUnitCode") String currentInspectionUnitCode,@Param("currentUserId") String currentUserId);
} }
...@@ -18,7 +18,9 @@ import java.util.List; ...@@ -18,7 +18,9 @@ import java.util.List;
public interface JyjcOpeningApplicationMapper extends BaseMapper<JyjcOpeningApplication> { public interface JyjcOpeningApplicationMapper extends BaseMapper<JyjcOpeningApplication> {
Page<JyjcOpeningApplicationModel> selectJyjcOpeningApplicationList(@Param("page")Page<JyjcOpeningApplication> page, Page<JyjcOpeningApplicationModel> selectJyjcOpeningApplicationList(@Param("page")Page<JyjcOpeningApplication> page,
@Param("jyjcOpeningApplicationRequstDto") JyjcOpeningApplicationRequstDto jyjcOpeningApplicationRequstDto, @Param("applyStartTime") String applyStartTime, @Param("applyendTime") String applyendTime); @Param("jyjcOpeningApplicationRequstDto") JyjcOpeningApplicationRequstDto jyjcOpeningApplicationRequstDto, @Param("applyStartTime") String applyStartTime,
@Param("currentUserId") String currentUserId,
@Param("applyendTime") String applyendTime);
void updatePromoter(@Param("id") Long id); void updatePromoter(@Param("id") Long id);
......
...@@ -157,11 +157,11 @@ public class JyjcInspectionApplicationModel extends BaseModel { ...@@ -157,11 +157,11 @@ public class JyjcInspectionApplicationModel extends BaseModel {
private String instanceId; private String instanceId;
public String getInstanceId() { public String getProcessInstanceId() {
return this.processInstanceId; return this.instanceId != null ?this.instanceId :this.processInstanceId;
} }
public void setInstanceId(String instanceId) { public void setProcessInstanceId(String processInstanceId) {
this.instanceId = this.processInstanceId; this.processInstanceId = processInstanceId;
} }
} }
...@@ -125,4 +125,7 @@ public class JyjcOpeningApplicationModel extends BaseModel { ...@@ -125,4 +125,7 @@ public class JyjcOpeningApplicationModel extends BaseModel {
@ApiModelProperty ("是否监管") @ApiModelProperty ("是否监管")
private String identityType; private String identityType;
@ApiModelProperty ("转办人")
private String transferToUserIds;
} }
...@@ -65,4 +65,5 @@ public class TaskMessageDto { ...@@ -65,4 +65,5 @@ public class TaskMessageDto {
String inspectionUnitCode; String inspectionUnitCode;
String bizType; String bizType;
String nextTaskId;
} }
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.jyjc.api.mapper.JyjcBaseMapper"> <mapper namespace="com.yeejoin.amos.boot.module.jyjc.api.mapper.JyjcBaseMapper">
<update id="updateBusinessData">
update ${tableName}
set transfer_to_user_ids = #{transferToUserIds},
next_execute_user_ids = #{assignee},
next_task_id = #{nextTaskId}
where ${key} = #{instanceId}
</update>
<select id="selectBaseUnitLicenceList" parameterType="map" resultType="com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseUnitLicenceDto"> <select id="selectBaseUnitLicenceList" parameterType="map" resultType="com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseUnitLicenceDto">
select * from tz_base_unit_licence select * from tz_base_unit_licence
...@@ -24,4 +31,11 @@ ...@@ -24,4 +31,11 @@
</select> </select>
<select id="selectBusinessData" resultType="java.lang.String">
select transfer_to_user_ids
from ${tableName}
where ${key} = #{instanceId}
</select>
</mapper> </mapper>
...@@ -136,6 +136,8 @@ ...@@ -136,6 +136,8 @@
1=2 1=2
</otherwise> </otherwise>
</choose> </choose>
OR (tzjia.transfer_to_user_ids LIKE concat ( '%', #{currentUserId}, '%' ) )
</where> </where>
order by tzjia.application_no desc order by tzjia.application_no desc
</select> </select>
......
...@@ -31,6 +31,8 @@ ...@@ -31,6 +31,8 @@
<if test="jyjcOpeningApplicationRequstDto.unitCode != '' and jyjcOpeningApplicationRequstDto.unitCode != null"> <if test="jyjcOpeningApplicationRequstDto.unitCode != '' and jyjcOpeningApplicationRequstDto.unitCode != null">
and a.unit_code = #{jyjcOpeningApplicationRequstDto.unitCode} and a.unit_code = #{jyjcOpeningApplicationRequstDto.unitCode}
</if> </if>
OR (a.transfer_to_user_ids LIKE concat ( '%', #{currentUserId}, '%' ) )
</where> </where>
order by sequence_nbr desc order by sequence_nbr desc
......
...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; ...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil; import com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil;
import com.yeejoin.amos.boot.module.jyjc.biz.service.TaskModelServiceImpl;
import com.yeejoin.amos.boot.module.jyjc.biz.service.impl.CommonserviceImpl; import com.yeejoin.amos.boot.module.jyjc.biz.service.impl.CommonserviceImpl;
import com.yeejoin.amos.boot.module.jyjc.biz.service.impl.EquipRegularlyRemindServicelmpl; import com.yeejoin.amos.boot.module.jyjc.biz.service.impl.EquipRegularlyRemindServicelmpl;
import com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseEnterpriseInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseEnterpriseInfo;
...@@ -35,6 +36,8 @@ public class CommonController extends BaseController { ...@@ -35,6 +36,8 @@ public class CommonController extends BaseController {
@Autowired @Autowired
CommonserviceImpl commonserviceImpl; CommonserviceImpl commonserviceImpl;
@Autowired @Autowired
TaskModelServiceImpl taskModelService;
@Autowired
EquipRegularlyRemindServicelmpl equipRegularlyRemindServicelmpl; EquipRegularlyRemindServicelmpl equipRegularlyRemindServicelmpl;
/** /**
...@@ -49,6 +52,13 @@ public class CommonController extends BaseController { ...@@ -49,6 +52,13 @@ public class CommonController extends BaseController {
return ResponseHelper.buildResponse(commonserviceImpl.getUserInfosByUnitCode(unitCode)); return ResponseHelper.buildResponse(commonserviceImpl.getUserInfosByUnitCode(unitCode));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/getBizUserInfosByUnitCode")
@ApiOperation(httpMethod = "GET", value = "根据公司的unitCode获取检测检验业务办理人员列表", notes = "根据公司的unitCode获取检测检验人员列表")
public ResponseModel<List<TzsUserInfo>> getBizUserInfosByUnitCode(@RequestParam String unitCode) {
return ResponseHelper.buildResponse(commonserviceImpl.getBizUserInfosByUnitCode(unitCode));
}
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/getUserPhonesByPersonCode") @PostMapping(value = "/getUserPhonesByPersonCode")
...@@ -120,4 +130,30 @@ public class CommonController extends BaseController { ...@@ -120,4 +130,30 @@ public class CommonController extends BaseController {
} }
/**
* 公共转办接口
* /common/transfer
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/bj/transfer")
@ApiOperation(httpMethod = "POST", value = "公共转办接口", notes = "公共转办接口")
public ResponseModel<Object> transferBJ(@RequestBody Map<String, Object> map) {
map.put("key","instance_id");
Object result = taskModelService.transfer(map);
return ResponseHelper.buildResponse(result);
}
/**
* 公共转办接口
* /common/transfer
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/kt/transfer")
@ApiOperation(httpMethod = "POST", value = "公共转办接口", notes = "公共转办接口")
public ResponseModel<Object> transferKT(@RequestBody Map<String, Object> map) {
map.put("key","workflow_prostance_id");
Object result = taskModelService.transfer(map);
return ResponseHelper.buildResponse(result);
}
} }
package com.yeejoin.amos.boot.module.jyjc.biz.service; package com.yeejoin.amos.boot.module.jyjc.biz.service;
import com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO; import com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO;
import com.yeejoin.amos.feign.workflow.model.FlowTaskVo;
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;
...@@ -14,5 +15,10 @@ public interface ICmWorkflowService { ...@@ -14,5 +15,10 @@ public interface ICmWorkflowService {
ProcessTaskDTO complete(String taskId, TaskResultDTO data); ProcessTaskDTO complete(String taskId, TaskResultDTO data);
ProcessTaskDTO reject(String taskId, TaskResultDTO data);
ProcessTaskDTO rollBack(String processInstanceId); ProcessTaskDTO rollBack(String processInstanceId);
ProcessTaskDTO assign(FlowTaskVo taskVo);
} }
...@@ -10,14 +10,17 @@ import com.yeejoin.amos.boot.biz.common.service.IDataDictionaryService; ...@@ -10,14 +10,17 @@ import com.yeejoin.amos.boot.biz.common.service.IDataDictionaryService;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.jyjc.api.enums.BizTypeEnum; import com.yeejoin.amos.boot.module.jyjc.api.enums.BizTypeEnum;
import com.yeejoin.amos.boot.module.jyjc.api.mapper.JyjcBaseMapper;
import com.yeejoin.amos.boot.module.jyjc.api.model.TaskModelDto; import com.yeejoin.amos.boot.module.jyjc.api.model.TaskModelDto;
import com.yeejoin.amos.boot.module.jyjc.api.model.WorkflowResultDto; import com.yeejoin.amos.boot.module.jyjc.api.model.WorkflowResultDto;
import com.yeejoin.amos.boot.module.jyjc.biz.service.impl.CmWorkflowServiceImpl;
import com.yeejoin.amos.boot.module.jyjc.biz.utils.JsonUtils; import com.yeejoin.amos.boot.module.jyjc.biz.utils.JsonUtils;
import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.systemctl.Systemctl; import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.TaskV2Model; import com.yeejoin.amos.feign.systemctl.model.TaskV2Model;
import com.yeejoin.amos.feign.workflow.model.ActTaskDTO; import com.yeejoin.amos.feign.workflow.model.ActTaskDTO;
import com.yeejoin.amos.feign.workflow.model.FlowTaskVo;
import com.yeejoin.amos.feign.workflow.model.ProcessTaskDTO; import com.yeejoin.amos.feign.workflow.model.ProcessTaskDTO;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -27,6 +30,7 @@ import org.springframework.stereotype.Service; ...@@ -27,6 +30,7 @@ import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.lang.reflect.Field; import java.lang.reflect.Field;
...@@ -47,6 +51,12 @@ public class TaskModelServiceImpl { ...@@ -47,6 +51,12 @@ public class TaskModelServiceImpl {
@Value("classpath:/json/bizTypeInfo.json") @Value("classpath:/json/bizTypeInfo.json")
private Resource urlInfo; private Resource urlInfo;
@Autowired
CmWorkflowServiceImpl cmWorkflowService;
@Autowired
JyjcBaseMapper jyjcBaseMapper;
public void deleteTaskModel(String id) { public void deleteTaskModel(String id) {
List<TaskV2Model> result = Systemctl.taskV2Client.selectListByRelationId(id).getResult(); List<TaskV2Model> result = Systemctl.taskV2Client.selectListByRelationId(id).getResult();
...@@ -448,4 +458,59 @@ public class TaskModelServiceImpl { ...@@ -448,4 +458,59 @@ public class TaskModelServiceImpl {
}); });
return workflowResultDtoList; return workflowResultDtoList;
} }
public Object transfer(Map<String, Object> map) {
if (ObjectUtils.isEmpty(map.get("nextTaskId")) || map.get("nextTaskId") == null) {
throw new BadRequest("nextTaskId不能为空");
}
if (ObjectUtils.isEmpty(map.get("instanceId")) || map.get("instanceId") == null) {
throw new BadRequest("instanceId不能为空");
}
String taskId = map.get("nextTaskId").toString();
String instanceId = map.get("instanceId").toString();
String tableName = map.get("tableName").toString();
String assignee = map.get("assignee").toString();
FlowTaskVo flowTaskVo = new FlowTaskVo();
flowTaskVo.setTaskId(taskId);
flowTaskVo.setAssignee(assignee);
ProcessTaskDTO processTaskDTO = cmWorkflowService.assign(flowTaskVo);
//修改待办
List<TaskV2Model> result = Systemctl.taskV2Client.selectListByRelationId(instanceId).getResult();
List<TaskV2Model> collect = result.stream().sorted((r1, r2) -> r2.getSequenceNbr().compareTo(r1.getSequenceNbr())).collect(Collectors.toList());
if (collect == null || collect.size() == 0) {
return null;
}
TaskV2Model taskV2Model = collect.get(0);
taskV2Model.setExecuteUserIds(RequestContext.getExeUserId());
taskV2Model.setTaskStatus(FlowStatusEnum.TO_BE_TRANSFER.getCode());
taskV2Model.setTaskStatusLabel(FlowStatusEnum.TO_BE_TRANSFER.getName());
taskV2Model.setEndUserId(RequestContext.getExeUserId());
taskV2Model.setEndDate(new Date());
String routhPath = taskV2Model.getRoutePath().replace("nextExecuteUserIds", "executeUserId") + "&nextExecuteUserIds=" + assignee;
taskV2Model.setRoutePath(routhPath);
Systemctl.taskV2Client.update(taskV2Model, taskV2Model.getSequenceNbr());
//创建新待办
taskV2Model.setExecuteUserIds(assignee);
String nextTaskId = processTaskDTO.getNextTask().get(0).getId();
taskV2Model.setFlowCode(nextTaskId);
String routhPath1 = routhPath.replace("nextTaskId", "nextTask") + "&nextTaskId=" + nextTaskId;
taskV2Model.setCreateDate(new Date());
taskV2Model.setRoutePath(routhPath1);
taskV2Model.setTaskStatus(0);
taskV2Model.setTaskStatusLabel(FlowStatusEnum.TO_BE_PROCESSED.getName());
taskV2Model.setEndUserId(null);
taskV2Model.setEndDate(null);
taskV2Model.setSequenceNbr(null);
Systemctl.taskV2Client.create(taskV2Model);
String key = map.get("key").toString();
String id = jyjcBaseMapper.selectBusinessData(tableName, instanceId,key);
id = ObjectUtils.isEmpty(id) ? assignee : id + "," + assignee;
//修改业务数据
jyjcBaseMapper.updateBusinessData(tableName, assignee, id, instanceId,nextTaskId,key);
return Boolean.TRUE;
}
} }
...@@ -9,6 +9,7 @@ import com.yeejoin.amos.component.feign.config.InnerInvokException; ...@@ -9,6 +9,7 @@ import com.yeejoin.amos.component.feign.config.InnerInvokException;
import com.yeejoin.amos.component.feign.utils.FeignUtil; import com.yeejoin.amos.component.feign.utils.FeignUtil;
import com.yeejoin.amos.feign.workflow.Workflow; import com.yeejoin.amos.feign.workflow.Workflow;
import com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO; import com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO;
import com.yeejoin.amos.feign.workflow.model.FlowTaskVo;
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 lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -62,8 +63,45 @@ public class CmWorkflowServiceImpl implements ICmWorkflowService { ...@@ -62,8 +63,45 @@ public class CmWorkflowServiceImpl implements ICmWorkflowService {
} }
@Override @Override
public ProcessTaskDTO reject(String taskId, TaskResultDTO data) {
ProcessTaskDTO processTaskDTO;
try {
log.info("开始请求工作流完成任务接口:/complete/standard/{taskId},请求参数:{},{}", taskId, JSONObject.toJSONString(data));
processTaskDTO = Workflow.taskV2Client.reject(taskId, data).getResult();
} catch (InnerInvokException e) {
//拦截无审核人异常信息
String devMessage = e.getDevMessage();
devMessage = devMessage.contains(";") ? devMessage.split(";")[0] : devMessage;
log.error(devMessage);
throw new LocalBadRequest(devMessage);
} catch (Exception e) {
log.error("调用工作流完成任务接口失败", e);
throw new RuntimeException("调用工作流完成任务接口失败");
}
return processTaskDTO;
}
@Override
public ProcessTaskDTO rollBack(String processInstanceId) { public ProcessTaskDTO rollBack(String processInstanceId) {
log.info("开始请求工作流撤回接口:/rollBack/standard/{processInstanceId},请求参数:{}", processInstanceId); log.info("开始请求工作流撤回接口:/rollBack/standard/{processInstanceId},请求参数:{}", processInstanceId);
return FeignUtil.remoteCall(() -> Workflow.taskV2Client.rollBackTask(processInstanceId)); return FeignUtil.remoteCall(() -> Workflow.taskV2Client.rollBackTask(processInstanceId));
} }
@Override
public ProcessTaskDTO assign(FlowTaskVo taskVo) {
ProcessTaskDTO processTaskDTO = new ProcessTaskDTO();
try {
log.info("开始请求工作流转办任务接口:/assign/{taskVo},请求参数:{},{}", taskVo);
processTaskDTO = Workflow.taskV2Client.assign(taskVo).getResult();
} catch (InnerInvokException e) {
//拦截无审核人异常信息
String devMessage = e.getDevMessage();
devMessage = devMessage.contains(";") ? devMessage.split(";")[0] : devMessage;
log.error(devMessage);
throw new LocalBadRequest(devMessage);
} catch (Exception e) {
log.error("调用工作流转办任务接口失败", e);
throw new RuntimeException("调用工作流转办任务接口失败");
}
return processTaskDTO;
}
} }
...@@ -16,11 +16,15 @@ import com.yeejoin.amos.feign.privilege.Privilege; ...@@ -16,11 +16,15 @@ import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.systemctl.Systemctl; import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.TaskV2Model; import com.yeejoin.amos.feign.systemctl.model.TaskV2Model;
import com.yeejoin.amos.feign.workflow.model.FlowTaskVo;
import com.yeejoin.amos.feign.workflow.model.ProcessTaskDTO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.lang.reflect.Modifier; import java.lang.reflect.Modifier;
...@@ -35,6 +39,9 @@ public class CommonserviceImpl { ...@@ -35,6 +39,9 @@ public class CommonserviceImpl {
@Value("${jyjc.user-post:6615}") @Value("${jyjc.user-post:6615}")
private String jyjcUserPost; private String jyjcUserPost;
@Value("${jyjc.user-post:6616}")
private String jyjcBizUserPost;
@Autowired @Autowired
RedisUtils redisUtils; RedisUtils redisUtils;
@Autowired @Autowired
...@@ -65,6 +72,16 @@ public class CommonserviceImpl { ...@@ -65,6 +72,16 @@ public class CommonserviceImpl {
return userInfos; return userInfos;
} }
public List<TzsUserInfo> getBizUserInfosByUnitCode(String unitCode) {
QueryWrapper userInfoQueryWrapper = new QueryWrapper<>();
userInfoQueryWrapper.eq("unit_code", unitCode);
userInfoQueryWrapper.like("post", jyjcBizUserPost);
userInfoQueryWrapper.isNotNull("amos_user_id");
userInfoQueryWrapper.eq("is_delete",false);
List<TzsUserInfo> userInfos = userInfoMapper.selectList(userInfoQueryWrapper);
return userInfos;
}
public List<TzsUserInfo> getUserPhonesByPersonCode(String personCode) { public List<TzsUserInfo> getUserPhonesByPersonCode(String personCode) {
List<String> ids = StrUtil.split(personCode, ","); List<String> ids = StrUtil.split(personCode, ",");
QueryWrapper userInfoQueryWrapper = new QueryWrapper<>(); QueryWrapper userInfoQueryWrapper = new QueryWrapper<>();
......
...@@ -153,6 +153,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec ...@@ -153,6 +153,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
String nextUserIds = workflowResultDtos.get(0).getNextExecutorUserIds(); String nextUserIds = workflowResultDtos.get(0).getNextExecutorUserIds();
String nextExcuteIds = workflowResultDtos.get(0).getNextExecutorRoleIds(); String nextExcuteIds = workflowResultDtos.get(0).getNextExecutorRoleIds();
model.setProcessInstanceId(instanceId); model.setProcessInstanceId(instanceId);
model.setInstanceId(instanceId);
if (!org.springframework.util.ObjectUtils.isEmpty(model.getWorkflowRole())) { if (!org.springframework.util.ObjectUtils.isEmpty(model.getWorkflowRole())) {
model.setWorkflowRole(model.getWorkflowRole() + "," + nextExcuteIds); model.setWorkflowRole(model.getWorkflowRole() + "," + nextExcuteIds);
} else { } else {
...@@ -218,6 +219,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec ...@@ -218,6 +219,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
ta.setProcessInstanceId(model.getProcessInstanceId()); ta.setProcessInstanceId(model.getProcessInstanceId());
ta.setProcessKey(model.getProcessKey()); ta.setProcessKey(model.getProcessKey());
ta.setCreateUserId(RequestContext.getExeUserId()); ta.setCreateUserId(RequestContext.getExeUserId());
ta.setNextTaskId(model.getNextTaskId());
dto.setModel(ta); dto.setModel(ta);
//摘要 按原有规则组装 //摘要 按原有规则组装
dto.setTaskContent("来自"+model.getEquList()+"【"+model.getSupervisoryCode()+"】的业务办理,【申请单号:"+model.getApplicationNo()+"】"); dto.setTaskContent("来自"+model.getEquList()+"【"+model.getSupervisoryCode()+"】的业务办理,【申请单号:"+model.getApplicationNo()+"】");
...@@ -421,6 +423,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec ...@@ -421,6 +423,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
RequestContext.getToken())).toString(), ReginParams.class); RequestContext.getToken())).toString(), ReginParams.class);
String companyType = reginParams.getCompany().getCompanyType(); String companyType = reginParams.getCompany().getCompanyType();
String companyCode = reginParams.getCompany().getCompanyCode(); String companyCode = reginParams.getCompany().getCompanyCode();
String currentUserId = reginParams.getUserModel().getUserId();
String currentApplicationUnitCode = null; String currentApplicationUnitCode = null;
String currentInspectionUnitCode = null; String currentInspectionUnitCode = null;
if(ValidationUtil.isEmpty(companyType)){ if(ValidationUtil.isEmpty(companyType)){
...@@ -438,7 +441,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec ...@@ -438,7 +441,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
currentApplicationUnitCode = companyCode; currentApplicationUnitCode = companyCode;
currentInspectionUnitCode = companyCode; currentInspectionUnitCode = companyCode;
} }
Page<JyjcInspectionApplicationModel> resultPage = this.getBaseMapper().selectForPage(page, model, identity, currentApplicationUnitCode, currentInspectionUnitCode); Page<JyjcInspectionApplicationModel> resultPage = this.getBaseMapper().selectForPage(page, model, identity, currentApplicationUnitCode, currentInspectionUnitCode,currentUserId);
return resultPage; return resultPage;
} }
...@@ -657,7 +660,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec ...@@ -657,7 +660,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
task.setVariable(map); task.setVariable(map);
//执行流程 //执行流程
task.setNextExecuteUserCompanyCode(entity.getInspectionUnitCode()); task.setNextExecuteUserCompanyCode(entity.getInspectionUnitCode());
ProcessTaskDTO processTaskDTO = cmWorkflowService.complete(taskId, task); ProcessTaskDTO processTaskDTO = cmWorkflowService.reject(taskId, task);
String taskCode = FlowStatusEnum.TO_SUBMITTED.getName(); String taskCode = FlowStatusEnum.TO_SUBMITTED.getName();
String taskName1 = ""; String taskName1 = "";
String nextTaskId = ""; String nextTaskId = "";
...@@ -854,6 +857,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec ...@@ -854,6 +857,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
ta.setProcessInstanceId(model.getProcessInstanceId()); ta.setProcessInstanceId(model.getProcessInstanceId());
ta.setProcessKey(model.getProcessKey()); ta.setProcessKey(model.getProcessKey());
ta.setInspectionUnitCode(model.getInspectionUnitCode()); ta.setInspectionUnitCode(model.getInspectionUnitCode());
ta.setNextTaskId(model.getNextTaskId());
ta.setBizType(model.getBizType()); ta.setBizType(model.getBizType());
dto.setModel(ta); dto.setModel(ta);
dto.setFlowCreateDate(new Date()); dto.setFlowCreateDate(new Date());
...@@ -905,6 +909,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec ...@@ -905,6 +909,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
TaskMessageDto obj = new TaskMessageDto(); TaskMessageDto obj = new TaskMessageDto();
obj.setInstanceId(model.getProcessInstanceId()); obj.setInstanceId(model.getProcessInstanceId());
obj.setStatus(model.getStatus()); obj.setStatus(model.getStatus());
obj.setNextTaskId(model.getNextTaskId());
obj.setPromoter(model.getPromoter()); obj.setPromoter(model.getPromoter());
obj.setNextExecuteUserIds(model.getNextExecuteUserIds()); obj.setNextExecuteUserIds(model.getNextExecuteUserIds());
obj.setSequenceNbr(model.getSequenceNbr()); obj.setSequenceNbr(model.getSequenceNbr());
......
...@@ -339,6 +339,7 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp ...@@ -339,6 +339,7 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
public Page<JyjcOpeningApplicationModel> queryForJyjcOpeningApplicationPage(Page<JyjcOpeningApplication> page, JyjcOpeningApplicationRequstDto dto) { public Page<JyjcOpeningApplicationModel> queryForJyjcOpeningApplicationPage(Page<JyjcOpeningApplication> page, JyjcOpeningApplicationRequstDto dto) {
ReginParams reginParams = commonserviceImpl.getReginParamsOfCurrentUser(); ReginParams reginParams = commonserviceImpl.getReginParamsOfCurrentUser();
String currentUserId = reginParams.getUserModel().getUserId();
String level = reginParams.getCompany().getLevel(); String level = reginParams.getCompany().getLevel();
if (BaseController.COMPANY_TYPE_COMPANY.equals(level)) { if (BaseController.COMPANY_TYPE_COMPANY.equals(level)) {
dto.setType("enterprise"); dto.setType("enterprise");
...@@ -353,7 +354,7 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp ...@@ -353,7 +354,7 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
applyStartTime = date + " 00:00:00"; applyStartTime = date + " 00:00:00";
applyEndTime = date + " 23:59:59"; applyEndTime = date + " 23:59:59";
} }
Page<JyjcOpeningApplicationModel> result = jyjcOpeningApplicationMapper.selectJyjcOpeningApplicationList(page, dto, applyStartTime, applyEndTime); Page<JyjcOpeningApplicationModel> result = jyjcOpeningApplicationMapper.selectJyjcOpeningApplicationList(page, dto, applyStartTime,currentUserId, applyEndTime);
for (JyjcOpeningApplicationModel record : result.getRecords()) { for (JyjcOpeningApplicationModel record : result.getRecords()) {
record.setIdentityType(dto.getType()); record.setIdentityType(dto.getType());
} }
...@@ -539,7 +540,14 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp ...@@ -539,7 +540,14 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
map.put("approvalStatus", "提交"); map.put("approvalStatus", "提交");
} }
dto.setVariable(map); dto.setVariable(map);
ProcessTaskDTO complete = cmWorkflowService.complete(data.getNextTaskId(), dto); ProcessTaskDTO complete = new ProcessTaskDTO();
if ("0".equals(op)){
complete = cmWorkflowService.complete(data.getNextTaskId(), dto);
}else {
complete = cmWorkflowService.reject(data.getNextTaskId(), dto);
}
ArrayList<ProcessTaskDTO> processTaskDTOS = new ArrayList<>(); ArrayList<ProcessTaskDTO> processTaskDTOS = new ArrayList<>();
processTaskDTOS.add(complete); processTaskDTOS.add(complete);
List<WorkflowResultDto> resultDto = commonServiceImpl.buildWorkFlowInfo(processTaskDTOS); List<WorkflowResultDto> resultDto = commonServiceImpl.buildWorkFlowInfo(processTaskDTOS);
......
//package com.yeejoin.amos.patrol.config; package com.yeejoin.amos.patrol.config;
//
//
//import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
//import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
//import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
//import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
//import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
//import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.patrol.business.feign.JcsFeignClient;
//import com.yeejoin.amos.patrol.business.feign.JcsFeignClient; import com.yeejoin.amos.patrol.exception.PermissionException;
//import com.yeejoin.amos.patrol.exception.PermissionException; import org.apache.commons.lang3.StringUtils;
//import org.apache.commons.lang3.StringUtils; import org.aspectj.lang.JoinPoint;
//import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.Aspect;
//import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Before;
//import org.aspectj.lang.annotation.Before; import org.aspectj.lang.annotation.Pointcut;
//import org.aspectj.lang.annotation.Pointcut; import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value;
//import org.springframework.beans.factory.annotation.Value; import org.springframework.core.annotation.Order;
//import org.springframework.core.annotation.Order; import org.springframework.stereotype.Component;
//import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ResponseBody;
//import org.springframework.stereotype.Component; import org.typroject.tyboot.core.foundation.context.RequestContext;
//import org.springframework.util.ObjectUtils;
//import org.springframework.web.bind.annotation.ResponseBody; /**
//import org.typroject.tyboot.core.foundation.context.RequestContext; * @author DELL
// */
///** @Aspect
// * @author DELL @Component
// */ @ResponseBody
//@Aspect @Order(value = 1)
//@Component public class PersonIdentifyTzsAspect {
//@ResponseBody
//@Order(value = 1) @Autowired
//public class PersonIdentifyTzsAspect { RedisUtils redisUtils;
// @Autowired
// @Autowired private JcsFeignClient jcsFeignClient;
// RedisUtils redisUtils;
// @Autowired @Value("${logic}")
// private JcsFeignClient jcsFeignClient; Boolean logic;
//
// @Value("${logic}") @Pointcut("execution(public * com.yeejoin.amos.*.business.controller..*(..))")
// Boolean logic; public void userDate() {
//
// @Pointcut("execution(public * com.yeejoin.amos.*.business.controller..*(..))") }
// public void userDate() {
//
// } @Before("userDate()")
// public void personIdentity(JoinPoint joinPoint) throws PermissionException {
//
// @Before("userDate()")
// public void personIdentity(JoinPoint joinPoint) throws PermissionException { //定时任务没有token
// if(RequestContext.getExeUserId()==null|| RequestContext.getToken()==null){
//
// //定时任务没有token }else {
// if(RequestContext.getExeUserId()==null|| RequestContext.getToken()==null){ ReginParams reginParam = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
// if (reginParam != null ) {
// }else { if (reginParam.getPersonIdentity() == null || StringUtils.isEmpty(reginParam.getPersonIdentity().getBizOrgCode()) ) {
// ReginParams reginParam = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class); String userId = reginParam.getUserModel().getUserId();
// if (reginParam != null ) {
// if (reginParam.getPersonIdentity() == null || StringUtils.isEmpty(reginParam.getPersonIdentity().getBizOrgCode()) ) { if (userId != null) {
// String userId = reginParam.getUserModel().getUserId(); // FeignClientResult responseModel = jcsFeignClient.selectById(userId);
// //
// if (userId != null) { //
//// FeignClientResult responseModel = jcsFeignClient.selectById(userId); // if (ObjectUtils.isEmpty(responseModel.getResult()) || responseModel.getStatus() != HttpStatus.OK.value()) {
//// // throw new RuntimeException(responseModel.getDevMessage());
////
//// if (ObjectUtils.isEmpty(responseModel.getResult()) || responseModel.getStatus() != HttpStatus.OK.value()) {
//// throw new RuntimeException(responseModel.getDevMessage());
//// }
//// String s = JSONObject.toJSONString(responseModel.getResult());
//// ReginParams.PersonIdentity personIdentity = JSONObject.parseObject(s, ReginParams.PersonIdentity.class);
// ReginParams.PersonIdentity personIdentity = new ReginParams.PersonIdentity();
// // ReginParams.PersonIdentity personIdentity = (ReginParams.PersonIdentity) Bean.mapToBean((Map<String, Object>) responseModel.getResult(), ReginParams.PersonIdentity.class);
// //电力默认走公司权限
// if (!logic) {
// personIdentity.setBizOrgCode(StringUtils.isEmpty(reginParam.getCompany().getOrgCode()) ? "-1" : reginParam.getCompany().getOrgCode());
// } // }
// // String s = JSONObject.toJSONString(responseModel.getResult());
// reginParam.setPersonIdentity(personIdentity); // ReginParams.PersonIdentity personIdentity = JSONObject.parseObject(s, ReginParams.PersonIdentity.class);
// redisUtils.set(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken()), JSONObject.toJSONString(reginParam)); ReginParams.PersonIdentity personIdentity = new ReginParams.PersonIdentity();
// // ReginParams.PersonIdentity personIdentity = (ReginParams.PersonIdentity) Bean.mapToBean((Map<String, Object>) responseModel.getResult(), ReginParams.PersonIdentity.class);
// } //电力默认走公司权限
// } // if (!logic) {
// } personIdentity.setBizOrgCode(StringUtils.isEmpty(reginParam.getCompany().getOrgCode()) ? "-1" : reginParam.getCompany().getOrgCode());
// } // }
// }
// reginParam.setPersonIdentity(personIdentity);
//} redisUtils.set(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken()), JSONObject.toJSONString(reginParam));
//
}
}
}
}
}
}
...@@ -165,7 +165,7 @@ public class GenerateCodeServiceImpl implements IGenerateCodeService { ...@@ -165,7 +165,7 @@ public class GenerateCodeServiceImpl implements IGenerateCodeService {
* @param batchSize 批量生成个数 * @param batchSize 批量生成个数
* @return List * @return List
*/ */
public List<String> generateBatchSequence(String sequenceKey, int batchSize) { public synchronized List<String> generateBatchSequence(String sequenceKey, int batchSize) {
// 使用分布式锁,确保在并发情况下只有一个线程能够生成顺序码 // 使用分布式锁,确保在并发情况下只有一个线程能够生成顺序码
Boolean lockAcquired = obtainLock(LOCK_KEY_AF); Boolean lockAcquired = obtainLock(LOCK_KEY_AF);
if (Boolean.TRUE.equals(lockAcquired)) { if (Boolean.TRUE.equals(lockAcquired)) {
......
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