Commit 8ec767aa authored by suhuiguang's avatar suhuiguang

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 6830e828 05eae0ff
......@@ -20,11 +20,7 @@
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-ymt-api</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-tcm-api</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.amosframework.boot</groupId>
......
......@@ -164,10 +164,10 @@ public class JgInstallationNoticeDto extends BaseDto {
private String inputUnitNo;
@ApiModelProperty(value = "安装委托书图片")
private List<Map<String, String>> proxyStatementAttachmentList;
private String proxyStatementAttachmentList;
@ApiModelProperty(value = "安装合同照片")
private List<Map<String, String>> installContractAttachmentList;
private String installContractAttachmentList;
@ApiModelProperty(value = "安装委托书图片")
private String proxyStatementAttachment;
......
......@@ -11,13 +11,8 @@ import com.yeejoin.amos.boot.module.jg.api.enums.FlowStatusEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgRelationEquipMapper;
import com.yeejoin.amos.boot.module.jg.api.service.IJgInstallationNoticeService;
import com.yeejoin.amos.boot.module.jg.api.dto.JgInstallationNoticeDto;
import com.yeejoin.amos.boot.module.tcm.api.enums.ApplicationFormTypeEnum;
import com.yeejoin.amos.boot.module.tcm.api.service.ICreateCodeService;
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.boot.module.jg.biz.service.ICommonService;
import com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum;
import com.yeejoin.amos.boot.module.ymt.api.service.ICreateCodeService;
import com.yeejoin.amos.feign.workflow.Workflow;
import com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO;
import com.yeejoin.amos.feign.workflow.model.AjaxResult;
......@@ -26,12 +21,10 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
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.*;
import java.util.stream.Collectors;
......@@ -47,10 +40,13 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
public static final String SUBMIT_TYPE_FLOW = "1";
public static final String PROCESS_DEFINITION_KEY = "installationNotification";
public static final String TABLE_PAGE_ID = "1734141426742095873";
@Autowired
private JgRelationEquipMapper jgRelationEquipMapper;
@Autowired
private JgInstallationNoticeMapper jgInstallationNoticeMapper;
@Autowired
@SuppressWarnings("all")
private ICreateCodeService iCreateCodeService;
/**
* 根据sequenceNbr查询
......@@ -82,25 +78,33 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
*
* @param noticeDto 安装告知
*/
@SuppressWarnings("rawtypes")
@SuppressWarnings({"rawtypes", "Duplicates"})
public JgInstallationNoticeDto updateInstallationNotice(JgInstallationNoticeDto noticeDto, String op) {
if (Objects.isNull(noticeDto) || StringUtils.isEmpty(op)) {
throw new IllegalArgumentException("参数不能为空");
}
// 字段转换
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);
// 发起流程
if (!StringUtils.hasText(noticeDto.getInstanceId())) {
ActWorkflowStartDTO dto = new ActWorkflowStartDTO();
dto.setProcessDefinitionKey("installationNotification");
dto.setBusinessKey("1");
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());
......@@ -121,7 +125,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
if (ObjectUtils.isEmpty(ajaxResult1)) {
noticeDto.setStatus(String.valueOf(FlowStatusEnum.REJECTED.getCode()));
JgInstallationNotice bean = new JgInstallationNotice();
BeanUtils.copyProperties(dto,bean);
BeanUtils.copyProperties(noticeDto, bean);
jgInstallationNoticeMapper.updateById(bean);
}
} catch (Exception e) {
......@@ -130,11 +134,6 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
return noticeDto;
}
@Autowired
private ICreateCodeService iCreateCodeService;
@Autowired
JgRelationEquipMapper jgRelationEquipMapper;
/**
* 分页查询
*
......@@ -194,6 +193,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
}
@Override
@SuppressWarnings({"Duplicates", "rawtypes"})
@Transactional(rollbackFor = Exception.class)
public void saveNotice(String submitType, Map<String, JgInstallationNoticeDto> jgInstallationNoticeDtoMap) {
JgInstallationNoticeDto model = jgInstallationNoticeDtoMap.get(TABLE_PAGE_ID);
......@@ -217,7 +217,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
if (SUBMIT_TYPE_FLOW.equals(submitType)) {
// 发起流程
ActWorkflowStartDTO dto = new ActWorkflowStartDTO();
for (int i = 0 ; i< deviceList.size(); i++) {
for (int i = 0; i < deviceList.size(); i++) {
dto.setProcessDefinitionKey(PROCESS_DEFINITION_KEY);
dto.setBusinessKey("1");
AjaxResult ajaxResult = null;
......@@ -282,10 +282,8 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
private void convertField(JgInstallationNoticeDto model) {
// 处理图片
String proxyStatementAttachment = convertImageUrl(model.getInstallContractAttachmentList());
String installContractAttachment = convertImageUrl(model.getProxyStatementAttachmentList());
model.setProxyStatementAttachment(proxyStatementAttachment);
model.setInstallContractAttachment(installContractAttachment);
model.setProxyStatementAttachment(model.getProxyStatementAttachmentList());
model.setInstallContractAttachment(model.getInstallContractAttachmentList());
// 分割省市区字段
String province = model.getProvince();
......
......@@ -18,8 +18,9 @@
</dependency>
<dependency>
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-tcm-api</artifactId>
<artifactId>amos-boot-module-ymt-api</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
\ No newline at end of file
......@@ -79,7 +79,11 @@ public class JyjcOpeningApplication extends BaseEntity {
*/
@TableField("status")
private String status;
/**
* 状态
*/
@TableField("status_name")
private String statusName;
/**
* 备注
*/
......
package com.yeejoin.amos.boot.module.jyjc.api.enums;
/**
* 办理状态枚举
*/
public enum FlowStatusEnum {
/**
* 待提交
*/
TO_BE_SUBMITTED(6610, "待提交"),
/**
* 已提交
*/
SUBMITTED(6611, "已提交"),
/**
* 待受理
*/
TO_BE_PROCESSED(6612, "待受理"),
/**
* 已办理
*/
HAVE_PROCESSED(6613, "已办理"),
/**
* 已驳回
*/
REJECTED(6614, "已驳回");
private final int code;
private final String name;
FlowStatusEnum(int code, String name) {
this.code = code;
this.name = name;
}
public static String getNameByType(Long code) {
String name = null;
for (FlowStatusEnum enumOne : FlowStatusEnum.values()) {
if (enumOne.getCode() == code) {
name = enumOne.getName();
break;
}
}
return name;
}
public int getCode() {
return code;
}
public String getName() {
return name;
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.jyjc.api.mapper;
import com.yeejoin.amos.boot.module.tcm.api.dto.TzBaseEnterpriseInfoDto;
import com.yeejoin.amos.boot.module.tcm.api.dto.TzBaseUnitLicenceDto;
import com.yeejoin.amos.boot.module.tcm.api.dto.TzsUserInfoDto;
import com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseUnitLicenceDto;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;
......
......@@ -3,8 +3,8 @@ package com.yeejoin.amos.boot.module.jyjc.api.model;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto;
import com.yeejoin.amos.boot.module.tcm.api.dto.TzBaseUnitLicenceDto;
import com.yeejoin.amos.boot.module.tcm.api.dto.TzsUserInfoDto;
import com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseUnitLicenceDto;
import com.yeejoin.amos.boot.module.ymt.api.dto.TzsUserInfoDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -52,11 +52,14 @@ public class JyjcOpeningApplicationModel extends BaseModel {
@ApiModelProperty (value = "状态")
private String status;
@ApiModelProperty (value = "状态Name")
private String statusName;
@ApiModelProperty (value = "备注")
private String remark;
@ApiModelProperty (value = "申请时间")
private String applyTime;
private Date applyTime;
@ApiModelProperty (value = "工作流执行角色")
private String workflowRole;
......
......@@ -2,7 +2,7 @@
<!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">
<select id="selectBaseUnitLicenceList" parameterType="map" resultType="com.yeejoin.amos.boot.module.tcm.api.dto.TzBaseUnitLicenceDto">
<select id="selectBaseUnitLicenceList" parameterType="map" resultType="com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseUnitLicenceDto">
select * from tz_base_unit_licence
where unit_code = #{unitCode}
<if test="licenceType !=null and licenceType != ''">
......
......@@ -22,7 +22,8 @@
apply_time,
workflow_prostance_id,
workflow_role,
unit_code_name
unit_code_name,
status_name
from tz_jyjc_opening_application
<where>
<if test="jyjcOpeningApplicationModel.applicationSeq != '' and jyjcOpeningApplicationModel.applicationSeq != null">
......
......@@ -15,6 +15,7 @@
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-jyjc-api</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.amosframework.boot</groupId>
......
package com.yeejoin.amos.boot.module.jyjc.biz.config;
import com.yeejoin.amos.boot.module.tcm.api.enums.BaseExceptionEnum;
import com.yeejoin.amos.boot.module.ymt.api.enums.BaseExceptionEnum;
/**
* @Author cpp
......
package com.yeejoin.amos.boot.module.jyjc.biz.config;
import com.yeejoin.amos.boot.module.tcm.api.common.BaseException;
import com.yeejoin.amos.boot.module.tcm.api.enums.CommonErrorEnum;
import com.yeejoin.amos.boot.module.ymt.api.common.BaseException;
import com.yeejoin.amos.boot.module.ymt.api.enums.CommonErrorEnum;
/**
* @description: 共同异常类
......
package com.yeejoin.amos.boot.module.jyjc.biz.controller;
import cn.hutool.core.map.MapBuilder;
import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcOpeningApplication;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
......@@ -23,6 +24,7 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
......@@ -68,9 +70,9 @@ public class JyjcOpeningApplicationController extends BaseController {
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}/submit")
@PutMapping(value = "/submit")
@ApiOperation(httpMethod = "PUT", value = "保存并提交", notes = "保存并提交")
public ResponseModel<JyjcOpeningApplicationModel> updateBySequenceNbrAndStartFlow(@RequestBody JyjcOpeningApplicationModel model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
public ResponseModel<JyjcOpeningApplicationModel> updateBySequenceNbrAndStartFlow(@RequestBody JyjcOpeningApplicationModel model, @RequestParam(value = "sequenceNbr", required = false) Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(jyjcOpeningApplicationServiceImpl.saveOrUpdateModel(model,true));
}
......@@ -80,7 +82,7 @@ public class JyjcOpeningApplicationController extends BaseController {
@ApiOperation(httpMethod = "POST", value = "重新提交开通申请", notes = "重新提交开通申请")
public ResponseModel<JyjcOpeningApplicationModel> resubmitJyjcOpeningApplication(@RequestBody JyjcOpeningApplicationModel model, @PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(jyjcOpeningApplicationServiceImpl.saveOrUpdateModel(model, true));
return ResponseHelper.buildResponse(jyjcOpeningApplicationServiceImpl.resubmit(model));
}
/**
......@@ -127,6 +129,25 @@ public class JyjcOpeningApplicationController extends BaseController {
return ResponseHelper.buildResponse(jyjcOpeningApplicationServiceImpl.queryForJyjcOpeningApplicationPage(page,jyjcOpeningApplicationDto));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/pageForCompany")
@ApiOperation(httpMethod = "GET",value = "分页查询-公司", notes = "分页查询-公司")
public ResponseModel<Page<JyjcOpeningApplicationModel>> querypageForCompany(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size,JyjcOpeningApplicationModel jyjcOpeningApplicationDto) {
Page<JyjcOpeningApplication> page = new Page<JyjcOpeningApplication>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(jyjcOpeningApplicationServiceImpl.querypageForCompany(page,jyjcOpeningApplicationDto));
}
/**
* 列表全部数据查询
*
......@@ -149,9 +170,12 @@ public class JyjcOpeningApplicationController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST",value = "接收或者驳回业务开通申请", notes = "接收或者驳回业务开通申请")
@PostMapping(value = "/execueFlow")
public void execueFlow(@RequestBody Map<String,Object> params) {
public ResponseModel<HashMap<String,String>> execueFlow(@RequestBody Map<String,Object> params) {
jyjcOpeningApplicationServiceImpl.execueFlow(params);
HashMap<String,String> result =new HashMap<>();
result.put("result","success");
return ResponseHelper.buildResponse(result);
}
/**
......
......@@ -32,6 +32,9 @@ public class TzsUserInfoDto extends BaseDto {
@ApiModelProperty(value = "岗位")
private String post;
@ApiModelProperty(value = "岗位名称")
private String postName;
@ApiModelProperty(value = "联系电话")
private String phone;
......
package com.yeejoin.amos.boot.module.tcm.biz.service.impl;
package com.yeejoin.amos.boot.module.ymt.biz.service.impl;
import com.yeejoin.amos.boot.module.tcm.api.enums.ApplicationFormTypeEnum;
import com.yeejoin.amos.boot.module.tcm.api.service.ICreateCodeService;
import com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum;
import com.yeejoin.amos.boot.module.ymt.api.service.ICreateCodeService;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.stereotype.Service;
import org.springframework.stereotype.Component;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*;
......@@ -14,7 +14,7 @@ import java.util.concurrent.TimeUnit;
* @author LiuLin
* @date 2023-12-14
*/
@Service
@Component
public class CreateCodeServiceImpl implements ICreateCodeService {
private static final String LOCK_VALUE = "locked";
......
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