Commit 8a2baafe authored by chenzhao's avatar chenzhao

Merge branch 'develop_tzs_register' of…

Merge branch 'develop_tzs_register' of http://36.40.66.175:5000/moa/amos-boot-biz into develop_tzs_register
parents bd39be68 1c42b3fc
package com.yeejoin.amos.boot.module.jg.api.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
......@@ -103,4 +104,6 @@ public class JgUseRegistrationDto extends BaseDto {
private String dataType ;
private String unitCode;
private String isXixian;
}
......@@ -183,4 +183,7 @@ public class JgUseRegistration extends BaseEntity {
@TableField(value = "next_execute_user_ids")
private String nextExecuteUserIds;
@TableField(value = "is_xixian")
private String isXixian;
}
......@@ -6,8 +6,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.module.jg.api.dto.JgMaintainNoticeDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgMaintainNotice;
import jdk.nashorn.api.scripting.JSObject;
import java.util.List;
import java.util.Map;
/**
......@@ -57,7 +56,7 @@ public interface IJgMaintainNoticeService extends IService<JgMaintainNotice> {
* @param model 数据
* @param submitType 保存类型
*/
void saveNotice(String submitType, Map<String, Object> model, ReginParams reginParams);
List<JgMaintainNotice> saveNotice(String submitType, Map<String, Object> model, ReginParams reginParams);
/**
* 打印告知单
......
......@@ -4,25 +4,17 @@ import com.alibaba.fastjson.JSONObject;
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.RedisUtils;
import com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationEqDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgEnableDisable;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.List;
import java.util.Map;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.JgEnableDisableServiceImpl;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jg.api.dto.JgEnableDisableDto;
......@@ -54,8 +46,7 @@ public class JgEnableDisableController extends BaseController {
@ApiOperation(httpMethod = "POST", value = "新增", notes = "新增")
public ResponseModel<Object> save(@RequestBody JSONObject map) {
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
jgEnableDisableServiceImpl.saveOrUpdate(map, reginParams);
return ResponseHelper.buildResponse("ok");
return ResponseHelper.buildResponse(jgEnableDisableServiceImpl.saveOrUpdate(map, reginParams));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
......
......@@ -47,11 +47,9 @@ public class JgMaintainNoticeController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增维修告知", notes = "新增维修告知")
public ResponseModel<String> save(@RequestParam String submitType, @RequestBody Map<String, Object> model) {
public ResponseModel<Object> save(@RequestParam String submitType, @RequestBody Map<String, Object> model) {
ReginParams reginParams = getSelectedOrgInfo();
iJgMaintainNoticeService.saveNotice(submitType, model, reginParams);
return ResponseHelper.buildResponse("");
return ResponseHelper.buildResponse(iJgMaintainNoticeService.saveNotice(submitType, model, reginParams));
}
/**
......
......@@ -557,7 +557,7 @@ public class CommonServiceImpl implements ICommonService {
noticeObj.put("receiveOrgCode", !ObjectUtils.isEmpty(basicObj.get("receiveOrgCreditCode")) ? String.valueOf(basicObj.get("receiveOrgCreditCode")) : String.valueOf(basicObj.get("receiveOrgCreditCode1")));
provideMap.put(WXGZ_PAGE_ID, noticeObj);
JSONObject jsonObject = new JSONObject(provideMap);
iJgMaintainNoticeService.saveNotice(submitType, jsonObject, reginParams);
return iJgMaintainNoticeService.saveNotice(submitType, jsonObject, reginParams);
} else if (type.equals(ApplicationFormTypeEnum.YZGZ.getBusinessCode())) {
noticeObj.put("receiveOrgCode", !ObjectUtils.isEmpty(basicObj.get("receiveOrgCreditCode")) ? String.valueOf(basicObj.get("receiveOrgCreditCode")) : String.valueOf(basicObj.get("receiveOrgCreditCode1")));
......@@ -621,7 +621,7 @@ public class CommonServiceImpl implements ICommonService {
noticeObj.put("formType", "add");
noticeObj.put("receiveOrgCode", !ObjectUtils.isEmpty(basicObj.get("receiveOrgCreditCode")) ? String.valueOf(basicObj.get("receiveOrgCreditCode")) : String.valueOf(basicObj.get("receiveOrgCreditCode1")));
JSONObject jsonObject = new JSONObject(noticeObj);
jgEnableDisableServiceImpl.saveOrUpdate(jsonObject, reginParams);
return jgEnableDisableServiceImpl.saveOrUpdate(jsonObject, reginParams);
}
return null;
}
......
......@@ -86,7 +86,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
ICmWorkflowService iCmWorkflowService;
@Transactional(rollbackFor = Exception.class)
public void saveOrUpdate(JSONObject map, ReginParams reginParams) {
public List<JgEnableDisable> saveOrUpdate(JSONObject map, ReginParams reginParams) {
JgEnableDisable jgEnableDisable = new JgEnableDisable();
if (!"null".equals(String.valueOf(map.get("sequenceNbr")))) {
jgEnableDisable = this.baseMapper.selectById(String.valueOf(map.get("sequenceNbr")));
......@@ -211,7 +211,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
jgEnableDisableEq.setEnableDisableApplyId(jgEnableDisable.getSequenceNbr().toString());
jgEnableDisableEqService.saveOrUpdate(jgEnableDisableEq);
}
return Collections.singletonList(jgEnableDisable);
}
/**
......
......@@ -216,7 +216,7 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
.startUserId(taskV2Model.getStartUserId())
.startUser(taskV2Model.getStartUser())
.startDate(taskV2Model.getStartDate())
//.pageType("edit")
.pageType(statusEnum.getCode() == 6614 ? "edit" : "look")
.model(taskMessageDto)
.nextExecuteUser(workflowResultDto.getNextExecutorRoleIds())
.build();
......
......@@ -397,7 +397,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
@Override
@SuppressWarnings({"Duplicates", "rawtypes"})
@Transactional(rollbackFor = Exception.class)
public void saveNotice(String submitType, Map<String, Object> jgMaintainNoticeDtoMap, ReginParams reginParams) {
public List<JgMaintainNotice> saveNotice(String submitType, Map<String, Object> jgMaintainNoticeDtoMap, ReginParams reginParams) {
JgMaintainNoticeDto model = JSON.parseObject(JSONObject.toJSONString(jgMaintainNoticeDtoMap.get(TABLE_PAGE_ID)), JgMaintainNoticeDto.class);
......@@ -470,6 +470,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
return jgRelationEquip.setEquipTransferId(String.valueOf(sequenceNbr));
}).collect(Collectors.toList());
jgMaintainNoticeEqMapper.insertBatchSomeColumn(jgRelationEquipList);
return list;
}
/**
......
......@@ -26,19 +26,10 @@ import com.yeejoin.amos.boot.module.jg.api.service.IJgUseRegistrationService;
import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient;
import com.yeejoin.amos.boot.module.jg.biz.service.ICommonService;
import com.yeejoin.amos.boot.module.jg.flc.api.fegin.WorkFlowFeignService;
import com.yeejoin.amos.boot.module.ymt.api.entity.EquipmentCategory;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgFactoryInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgRegisterInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgUseInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.InspectionDetectionInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.OtherInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.UseInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.*;
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.mapper.IdxBizJgRegisterInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.InspectionDetectionInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.OtherInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.UseInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.*;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.systemctl.model.TaskV2Model;
import com.yeejoin.amos.feign.workflow.Workflow;
......@@ -74,7 +65,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
@Autowired
private InspectionDetectionInfoMapper inspectionDetectionInfoMapper;
@Autowired
private OtherInfoMapper otherInfoMapper;
private IdxBizJgOtherInfoMapper otherInfoMapper;
@Autowired
private JgUseRegistrationEqMapper jgRelationEquipMapper;
@Autowired
......@@ -129,6 +120,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
inspectionDetectionInfoMapper.update(inspectionDetectionInfo, inspectionLambda);
// 更新设备使用登记证
idxBizJgRegisterInfoMapper.updateUseOrgCodeByEquip(String.valueOf(map.get("equipId")), useOrgCode);
// 更新es
createCode(String.valueOf(map.get("equipId")), map);
}
public void updateHistory(JSONObject map, String equipId, String currentDocumentId, String supervisoryCode) {
......@@ -159,9 +152,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
// 使用登记信息
JgUseRegistration jgUseRegistration = new JgUseRegistration();
jgUseRegistration.setRegDate(new Date());
LambdaQueryWrapper<OtherInfo> otherLambda = new QueryWrapper<OtherInfo>().lambda();
otherLambda.eq(OtherInfo::getRecord, map.get("equipId"));
OtherInfo otherInfo = otherInfoMapper.selectOne(otherLambda);
LambdaQueryWrapper<IdxBizJgOtherInfo> otherLambda = new QueryWrapper<IdxBizJgOtherInfo>().lambda();
otherLambda.eq(IdxBizJgOtherInfo::getRecord, map.get("equipId"));
IdxBizJgOtherInfo otherInfo = otherInfoMapper.selectOne(otherLambda);
String supervisoryCode = otherInfo.getSupervisoryCode();
jgUseRegistration.setSupervisoryCode(supervisoryCode);
jgUseRegistration.setUseUnitName(String.valueOf(map.get("useUnitName")));
......@@ -182,6 +175,10 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
if (!ObjectUtils.isEmpty(map.get("inspectOrgName"))) {
jgUseRegistration.setInspectUnitName(map.get("inspectOrgName").toString());
}
// 是否西咸
if (!ObjectUtils.isEmpty(map.get("isXixian"))){
jgUseRegistration.setIsXixian(String.valueOf(map.get("isXixian")));
}
if (map.containsKey("type") && "edit".equals(String.valueOf(map.get("type")))) {
......@@ -648,4 +645,51 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
//调用生成使用登记证
commonService.generateCertificateReport(exportParamsMap, response);
}
/**
* 生成监管码、96333码
*
* @param record
*/
public void createCode(String record, JSONObject dataMap) {
// 其他信息
LambdaQueryWrapper<IdxBizJgOtherInfo> lambdaOth = new QueryWrapper<IdxBizJgOtherInfo>().lambda();
lambdaOth.eq(IdxBizJgOtherInfo::getRecord, record);
IdxBizJgOtherInfo otherInfo = otherInfoMapper.selectOne(lambdaOth);
if (ObjectUtils.isEmpty(otherInfo.getCode96333()) || ObjectUtils.isEmpty(otherInfo.getSupervisoryCode())) {
// 使用信息
LambdaQueryWrapper<UseInfo> lambda = new QueryWrapper<UseInfo>().lambda();
lambda.eq(UseInfo::getRecord, record);
UseInfo useInfo = useInfoMapper.selectOne(lambda);
// 注册信息
LambdaQueryWrapper<IdxBizJgRegisterInfo> lambdaReg = new QueryWrapper<IdxBizJgRegisterInfo>().lambda();
lambdaReg.eq(IdxBizJgRegisterInfo::getRecord, record);
IdxBizJgRegisterInfo registerInfo = idxBizJgRegisterInfoMapper.selectOne(lambdaReg);
// 生成监管码、96333码
Map<String, Object> map = new HashMap<>();
map.put("cityCode", useInfo.getCity());
map.put("countyCode", useInfo.getCounty());
map.put("equCategory", registerInfo.getEquCategory());
map.put("isXiXian", dataMap.get("isXixian"));
ResponseModel<Map<String, Object>> code = tzsServiceFeignClient.createCode(map);
Map<String, Object> result = code.getResult();
if (!ObjectUtils.isEmpty(result)) {
otherInfo.setSupervisoryCode(String.valueOf(result.get("superviseCode")));
otherInfo.setCode96333(ObjectUtils.isEmpty(result.get("code96333")) ? null : String.valueOf(result.get("code96333")));
otherInfo.setClaimStatus("已认领");
otherInfoMapper.updateById(otherInfo);
}
}
// 更新es
HashMap<String, Map<String, Object>> objMap = new HashMap<>();
HashMap<String, Object> param = new HashMap<>();
param.put("SUPERVISORY_CODE", otherInfo.getSupervisoryCode());
param.put("CODE96333", otherInfo.getCode96333());
param.put("USE_UNIT_CREDIT_CODE", dataMap.get("useUnitCreditCode"));
param.put("USE_UNIT_NAME", dataMap.get("useUnitName"));
param.put("CITY", dataMap.get("city"));
param.put("COUNTY", dataMap.get("county"));
objMap.put(record, param);
tzsServiceFeignClient.commonUpdateEsDataByIds(objMap);
}
}
\ No newline at end of file
......@@ -72,13 +72,9 @@
cdd1.NAME AS inspectionClassify,
cdd3.NAME AS inspectionType,
cdd.NAME AS equipClassify,
tbei.use_unit AS applicationUnitName,
tbei1.use_unit AS inspectionUnitName,
cdd2.NAME AS statusName
FROM
tz_jyjc_inspection_application AS tzjia
LEFT JOIN tz_base_enterprise_info tbei ON tbei.use_code = tzjia.application_unit_code
LEFT JOIN tz_base_enterprise_info tbei1 ON tbei1.use_code = tzjia.inspection_unit_code
LEFT JOIN cb_data_dictionary cdd ON cdd.code = tzjia.equip_classify and cdd.type = 'BJSBZL'
LEFT JOIN cb_data_dictionary cdd1 ON cdd1.code = tzjia.inspection_classify
LEFT JOIN cb_data_dictionary cdd2 ON cdd2.code = tzjia.status and cdd2.type = 'JYLCZT'
......@@ -103,6 +99,9 @@
<if test="jyjcInspectionApplicationModel.inspectionChargePerson != null and jyjcInspectionApplicationModel.inspectionChargePerson != ''">
and tzjia.inspection_charge_person like concat('%',#{jyjcInspectionApplicationModel.inspectionChargePerson},'%')
</if>
<if test="jyjcInspectionApplicationModel.inspectionChargePersonName != null and jyjcInspectionApplicationModel.inspectionChargePersonName != ''">
and tzjia.inspection_charge_person_name like concat('%',#{jyjcInspectionApplicationModel.inspectionChargePersonName},'%')
</if>
<if test="jyjcInspectionApplicationModel.status != null and jyjcInspectionApplicationModel.status != ''">
and tzjia.status = #{jyjcInspectionApplicationModel.status}
</if>
......
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