diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/WxFlowAbleController.java b/mallinkAdmin/src/main/java/com/iformall/controller/WxFlowAbleController.java index 3f5e1e473..f90d32848 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/WxFlowAbleController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/WxFlowAbleController.java @@ -44,6 +44,21 @@ public class WxFlowAbleController extends BaseController { return wxFlowService.list(flowType,pageNum,pageSize,super.getUser().getId()); } + /** + * 我的申请列表 + */ + @ApiOperation("用户代办列表") + @GetMapping(value = "/myApplyList") + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), + @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), + }) + public ResultData myApplyList(Integer pageNum, Integer pageSize) { + logger.debug("[" + getIpAddr() + "] FlowAbleController::myApplyList"); + return wxFlowService.myApplyList(pageNum,pageSize,super.getUser().getId(),super.getTenantId()); + } + + /** * 审批历史 */ diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxFlowRecord.java b/mallinkService/src/main/java/com/iformall/domain/po/WxFlowRecord.java index 2f8ce572a..55a142066 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxFlowRecord.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxFlowRecord.java @@ -26,6 +26,7 @@ public class WxFlowRecord implements Serializable { private String tenantId; private String taskKey; // key private String taskName;// 名称 + private Integer currStatus;// 当前状态 @Transient protected List ids; @@ -38,11 +39,22 @@ public class WxFlowRecord implements Serializable { public WxFlowRecord(Long businessId){ this.businessId = businessId; } + public WxFlowRecord(String processInstanceId,Integer currStatus){ + this.processInstanceId = processInstanceId; + } public WxFlowRecord(Long businessId,String tenantId){ this.businessId = businessId; this.tenantId = tenantId; } + public Integer getCurrStatus() { + return currStatus; + } + + public void setCurrStatus(Integer currStatus) { + this.currStatus = currStatus; + } + public Integer getIsLastStart() { return isLastStart; } diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxFlowRecordMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxFlowRecordMapper.java index 4cef2fec9..26d00aa9b 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxFlowRecordMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxFlowRecordMapper.java @@ -8,5 +8,5 @@ public interface WxFlowRecordMapper extends CommonMapper { List findList(WxFlowRecord flowRecord); - + void updateCurrStatus(WxFlowRecord record); } diff --git a/mallinkService/src/main/java/com/iformall/service/WxFlowRecordService.java b/mallinkService/src/main/java/com/iformall/service/WxFlowRecordService.java index 23c7b0171..ea07ec8f3 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxFlowRecordService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxFlowRecordService.java @@ -19,5 +19,4 @@ public interface WxFlowRecordService { void saveOrUpdate(WxFlowRecord flowRecord); - } diff --git a/mallinkService/src/main/java/com/iformall/service/WxFlowService.java b/mallinkService/src/main/java/com/iformall/service/WxFlowService.java index 70a31ebee..a6e5fa7d0 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxFlowService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxFlowService.java @@ -16,7 +16,7 @@ public interface WxFlowService { * @param businessId * @param flowType */ - void updateBusinessStatus(Long businessId,Integer flowType,Integer contractType,Integer applyStatus,Boolean supplement); + void updateBusinessStatus(Long businessId,Integer flowType,Integer contractType,Integer applyStatus,Boolean supplement,String instId); ResultData getTaskStatusList(Long businessId,String tenantId); @@ -64,4 +64,13 @@ public interface WxFlowService { * @throws Exception */ void genProcessDiagram(HttpServletResponse httpServletResponse, String businessId) throws Exception; + + /** + * 我的申请列表 + * @param pageNum + * @param pageSize + * @param userId + * @return + */ + ResultData myApplyList(Integer pageNum, Integer pageSize,Long userId,String tenantId); } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java index b29046864..0c3f05520 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java @@ -8,6 +8,7 @@ import com.iformall.common.ResultData; import com.iformall.domain.po.*; import com.iformall.enums.*; import com.iformall.exception.MallinkException; +import com.iformall.mapper.WxFlowRecordMapper; import com.iformall.mapper.WxPropertyContractMapper; import com.iformall.mapper.WxRentContractMapper; import com.iformall.service.*; @@ -62,6 +63,8 @@ public class WxFlowServiceImpl implements WxFlowService { private WxPropertyContractMapper wxPropertyContractMapper; @Autowired private WxPropertyContractService wxPropertyContractService; + @Autowired + private WxFlowRecordMapper wxFlowRecordMapper; /** * 获取流程key,1合同 2账单 @@ -86,9 +89,10 @@ public class WxFlowServiceImpl implements WxFlowService { * @param contractType 1租赁合同 2点位合同wx_rent_contract 3物业wx_property_contract 4点位物业合同 * @param applyStatus 状态 * @param supplement 是否补录 + * @param instId 实例id */ @Override - public void updateBusinessStatus(Long businessId,Integer flowType,Integer contractType,Integer applyStatus,Boolean supplement){ + public void updateBusinessStatus(Long businessId,Integer flowType,Integer contractType,Integer applyStatus,Boolean supplement,String instId){ logger.info("businessId:{},supplement:{}",businessId.toString(),supplement); if(1 == flowType){ if(contractType.intValue() == 1 || contractType.intValue() == 2){ @@ -140,6 +144,8 @@ public class WxFlowServiceImpl implements WxFlowService { } } } + //修改记录表当前状态 + wxFlowRecordMapper.updateCurrStatus(new WxFlowRecord(instId,applyStatus)); } @Override @@ -176,7 +182,7 @@ public class WxFlowServiceImpl implements WxFlowService { if(StringUtils.isNotBlank(str)){ contractType = Integer.parseInt(str); } - updateBusinessStatus(businessId,flowType,contractType,EnumRentContractAppStatus.APPLYING.getCode(),supplement); + updateBusinessStatus(businessId,flowType,contractType,EnumRentContractAppStatus.APPLYING.getCode(),supplement,processInstance.getId()); // 保存wx_flow_record表审批记录 WxFlowRecord wxFlowRecord = new WxFlowRecord(); @@ -424,7 +430,6 @@ public class WxFlowServiceImpl implements WxFlowService { wxMsgValidationcode.setType(EnumMsgModel.FLOW_APPLY_NODIFY.getCode()); wxMsgValidationcodeService.sendWorkFlowNodify(wxMsgValidationcode,msgReplaceMap); }else{ - //需要测下三节点 //继续递归判断 isEndAndSendMsg(mapInfo,taskKey,processInstanceId,tenantId,userName); } @@ -437,7 +442,7 @@ public class WxFlowServiceImpl implements WxFlowService { if(StringUtils.isNotBlank(str)){ contractType = Integer.parseInt(str); } - updateBusinessStatus(businessId,flowType,contractType,EnumRentContractAppStatus.FINISH.getCode(),supplement); + updateBusinessStatus(businessId,flowType,contractType,EnumRentContractAppStatus.FINISH.getCode(),supplement,processInstanceId); // 给发起人发送审批通过消息 msgReplaceMap = new HashedMap(); @@ -506,7 +511,7 @@ public class WxFlowServiceImpl implements WxFlowService { if(StringUtils.isNotBlank(str)){ contractType = Integer.parseInt(str); } - updateBusinessStatus(businessId,flowType,contractType,EnumRentContractAppStatus.REJECT.getCode(),supplement); + updateBusinessStatus(businessId,flowType,contractType,EnumRentContractAppStatus.REJECT.getCode(),supplement,processInstanceId); //保存wx_flow_record表审批记录 WxFlowRecord wxFlowRecord = new WxFlowRecord(); @@ -595,7 +600,14 @@ public class WxFlowServiceImpl implements WxFlowService { return userIdList; } - + @Override + public ResultData myApplyList(Integer pageNum, Integer pageSize, Long userId,String tenantId) { + PageHelper.startPage(pageNum, pageSize); + WxFlowRecord flowRecord = new WxFlowRecord(); + flowRecord.setUserId(userId); + List recordList = wxFlowRecordMapper.findList(flowRecord); + return new ResultData(recordList); + } @Override public void genProcessDiagram(HttpServletResponse httpServletResponse,String businessId) throws Exception { @@ -659,4 +671,6 @@ public class WxFlowServiceImpl implements WxFlowService { return null; } + + } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java index b61bea0c2..cfd6f9513 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java @@ -159,13 +159,13 @@ public class WxShopServiceImpl implements WxShopService { cell11 = rowtwo.createCell(10); } - cell1.setCellValue(EnumRentShopType.SHOP.getCode().equals(wxShop.getType())?"店铺号":"多经点位号"); + cell1.setCellValue(EnumRentShopType.SHOP.getCode().equals(wxShop.getType())?"商铺号":"多经点位号"); cell2.setCellValue("租赁商户"); cell3.setCellValue("楼层"); cell4.setCellValue("楼座"); cell5.setCellValue("建筑面积(㎡)"); cell6.setCellValue("计租面积(㎡)"); - cell7.setCellValue("状态"); + cell7.setCellValue(EnumRentShopType.SHOP.getCode().equals(wxShop.getType())?"商铺状态":"多经点位状态"); // 商户信息 cell8.setCellValue("经营业态"); cell9.setCellValue("品牌"); @@ -229,7 +229,7 @@ public class WxShopServiceImpl implements WxShopService { workbook.write(fileOut); fileOut.close(); workbook.close(); - String name = "店铺列表"; + String name = EnumRentShopType.SHOP.getCode().equals(wxShop.getType())?"店铺列表":"多经点位列表"; DownFileUtil.downFile(filepath,name+".xlsx",response, request); FileUtils.forceDelete(file); } catch (Exception e) { diff --git a/mallinkService/src/main/resources/mapper/WxFlowRecordMapper.xml b/mallinkService/src/main/resources/mapper/WxFlowRecordMapper.xml index 3da549d68..4dcf2763b 100644 --- a/mallinkService/src/main/resources/mapper/WxFlowRecordMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxFlowRecordMapper.xml @@ -17,10 +17,11 @@ + - `id`,`business_id`,`business_type`,`user_id`,`remark`,`status`,`task_id`,`process_instance_id`,`create_date`,`update_date`,`tenant_id`,`user_name`,task_key,task_name + `id`,`business_id`,`business_type`,`user_id`,`remark`,`status`,`task_id`,`process_instance_id`,`create_date`,`update_date`,`tenant_id`,`user_name`,task_key,task_name,curr_status @@ -31,6 +32,9 @@ and `business_id` = #{businessId} + + and `user_id` = #{userId} + and id in @@ -45,9 +49,12 @@ order by createDate desc - - + + + update wx_flow_record set curr_status=#{currStatus} where process_instance_id=#{processInstanceId} + and status = 1 +