| @@ -54,6 +54,21 @@ public class WxFlowAbleController extends BaseController { | |||||
| return wxFlowService.list(flowType,pageNum,pageSize,super.getUser().getId()); | 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()); | |||||
| } | |||||
| /** | /** | ||||
| * 审批历史 | * 审批历史 | ||||
| */ | */ | ||||
| @@ -26,6 +26,7 @@ public class WxFlowRecord implements Serializable { | |||||
| private String tenantId; | private String tenantId; | ||||
| private String taskKey; // key | private String taskKey; // key | ||||
| private String taskName;// 名称 | private String taskName;// 名称 | ||||
| private Integer currStatus;// 当前状态 | |||||
| @Transient | @Transient | ||||
| protected List<Long> ids; | protected List<Long> ids; | ||||
| @@ -38,11 +39,22 @@ public class WxFlowRecord implements Serializable { | |||||
| public WxFlowRecord(Long businessId){ | public WxFlowRecord(Long businessId){ | ||||
| this.businessId = businessId; | this.businessId = businessId; | ||||
| } | } | ||||
| public WxFlowRecord(String processInstanceId,Integer currStatus){ | |||||
| this.processInstanceId = processInstanceId; | |||||
| } | |||||
| public WxFlowRecord(Long businessId,String tenantId){ | public WxFlowRecord(Long businessId,String tenantId){ | ||||
| this.businessId = businessId; | this.businessId = businessId; | ||||
| this.tenantId = tenantId; | this.tenantId = tenantId; | ||||
| } | } | ||||
| public Integer getCurrStatus() { | |||||
| return currStatus; | |||||
| } | |||||
| public void setCurrStatus(Integer currStatus) { | |||||
| this.currStatus = currStatus; | |||||
| } | |||||
| public Integer getIsLastStart() { | public Integer getIsLastStart() { | ||||
| return isLastStart; | return isLastStart; | ||||
| } | } | ||||
| @@ -8,5 +8,5 @@ public interface WxFlowRecordMapper extends CommonMapper<WxFlowRecord, Long> { | |||||
| List<WxFlowRecord> findList(WxFlowRecord flowRecord); | List<WxFlowRecord> findList(WxFlowRecord flowRecord); | ||||
| void updateCurrStatus(WxFlowRecord record); | |||||
| } | } | ||||
| @@ -19,5 +19,4 @@ public interface WxFlowRecordService { | |||||
| void saveOrUpdate(WxFlowRecord flowRecord); | void saveOrUpdate(WxFlowRecord flowRecord); | ||||
| } | } | ||||
| @@ -16,7 +16,7 @@ public interface WxFlowService { | |||||
| * @param businessId | * @param businessId | ||||
| * @param flowType | * @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); | ResultData getTaskStatusList(Long businessId,String tenantId); | ||||
| @@ -64,4 +64,13 @@ public interface WxFlowService { | |||||
| * @throws Exception | * @throws Exception | ||||
| */ | */ | ||||
| void genProcessDiagram(HttpServletResponse httpServletResponse, String businessId) 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); | |||||
| } | } | ||||
| @@ -8,6 +8,7 @@ import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.enums.*; | import com.iformall.enums.*; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.mapper.WxFlowRecordMapper; | |||||
| import com.iformall.mapper.WxPropertyContractMapper; | import com.iformall.mapper.WxPropertyContractMapper; | ||||
| import com.iformall.mapper.WxRentContractMapper; | import com.iformall.mapper.WxRentContractMapper; | ||||
| import com.iformall.service.*; | import com.iformall.service.*; | ||||
| @@ -62,6 +63,8 @@ public class WxFlowServiceImpl implements WxFlowService { | |||||
| private WxPropertyContractMapper wxPropertyContractMapper; | private WxPropertyContractMapper wxPropertyContractMapper; | ||||
| @Autowired | @Autowired | ||||
| private WxPropertyContractService wxPropertyContractService; | private WxPropertyContractService wxPropertyContractService; | ||||
| @Autowired | |||||
| private WxFlowRecordMapper wxFlowRecordMapper; | |||||
| /** | /** | ||||
| * 获取流程key,1合同 2账单 | * 获取流程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 contractType 1租赁合同 2点位合同wx_rent_contract 3物业wx_property_contract 4点位物业合同 | ||||
| * @param applyStatus 状态 | * @param applyStatus 状态 | ||||
| * @param supplement 是否补录 | * @param supplement 是否补录 | ||||
| * @param instId 实例id | |||||
| */ | */ | ||||
| @Override | @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); | logger.info("businessId:{},supplement:{}",businessId.toString(),supplement); | ||||
| if(1 == flowType){ | if(1 == flowType){ | ||||
| if(contractType.intValue() == 1 || contractType.intValue() == 2){ | if(contractType.intValue() == 1 || contractType.intValue() == 2){ | ||||
| @@ -140,6 +144,8 @@ public class WxFlowServiceImpl implements WxFlowService { | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| //修改记录表当前状态 | |||||
| wxFlowRecordMapper.updateCurrStatus(new WxFlowRecord(instId,applyStatus)); | |||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -176,7 +182,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||||
| if(StringUtils.isNotBlank(str)){ | if(StringUtils.isNotBlank(str)){ | ||||
| contractType = Integer.parseInt(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表审批记录 | // 保存wx_flow_record表审批记录 | ||||
| WxFlowRecord wxFlowRecord = new WxFlowRecord(); | WxFlowRecord wxFlowRecord = new WxFlowRecord(); | ||||
| @@ -424,7 +430,6 @@ public class WxFlowServiceImpl implements WxFlowService { | |||||
| wxMsgValidationcode.setType(EnumMsgModel.FLOW_APPLY_NODIFY.getCode()); | wxMsgValidationcode.setType(EnumMsgModel.FLOW_APPLY_NODIFY.getCode()); | ||||
| wxMsgValidationcodeService.sendWorkFlowNodify(wxMsgValidationcode,msgReplaceMap); | wxMsgValidationcodeService.sendWorkFlowNodify(wxMsgValidationcode,msgReplaceMap); | ||||
| }else{ | }else{ | ||||
| //需要测下三节点 | |||||
| //继续递归判断 | //继续递归判断 | ||||
| isEndAndSendMsg(mapInfo,taskKey,processInstanceId,tenantId,userName); | isEndAndSendMsg(mapInfo,taskKey,processInstanceId,tenantId,userName); | ||||
| } | } | ||||
| @@ -437,7 +442,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||||
| if(StringUtils.isNotBlank(str)){ | if(StringUtils.isNotBlank(str)){ | ||||
| contractType = Integer.parseInt(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(); | msgReplaceMap = new HashedMap(); | ||||
| @@ -506,7 +511,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||||
| if(StringUtils.isNotBlank(str)){ | if(StringUtils.isNotBlank(str)){ | ||||
| contractType = Integer.parseInt(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表审批记录 | //保存wx_flow_record表审批记录 | ||||
| WxFlowRecord wxFlowRecord = new WxFlowRecord(); | WxFlowRecord wxFlowRecord = new WxFlowRecord(); | ||||
| @@ -595,7 +600,14 @@ public class WxFlowServiceImpl implements WxFlowService { | |||||
| return userIdList; | 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<WxFlowRecord> recordList = wxFlowRecordMapper.findList(flowRecord); | |||||
| return new ResultData(recordList); | |||||
| } | |||||
| @Override | @Override | ||||
| public void genProcessDiagram(HttpServletResponse httpServletResponse,String businessId) throws Exception { | public void genProcessDiagram(HttpServletResponse httpServletResponse,String businessId) throws Exception { | ||||
| @@ -659,4 +671,6 @@ public class WxFlowServiceImpl implements WxFlowService { | |||||
| return null; | return null; | ||||
| } | } | ||||
| } | } | ||||
| @@ -159,13 +159,13 @@ public class WxShopServiceImpl implements WxShopService { | |||||
| cell11 = rowtwo.createCell(10); | cell11 = rowtwo.createCell(10); | ||||
| } | } | ||||
| cell1.setCellValue(EnumRentShopType.SHOP.getCode().equals(wxShop.getType())?"店铺号":"多经点位号"); | |||||
| cell1.setCellValue(EnumRentShopType.SHOP.getCode().equals(wxShop.getType())?"商铺号":"多经点位号"); | |||||
| cell2.setCellValue("租赁商户"); | cell2.setCellValue("租赁商户"); | ||||
| cell3.setCellValue("楼层"); | cell3.setCellValue("楼层"); | ||||
| cell4.setCellValue("楼座"); | cell4.setCellValue("楼座"); | ||||
| cell5.setCellValue("建筑面积(㎡)"); | cell5.setCellValue("建筑面积(㎡)"); | ||||
| cell6.setCellValue("计租面积(㎡)"); | cell6.setCellValue("计租面积(㎡)"); | ||||
| cell7.setCellValue("状态"); | |||||
| cell7.setCellValue(EnumRentShopType.SHOP.getCode().equals(wxShop.getType())?"商铺状态":"多经点位状态"); | |||||
| // 商户信息 | // 商户信息 | ||||
| cell8.setCellValue("经营业态"); | cell8.setCellValue("经营业态"); | ||||
| cell9.setCellValue("品牌"); | cell9.setCellValue("品牌"); | ||||
| @@ -229,7 +229,7 @@ public class WxShopServiceImpl implements WxShopService { | |||||
| workbook.write(fileOut); | workbook.write(fileOut); | ||||
| fileOut.close(); | fileOut.close(); | ||||
| workbook.close(); | workbook.close(); | ||||
| String name = "店铺列表"; | |||||
| String name = EnumRentShopType.SHOP.getCode().equals(wxShop.getType())?"店铺列表":"多经点位列表"; | |||||
| DownFileUtil.downFile(filepath,name+".xlsx",response, request); | DownFileUtil.downFile(filepath,name+".xlsx",response, request); | ||||
| FileUtils.forceDelete(file); | FileUtils.forceDelete(file); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| @@ -17,10 +17,11 @@ | |||||
| <result column="user_name" property="userName" /> | <result column="user_name" property="userName" /> | ||||
| <result column="task_key" property="taskKey" /> | <result column="task_key" property="taskKey" /> | ||||
| <result column="task_name" property="taskName" /> | <result column="task_name" property="taskName" /> | ||||
| <result column="curr_status" property="currStatus" /> | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `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 | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| @@ -31,6 +32,9 @@ | |||||
| <if test=" null != businessId "> | <if test=" null != businessId "> | ||||
| and `business_id` = #{businessId} | and `business_id` = #{businessId} | ||||
| </if> | </if> | ||||
| <if test=" null != user_id "> | |||||
| and `user_id` = #{userId} | |||||
| </if> | |||||
| <if test=" null != ids "> | <if test=" null != ids "> | ||||
| and id in | and id in | ||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | ||||
| @@ -45,9 +49,12 @@ | |||||
| <include refid="dynamicWhereConditions" /> | <include refid="dynamicWhereConditions" /> | ||||
| order by createDate desc | order by createDate desc | ||||
| </select> | </select> | ||||
| <update id="updateCurrStatus" parameterType="com.iformall.domain.po.WxFlowRecord"> | |||||
| update wx_flow_record set curr_status=#{currStatus} where process_instance_id=#{processInstanceId} | |||||
| and status = 1 | |||||
| </update> | |||||
| </mapper> | </mapper> | ||||