Commit c00bbd4c authored by chenzhao's avatar chenzhao

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

parents 9bb5bb75 e557c64f
......@@ -2,27 +2,28 @@ package com.yeejoin.amos.boot.module.jg.api.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import org.springframework.util.StringUtils;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
*
*
* @author system_generator
* @date 2023-12-12
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="JgInstallationNoticeDto", description="")
public class JgInstallationNoticeDto extends BaseDto {
@ApiModel(value = "JgInstallationNoticeDto", description = "")
public class JgInstallationNoticeDto extends BaseDto {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "告知单编号")
......@@ -166,13 +167,13 @@ public class JgInstallationNoticeDto extends BaseDto {
private List<Map<String, String>> proxyStatementAttachmentList;
@ApiModelProperty(value = "安装合同照片")
private List<Map<String, String>> installContractAttachmentList;
private List<Map<String, String>> installContractAttachmentList;
@ApiModelProperty(value = "安装委托书图片")
private String proxyStatementAttachment;
@ApiModelProperty(value = "安装委托书图片")
private String proxyStatementAttachment;
@ApiModelProperty(value = "安装合同照片")
private String installContractAttachment;
@ApiModelProperty(value = "安装合同照片")
private String installContractAttachment;
@ApiModelProperty(value = "是否西咸")
private String isXixian;
......@@ -186,15 +187,23 @@ public class JgInstallationNoticeDto extends BaseDto {
@ApiModelProperty(value = "区名字")
private String countyName;
@ApiModelProperty(value = "市名字")
private String cityName;
@ApiModelProperty(value = "市名字")
private String cityName;
@ApiModelProperty(value = "省名字")
private String provinceName;
@ApiModelProperty(value = "省名字")
private String provinceName;
@ApiModelProperty(value = "完整地址")
private String fullAddress;
@TableField(exist = false)
@ApiModelProperty(value = "告知设备列表")
private List<Map<String, Object>> deviceList;
public String getFullAddress() {
return (StringUtils.isEmpty(this.provinceName) ? "" : this.provinceName)
+ (StringUtils.isEmpty(this.cityName) ? "" : this.cityName)
+ (StringUtils.isEmpty(this.countyName) ? "" : this.countyName)
+ (StringUtils.isEmpty(this.address) ? "" : this.address);
}
}
package com.yeejoin.amos.boot.module.jg.api.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jg.api.dto.JgInstallationNoticeDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNotice;
import java.util.Map;
......@@ -14,8 +16,43 @@ import java.util.Map;
public interface IJgInstallationNoticeService {
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return 安装告知
*/
Map<String, Map<String, Object>> queryBySequenceNbr(Long sequenceNbr);
/**
* 更新安装告知
*
* @param noticeDto 安装告知
* @param op 操作类型
*/
JgInstallationNoticeDto updateInstallationNotice(JgInstallationNoticeDto noticeDto, String op);
/**
* 分页查询
*
* @param page 分页对象
* @param model 查询参数
* @param type 类型:enterprise-企业端、supervision-监管端
* @return 安装告知列表
*/
Page<JgInstallationNoticeDto> queryForJgInstallationNoticePage(Page<JgInstallationNotice> page, JgInstallationNoticeDto model, String type);
/**
* 批量删除
*
* @param sequenceNbrs 主键
* @return 是否删除成功
*/
Boolean deleteForBatch(Long[] sequenceNbrs);
/**
* 保存安装告知单
* @param model 数据
*
* @param model 数据
* @param submitType 保存类型
*/
void saveNotice(String submitType, Map<String, JgInstallationNoticeDto> model);
......
......@@ -4,11 +4,8 @@
<select id="getUnitListByType" resultType="java.util.Map">
SELECT
sequence_nbr sequenceNbr,
use_code useCode,
use_unit useUnit,
use_contact useContact,
contact_phone contactPhone
use_unit useUnit
FROM
tz_base_enterprise_info
WHERE
......
......@@ -12,7 +12,11 @@
isn.region_no AS regionNo,
isn.address AS address,
isn.notice_status AS noticeStatus,
isn.install_unit_name AS installUnitName
isn.install_unit_name AS installUnitName,
isn.province_name AS provinceName,
isn.city_name AS cityName,
isn.county_name AS countyName,
isn.instance_id AS instanceId
FROM
tzs_jg_installation_notice isn
<where>
......
package com.yeejoin.amos.boot.module.jg.biz.controller;
import cn.hutool.core.bean.BeanUtil;
import com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNotice;
import org.omg.PortableInterceptor.SUCCESSFUL;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -8,6 +9,7 @@ import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.jg.api.dto.JgInstallationNoticeDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNotice;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.JgInstallationNoticeServiceImpl;
......@@ -62,12 +64,12 @@ public class JgInstallationNoticeController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/update")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新安装告知", notes = "根据sequenceNbr更新安装告知")
public ResponseModel<JgInstallationNoticeDto> updateBySequenceNbrJgInstallationNotice(@RequestBody Map<String, Object> model) {
public ResponseModel<JgInstallationNoticeDto> updateBySequenceNbrJgInstallationNotice(@RequestBody Map<String, Object> model, @RequestParam("op") String op) {
JgInstallationNoticeDto installationInfo = BeanUtil.mapToBean(((LinkedHashMap) model.get("installationInfo")), JgInstallationNoticeDto.class, true);
if (Objects.isNull(installationInfo)) {
throw new IllegalArgumentException("参数installationInfo不能为空");
}
return ResponseHelper.buildResponse(jgInstallationNoticeServiceImpl.updateInstallationNotice(installationInfo));
return ResponseHelper.buildResponse(jgInstallationNoticeServiceImpl.updateInstallationNotice(installationInfo, op));
}
/**
......@@ -83,6 +85,22 @@ public class JgInstallationNoticeController extends BaseController {
}
/**
* 根据sequenceNbr批量删除
*
* @param sequenceNbrs 主键
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/batchDelete")
@ApiOperation(value = "根据sequenceNbr删除维保合同备案", notes = "根据sequenceNbr删除维保合同备案")
public ResponseModel<Boolean> deleteForBatch(@RequestParam("sequenceNbrs") Long[] sequenceNbrs) {
try {
return ResponseHelper.buildResponse(jgInstallationNoticeServiceImpl.deleteForBatch(sequenceNbrs));
} catch (Exception e) {
return CommonResponseUtil.failure(e.getMessage());
}
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
......@@ -95,18 +113,6 @@ public class JgInstallationNoticeController extends BaseController {
return ResponseHelper.buildResponse(jgInstallationNoticeServiceImpl.queryBySequenceNbr(sequenceNbr));
}
/**
* 根据sequenceNbr批量删除
*
* @param sequenceNbrs 主键
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/batchDelete")
@ApiOperation(value = "根据sequenceNbr删除维保合同备案", notes = "根据sequenceNbr删除维保合同备案")
public ResponseModel<Boolean> deleteForBatch(@RequestParam("sequenceNbrs") Long[] sequenceNbrs) {
return ResponseHelper.buildResponse(jgInstallationNoticeServiceImpl.deleteForBatch(sequenceNbrs));
}
/**
* 列表分页查询
......
......@@ -162,8 +162,9 @@ public class CommonServiceImpl implements ICommonService {
type = "使用单位";
} else if (type.equals("maintenance")) {
type = "维保单位";
} else if (type.equals("inspection")) {
type = "检验检测机构";
}
return commonMapper.getUnitListByType(type);
}
......
package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jg.api.dto.JgInstallationNoticeDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNotice;
......@@ -19,6 +21,7 @@ import com.yeejoin.amos.boot.module.jg.biz.service.ICommonService;
import com.yeejoin.amos.feign.workflow.Workflow;
import com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO;
import com.yeejoin.amos.feign.workflow.model.AjaxResult;
import com.yeejoin.amos.feign.workflow.model.TaskResultDTO;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
......@@ -26,6 +29,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.*;
......@@ -48,6 +52,84 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
@Autowired
private JgInstallationNoticeMapper jgInstallationNoticeMapper;
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return 安装告知
*/
@Override
public Map<String, Map<String, Object>> queryBySequenceNbr(Long sequenceNbr) {
// 安装告知信息
JgInstallationNotice notice = jgInstallationNoticeMapper.selectById(sequenceNbr);
Map<String, Object> installationInfo = BeanUtil.beanToMap(notice);
installationInfo.put("province", notice.getProvince() + "_" + notice.getProvinceName());
installationInfo.put("city", notice.getCity() + "_" + notice.getCityName());
installationInfo.put("county", notice.getCounty() + "_" + notice.getCountyName());
// 设备信息
List<Map<String, Object>> equipmentInfos = jgInstallationNoticeMapper.queryEquipInformation(sequenceNbr);
return new HashMap<String, Map<String, Object>>() {{
this.put("installationInfo", installationInfo);
this.put("equipmentInfo", equipmentInfos.get(0));
}};
}
/**
* 更新安装告知
*
* @param noticeDto 安装告知
*/
@SuppressWarnings("rawtypes")
public JgInstallationNoticeDto updateInstallationNotice(JgInstallationNoticeDto noticeDto, String op) {
this.convertField(noticeDto);
ActWorkflowStartDTO dto = new ActWorkflowStartDTO();
dto.setProcessDefinitionKey("installationNotification");
dto.setBusinessKey("1");
AjaxResult ajaxResult;
try {
ajaxResult = Workflow.taskClient.startByVariable(dto);
String instanceId = ((Map) ajaxResult.get("data")).get("id").toString();
noticeDto.setInstanceId(instanceId);
noticeDto.setStatus(String.valueOf(FlowStatusEnum.TO_BE_PROCESSED.getCode()));
noticeDto.setNoticeStatus(String.valueOf(FlowStatusEnum.TO_BE_PROCESSED.getCode()));
JgInstallationNotice bean = new JgInstallationNotice();
BeanUtils.copyProperties(noticeDto, bean);
jgInstallationNoticeMapper.updateById(bean);
} catch (Exception e) {
log.error("提交失败:{}", e);
}
ajaxResult = Workflow.taskClient.getTask(noticeDto.getInstanceId());
JSONObject dataObject = JSON.parseObject(JSON.toJSONString(ajaxResult.get("data")));
String taskId = dataObject.getString("id");
//组装信息
TaskResultDTO taskResultDTO = new TaskResultDTO();
taskResultDTO.setResultCode("approvalStatus");
taskResultDTO.setTaskId(taskId);
taskResultDTO.setComment("提交流程");
HashMap<String, Object> map = new HashMap<>();
map.put("approvalStatus", op);
taskResultDTO.setVariable(map);
//执行流程
AjaxResult ajaxResult1;
try {
ajaxResult1 = Workflow.taskClient.completeByTask(taskId, taskResultDTO);
if (ObjectUtils.isEmpty(ajaxResult1)) {
noticeDto.setStatus(String.valueOf(FlowStatusEnum.REJECTED.getCode()));
JgInstallationNotice bean = new JgInstallationNotice();
BeanUtils.copyProperties(dto,bean);
jgInstallationNoticeMapper.updateById(bean);
}
} catch (Exception e) {
log.error("提交失败:{}", e);
}
return noticeDto;
}
@Autowired
private ICreateCodeService iCreateCodeService;
@Autowired
......@@ -61,6 +143,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
* @param type 类型:enterprise-企业端、supervision-监管端
* @return 安装告知列表
*/
@Override
public Page<JgInstallationNoticeDto> queryForJgInstallationNoticePage(Page<JgInstallationNotice> page, JgInstallationNoticeDto model, String type) {
Page<JgInstallationNotice> noticePage = jgInstallationNoticeMapper.queryForPage(page, model, type);
......@@ -94,13 +177,19 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
* @param sequenceNbrs 主键
* @return 是否删除成功
*/
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean deleteForBatch(Long[] sequenceNbrs) {
if (Objects.isNull(sequenceNbrs) || sequenceNbrs.length == 0) {
return false;
}
Collection<JgInstallationNotice> jgInstallationNotices = this.listByIds(Arrays.asList(sequenceNbrs));
jgInstallationNotices.forEach(notice -> notice.setIsDelete(true));
jgInstallationNotices.forEach(notice -> {
if (StringUtils.hasText(notice.getInspectUnitId())) {
throw new IllegalStateException("所选数据已存在流程,不能删除!");
}
notice.setIsDelete(true);
});
return this.updateBatchById(jgInstallationNotices);
}
......@@ -130,11 +219,26 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
ActWorkflowStartDTO dto = new ActWorkflowStartDTO();
for (int i = 0 ; i< deviceList.size(); i++) {
dto.setProcessDefinitionKey(PROCESS_DEFINITION_KEY);
dto.setBusinessKey("1");
AjaxResult ajaxResult = null;
try {
ajaxResult = Workflow.taskClient.startByVariable(dto);
String instanceId = ((Map) ajaxResult.get("data")).get("id").toString();
instanceIdList.add(instanceId);
ajaxResult = Workflow.taskClient.getTask(instanceId);
// 执行一步
JSONObject dataObject = JSON.parseObject(JSON.toJSONString(ajaxResult.get("data")));
String taskId = dataObject.getString("id");
//组装信息
TaskResultDTO taskResultDTO = new TaskResultDTO();
taskResultDTO.setResultCode("approvalStatus");
taskResultDTO.setTaskId(taskId);
taskResultDTO.setComment("提交流程");
HashMap<String, Object> map = new HashMap<>();
map.put("approvalStatus", "0");
taskResultDTO.setVariable(map);
//执行流程
Workflow.taskClient.completeByTask(taskId, taskResultDTO);
} catch (Exception e) {
log.error("流程启动失败:{}", e);
}
......@@ -153,7 +257,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
dto.setEquList(String.valueOf(obj.get("SEQUENCE_NBR")));
jgRelationEquip.setEquipId(String.valueOf(obj.get("SEQUENCE_NBR")));
jgRelationEquip.setApplyNo(applyNo);
jgRelationEquip.setBusinessType("GZ");
jgRelationEquip.setBusinessType(ApplicationFormTypeEnum.GZ.getCode());
if (!CollectionUtils.isEmpty(instanceIdList)) {
dto.setInstanceId(instanceIdList.get(i));
dto.setStatus(String.valueOf(FlowStatusEnum.TO_BE_PROCESSED.getCode()));
......
......@@ -24,6 +24,7 @@ import org.typroject.tyboot.core.foundation.enumeration.UserType;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
......@@ -146,10 +147,11 @@ public class JyjcOpeningApplicationController extends BaseController {
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "接收或者驳回业务开通申请", notes = "接收或者驳回业务开通申请")
@GetMapping(value = "/execueFlow")
public void execueFlow(@RequestParam("op") String op, @RequestParam("instanceId") String instanceId,@RequestParam("comments") String comments) {
jyjcOpeningApplicationServiceImpl.execueFlow(op,instanceId,comments);
@ApiOperation(httpMethod = "POST",value = "接收或者驳回业务开通申请", notes = "接收或者驳回业务开通申请")
@PostMapping(value = "/execueFlow")
public void execueFlow(@RequestBody Map<String,Object> params) {
jyjcOpeningApplicationServiceImpl.execueFlow(params);
}
/**
......
......@@ -51,14 +51,7 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.*;
import java.util.stream.Collectors;
......@@ -277,7 +270,10 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
/**
* 接收/驳回通知检验单
*/
public void execueFlow(String op, String instanceId,String comments) {
public void execueFlow(Map<String,Object> params) {
String op = params.get("op").toString();
String instanceId = params.get("instanceId").toString();
String comments= params.get("comments").toString();
try {
AjaxResult ajaxResult = Workflow.taskClient.getTask(instanceId);
JSONObject dataObject = JSON.parseObject(JSON.toJSONString(ajaxResult.get("data")));
......@@ -296,8 +292,16 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
if (ObjectUtils.isEmpty(ajaxResult1)) {
}
updateModelByInstanceId(instanceId);
if(op.equals("0")){
String originalDataId = params.get("originalDataId").toString();
JyjcOpeningApplication jyjcOpeningApplication=jyjcOpeningApplicationMapper.selectById(originalDataId);
List<String> detectionRegion = Arrays.asList(params.get("detectionRegion").toString().split(",")) ;
String detectionRegionName = params.get("detectionRegionName").toString();
jyjcOpeningApplication.setDetectionRegion(detectionRegion);
jyjcOpeningApplication.setDetectionRegionName(detectionRegionName);
jyjcOpeningApplicationMapper.updateById(jyjcOpeningApplication);
}
} catch (Exception e) {
e.printStackTrace();
}
......
package com.yeejoin.amos.boot.module.tcm.api.controller;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.tcm.api.service.ICreateCodeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.List;
/**
*
* 生成顺序码
* @author LiuLin
* @date 2023-12-14
*/
@RestController
@Api(tags = "生成顺序码")
@RequestMapping(value = "/code")
public class CreateCodeController extends BaseController {
@Autowired
private ICreateCodeService createCodeService;
/**
* 申请单编号生成
* @param type type
* @param batchSize batchSize
* @return List
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/ANCode")
@ApiOperation(httpMethod = "POST", value = "申请单编号生成", notes = "申请单编号生成")
public ResponseModel<List<String>> createANCode(@RequestParam("type") String type,
@RequestParam("batchSize") int batchSize) {
return ResponseHelper.buildResponse(createCodeService.createApplicationFormCode(type,batchSize));
}
/**
* 生成设备注册编码
* @param key key
* @return String
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/DRCode")
@ApiOperation(httpMethod = "POST", value = "申请单编号生成", notes = "申请单编号生成")
public ResponseModel<String> createDRCode(@RequestParam("key") String key) {
return ResponseHelper.buildResponse(createCodeService.createDeviceRegistrationCode(key));
}
}
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