Commit 7ed40113 authored by yangyang's avatar yangyang

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

parents 1d2e29af 04cde04b
......@@ -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,20 +11,14 @@ 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.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;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
......@@ -47,10 +41,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,14 +79,21 @@ 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);
AjaxResult ajaxResult;
// 发起流程
if (!StringUtils.hasText(noticeDto.getInstanceId())) {
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();
......@@ -102,6 +106,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
} catch (Exception e) {
log.error("提交失败:{}", e);
}
}
ajaxResult = Workflow.taskClient.getTask(noticeDto.getInstanceId());
JSONObject dataObject = JSON.parseObject(JSON.toJSONString(ajaxResult.get("data")));
......@@ -121,7 +126,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 +135,6 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
return noticeDto;
}
@Autowired
private ICreateCodeService iCreateCodeService;
@Autowired
JgRelationEquipMapper jgRelationEquipMapper;
/**
* 分页查询
*
......@@ -194,6 +194,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 +218,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 +283,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();
......
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;
......@@ -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);
}
/**
......
......@@ -165,6 +165,10 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
}
public Page<JyjcOpeningApplicationModel> queryForJyjcOpeningApplicationPage(Page<JyjcOpeningApplication> page, JyjcOpeningApplicationModel jyjcOpeningApplicationModel) {
return jyjcOpeningApplicationMapper.selectJyjcOpeningApplicationList(page, jyjcOpeningApplicationModel);
}
public Page<JyjcOpeningApplicationModel> querypageForCompany(Page<JyjcOpeningApplication> page, JyjcOpeningApplicationModel jyjcOpeningApplicationModel) {
//根据申请单中的单位信息对于列表数据进行过滤
CompanyBo companyBo = commonserviceImpl.getReginParamsOfCurrentUser().getCompany();
if (companyBo.getLevel().equals("company")) {
......@@ -298,9 +302,9 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
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();
// String detectionRegionName = params.get("detectionRegionName").toString();
jyjcOpeningApplication.setDetectionRegion(detectionRegion);
jyjcOpeningApplication.setDetectionRegionName(detectionRegionName);
// jyjcOpeningApplication.setDetectionRegionName(detectionRegionName);
jyjcOpeningApplicationMapper.updateById(jyjcOpeningApplication);
}
} catch (Exception e) {
......
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