| @@ -419,11 +419,24 @@ public class WxCUserBasicInfoController extends BaseController { | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "startDate", value = "开始时间", dataType = "string", paramType = "query"), | |||
| @ApiImplicitParam(name = "endDate", value = "结束时间", dataType = "string", paramType = "query"), | |||
| @ApiImplicitParam(name = "isPay", value = "是否缴费 1是", dataType = "int", paramType = "query"), | |||
| @ApiImplicitParam(name = "isPay", value = "是否缴费 1是", dataType = "int", paramType = "query") | |||
| }) | |||
| public ResultData carPayList(@ModelAttribute WxCarPayRecord record, Integer pageNum, Integer pageSize){ | |||
| record.setTenantId(super.getTenantId()); | |||
| return new ResultData(wxCarPayRecordService.findCarPayListByPage(record,pageNum,pageSize)); | |||
| } | |||
| @ApiOperation("停车会员记录导出") | |||
| @GetMapping("/exportCarPayData") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "startDate", value = "开始时间", dataType = "string", paramType = "query"), | |||
| @ApiImplicitParam(name = "endDate", value = "结束时间", dataType = "string", paramType = "query"), | |||
| @ApiImplicitParam(name = "isPay", value = "是否缴费 1是", dataType = "int", paramType = "query") | |||
| }) | |||
| public void exportCarPayData(@ModelAttribute WxCarPayRecord record,HttpServletRequest request, HttpServletResponse response) { | |||
| logger.debug("[" + getIpAddr() + "] WxCUserBasicInfoController::exportData"); | |||
| record.setTenantId(getTenantId()); | |||
| wxCUserBasicInfoService.exportCarPayData(record, request, response); | |||
| } | |||
| } | |||
| @@ -54,7 +54,20 @@ public class WxFlowAbleController extends BaseController { | |||
| }) | |||
| public ResultData applyHistory(Long businessId) { | |||
| logger.debug("[" + getIpAddr() + "] FlowAbleController::applyHistory"); | |||
| return wxFlowService.applyHistory(businessId); | |||
| return wxFlowService.applyHistory(businessId,super.getTenantId()); | |||
| } | |||
| /** | |||
| * 审批历史和代办 | |||
| */ | |||
| @ApiOperation("审批历史和代办") | |||
| @GetMapping(value = "/applyHistoryAndAssignee") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "businessId", value = "业务id", dataType = "long", paramType = "query", required = true), | |||
| }) | |||
| public ResultData applyHistoryAndAssignee(Long businessId) { | |||
| logger.debug("[" + getIpAddr() + "] FlowAbleController::applyHistoryAndAssignee"); | |||
| return wxFlowService.getTaskStatusList(businessId,super.getTenantId()); | |||
| } | |||
| /** | |||
| @@ -1,108 +0,0 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |||
| xmlns:flowable="http://flowable.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" | |||
| xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" | |||
| typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" | |||
| targetNamespace="http://www.flowable.org/processdef"> | |||
| <process id="Expense" name="ExpenseProcess" isExecutable="true"> | |||
| <documentation>报销流程</documentation> | |||
| <startEvent id="start" name="开始"></startEvent> | |||
| <userTask id="fillTask" name="出差报销" flowable:assignee="${taskUser}"> | |||
| <extensionElements> | |||
| <modeler:initiator-can-complete xmlns:modeler="http://flowable.org/modeler"> | |||
| <![CDATA[false]]></modeler:initiator-can-complete> | |||
| </extensionElements> | |||
| </userTask> | |||
| <exclusiveGateway id="judgeTask"></exclusiveGateway> | |||
| <userTask id="directorTak" name="经理审批"> | |||
| <extensionElements> | |||
| <flowable:taskListener event="create" | |||
| class="com.iformall.flowable.ManagerTaskHandler"></flowable:taskListener> | |||
| </extensionElements> | |||
| </userTask> | |||
| <userTask id="bossTask" name="老板审批"> | |||
| <extensionElements> | |||
| <flowable:taskListener event="create" | |||
| class="com.iformall.flowable.ContractTaskFinishHandler"></flowable:taskListener> | |||
| </extensionElements> | |||
| </userTask> | |||
| <endEvent id="end" name="结束"></endEvent> | |||
| <sequenceFlow id="directorNotPassFlow" name="驳回" sourceRef="directorTak" targetRef="fillTask"> | |||
| <conditionExpression xsi:type="tFormalExpression"><![CDATA[${outcome=='驳回'}]]></conditionExpression> | |||
| </sequenceFlow> | |||
| <sequenceFlow id="bossNotPassFlow" name="驳回" sourceRef="bossTask" targetRef="fillTask"> | |||
| <conditionExpression xsi:type="tFormalExpression"><![CDATA[${outcome=='驳回'}]]></conditionExpression> | |||
| </sequenceFlow> | |||
| <sequenceFlow id="flow1" sourceRef="start" targetRef="fillTask"></sequenceFlow> | |||
| <sequenceFlow id="flow2" sourceRef="fillTask" targetRef="judgeTask"></sequenceFlow> | |||
| <sequenceFlow id="judgeMore" name="大于500元" sourceRef="judgeTask" targetRef="bossTask"> | |||
| <conditionExpression xsi:type="tFormalExpression"><![CDATA[${money > 500}]]></conditionExpression> | |||
| </sequenceFlow> | |||
| <sequenceFlow id="bossPassFlow" name="通过" sourceRef="bossTask" targetRef="end"> | |||
| <conditionExpression xsi:type="tFormalExpression"><![CDATA[${outcome=='通过'}]]></conditionExpression> | |||
| </sequenceFlow> | |||
| <sequenceFlow id="directorPassFlow" name="通过" sourceRef="directorTak" targetRef="end"> | |||
| <conditionExpression xsi:type="tFormalExpression"><![CDATA[${outcome=='通过'}]]></conditionExpression> | |||
| </sequenceFlow> | |||
| <sequenceFlow id="judgeLess" name="小于500元" sourceRef="judgeTask" targetRef="directorTak"> | |||
| <conditionExpression xsi:type="tFormalExpression"><![CDATA[${money <= 500}]]></conditionExpression> | |||
| </sequenceFlow> | |||
| </process> | |||
| <bpmndi:BPMNDiagram id="BPMNDiagram_Expense"> | |||
| <bpmndi:BPMNPlane bpmnElement="Expense" id="BPMNPlane_Expense"> | |||
| <bpmndi:BPMNShape bpmnElement="start" id="BPMNShape_start"> | |||
| <omgdc:Bounds height="30.0" width="30.0" x="285.0" y="135.0"></omgdc:Bounds> | |||
| </bpmndi:BPMNShape> | |||
| <bpmndi:BPMNShape bpmnElement="fillTask" id="BPMNShape_fillTask"> | |||
| <omgdc:Bounds height="80.0" width="100.0" x="405.0" y="110.0"></omgdc:Bounds> | |||
| </bpmndi:BPMNShape> | |||
| <bpmndi:BPMNShape bpmnElement="judgeTask" id="BPMNShape_judgeTask"> | |||
| <omgdc:Bounds height="40.0" width="40.0" x="585.0" y="130.0"></omgdc:Bounds> | |||
| </bpmndi:BPMNShape> | |||
| <bpmndi:BPMNShape bpmnElement="directorTak" id="BPMNShape_directorTak"> | |||
| <omgdc:Bounds height="80.0" width="100.0" x="735.0" y="110.0"></omgdc:Bounds> | |||
| </bpmndi:BPMNShape> | |||
| <bpmndi:BPMNShape bpmnElement="bossTask" id="BPMNShape_bossTask"> | |||
| <omgdc:Bounds height="80.0" width="100.0" x="555.0" y="255.0"></omgdc:Bounds> | |||
| </bpmndi:BPMNShape> | |||
| <bpmndi:BPMNShape bpmnElement="end" id="BPMNShape_end"> | |||
| <omgdc:Bounds height="28.0" width="28.0" x="771.0" y="281.0"></omgdc:Bounds> | |||
| </bpmndi:BPMNShape> | |||
| <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1"> | |||
| <omgdi:waypoint x="315.0" y="150.0"></omgdi:waypoint> | |||
| <omgdi:waypoint x="405.0" y="150.0"></omgdi:waypoint> | |||
| </bpmndi:BPMNEdge> | |||
| <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2"> | |||
| <omgdi:waypoint x="505.0" y="150.16611295681062"></omgdi:waypoint> | |||
| <omgdi:waypoint x="585.4333333333333" y="150.43333333333334"></omgdi:waypoint> | |||
| </bpmndi:BPMNEdge> | |||
| <bpmndi:BPMNEdge bpmnElement="judgeLess" id="BPMNEdge_judgeLess"> | |||
| <omgdi:waypoint x="624.5530726256983" y="150.44692737430168"></omgdi:waypoint> | |||
| <omgdi:waypoint x="735.0" y="150.1392757660167"></omgdi:waypoint> | |||
| </bpmndi:BPMNEdge> | |||
| <bpmndi:BPMNEdge bpmnElement="directorNotPassFlow" id="BPMNEdge_directorNotPassFlow"> | |||
| <omgdi:waypoint x="785.0" y="110.0"></omgdi:waypoint> | |||
| <omgdi:waypoint x="785.0" y="37.0"></omgdi:waypoint> | |||
| <omgdi:waypoint x="455.0" y="37.0"></omgdi:waypoint> | |||
| <omgdi:waypoint x="455.0" y="110.0"></omgdi:waypoint> | |||
| </bpmndi:BPMNEdge> | |||
| <bpmndi:BPMNEdge bpmnElement="bossPassFlow" id="BPMNEdge_bossPassFlow"> | |||
| <omgdi:waypoint x="655.0" y="295.0"></omgdi:waypoint> | |||
| <omgdi:waypoint x="771.0" y="295.0"></omgdi:waypoint> | |||
| </bpmndi:BPMNEdge> | |||
| <bpmndi:BPMNEdge bpmnElement="judgeMore" id="BPMNEdge_judgeMore"> | |||
| <omgdi:waypoint x="605.4340277777778" y="169.56597222222223"></omgdi:waypoint> | |||
| <omgdi:waypoint x="605.1384083044983" y="255.0"></omgdi:waypoint> | |||
| </bpmndi:BPMNEdge> | |||
| <bpmndi:BPMNEdge bpmnElement="directorPassFlow" id="BPMNEdge_directorPassFlow"> | |||
| <omgdi:waypoint x="785.0" y="190.0"></omgdi:waypoint> | |||
| <omgdi:waypoint x="785.0" y="281.0"></omgdi:waypoint> | |||
| </bpmndi:BPMNEdge> | |||
| <bpmndi:BPMNEdge bpmnElement="bossNotPassFlow" id="BPMNEdge_bossNotPassFlow"> | |||
| <omgdi:waypoint x="555.0" y="295.0"></omgdi:waypoint> | |||
| <omgdi:waypoint x="455.0" y="295.0"></omgdi:waypoint> | |||
| <omgdi:waypoint x="455.0" y="190.0"></omgdi:waypoint> | |||
| </bpmndi:BPMNEdge> | |||
| </bpmndi:BPMNPlane> | |||
| </bpmndi:BPMNDiagram> | |||
| </definitions> | |||
| @@ -3,14 +3,14 @@ | |||
| <process id="contract_flow" name="contractflow" isExecutable="true"> | |||
| <documentation>合同审批流程</documentation> | |||
| <startEvent id="startEvent1"></startEvent> | |||
| <userTask id="firstTask" name="初审" flowable:candidateUsers="${firstTaskUser}"> | |||
| <userTask id="firstTaskUser" name="初审" flowable:candidateUsers="${firstTaskUser}"> | |||
| <documentation>初审</documentation> | |||
| </userTask> | |||
| <endEvent id="sid-9692A856-E39A-4B8C-95C2-7C04A3646D6F"></endEvent> | |||
| <sequenceFlow id="sid-AA24EF6A-4416-4FAF-9FF5-E15E46D87BD9" sourceRef="startEvent1" targetRef="firstTask"></sequenceFlow> | |||
| <sequenceFlow id="sid-C4925653-8894-42FF-81F4-412B3D11A3C9" sourceRef="firstTask" targetRef="secondTask"></sequenceFlow> | |||
| <sequenceFlow id="sid-9FCAF465-99E7-4EFE-BEEA-7D59481E684C" sourceRef="secondTask" targetRef="sid-9692A856-E39A-4B8C-95C2-7C04A3646D6F"></sequenceFlow> | |||
| <userTask id="secondTask" name="复审" flowable:candidateUsers="${secondTaskUser}"> | |||
| <sequenceFlow id="sid-AA24EF6A-4416-4FAF-9FF5-E15E46D87BD9" sourceRef="startEvent1" targetRef="firstTaskUser"></sequenceFlow> | |||
| <sequenceFlow id="sid-C4925653-8894-42FF-81F4-412B3D11A3C9" sourceRef="firstTaskUser" targetRef="secondTaskUser"></sequenceFlow> | |||
| <sequenceFlow id="sid-9FCAF465-99E7-4EFE-BEEA-7D59481E684C" sourceRef="secondTaskUser" targetRef="sid-9692A856-E39A-4B8C-95C2-7C04A3646D6F"></sequenceFlow> | |||
| <userTask id="secondTaskUser" name="复审" flowable:candidateUsers="${secondTaskUser}"> | |||
| <documentation>复审</documentation> | |||
| <extensionElements> | |||
| <flowable:taskListener event="complete" delegateExpression="${contractTaskFinishListener}"></flowable:taskListener> | |||
| @@ -22,13 +22,13 @@ | |||
| <bpmndi:BPMNShape bpmnElement="startEvent1" id="BPMNShape_startEvent1"> | |||
| <omgdc:Bounds height="30.0" width="30.0" x="100.0" y="157.0"></omgdc:Bounds> | |||
| </bpmndi:BPMNShape> | |||
| <bpmndi:BPMNShape bpmnElement="firstTask" id="BPMNShape_firstTask"> | |||
| <bpmndi:BPMNShape bpmnElement="firstTaskUser" id="BPMNShape_firstTask"> | |||
| <omgdc:Bounds height="80.0" width="100.0" x="285.0" y="132.0"></omgdc:Bounds> | |||
| </bpmndi:BPMNShape> | |||
| <bpmndi:BPMNShape bpmnElement="sid-9692A856-E39A-4B8C-95C2-7C04A3646D6F" id="BPMNShape_sid-9692A856-E39A-4B8C-95C2-7C04A3646D6F"> | |||
| <omgdc:Bounds height="28.0" width="28.0" x="835.0" y="158.0"></omgdc:Bounds> | |||
| </bpmndi:BPMNShape> | |||
| <bpmndi:BPMNShape bpmnElement="secondTask" id="BPMNShape_secondTask"> | |||
| <bpmndi:BPMNShape bpmnElement="secondTaskUser" id="BPMNShape_secondTask"> | |||
| <omgdc:Bounds height="80.0" width="100.0" x="554.0" y="132.0"></omgdc:Bounds> | |||
| </bpmndi:BPMNShape> | |||
| <bpmndi:BPMNEdge bpmnElement="sid-C4925653-8894-42FF-81F4-412B3D11A3C9" id="BPMNEdge_sid-C4925653-8894-42FF-81F4-412B3D11A3C9"> | |||
| @@ -2,8 +2,10 @@ package com.iformall.domain.po; | |||
| import javax.persistence.Id; | |||
| import javax.persistence.Table; | |||
| import javax.persistence.Transient; | |||
| import java.io.Serializable; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| @Table(name = "wx_flow_record") | |||
| public class WxFlowRecord implements Serializable { | |||
| @@ -22,11 +24,56 @@ public class WxFlowRecord implements Serializable { | |||
| private Date createDate; | |||
| private Date updateDate; | |||
| private String tenantId; | |||
| private String taskKey; // key | |||
| private String taskName;// 名称 | |||
| // 是否是当前代办节点 | |||
| @Transient | |||
| private Integer isRunningTask; | |||
| // 候选人列表 | |||
| @Transient | |||
| private List<MallUserInfo> assigneeUserList; | |||
| public WxFlowRecord(){} | |||
| public WxFlowRecord(Long businessId){ | |||
| this.businessId = businessId; | |||
| } | |||
| public WxFlowRecord(Long businessId,String tenantId){ | |||
| this.businessId = businessId; | |||
| this.tenantId = tenantId; | |||
| } | |||
| public String getTaskKey() { | |||
| return taskKey; | |||
| } | |||
| public void setTaskKey(String taskKey) { | |||
| this.taskKey = taskKey; | |||
| } | |||
| public String getTaskName() { | |||
| return taskName; | |||
| } | |||
| public void setTaskName(String taskName) { | |||
| this.taskName = taskName; | |||
| } | |||
| public Integer getIsRunningTask() { | |||
| return isRunningTask; | |||
| } | |||
| public void setIsRunningTask(Integer isRunningTask) { | |||
| this.isRunningTask = isRunningTask; | |||
| } | |||
| public List<MallUserInfo> getAssigneeUserList() { | |||
| return assigneeUserList; | |||
| } | |||
| public void setAssigneeUserList(List<MallUserInfo> assigneeUserList) { | |||
| this.assigneeUserList = assigneeUserList; | |||
| } | |||
| public String getTenantId() { | |||
| return tenantId; | |||
| @@ -8,7 +8,8 @@ import java.util.List; | |||
| * @author luozukai | |||
| */ | |||
| public interface WxCarPayRecordMapper extends CommonMapper<WxCarPayRecord, Long> { | |||
| List<WxCarPayRecord> findCarPayListByPage(WxCarPayRecord record); | |||
| List<WxCarPayRecord> findCarPayList(WxCarPayRecord record); | |||
| } | |||
| @@ -3,6 +3,7 @@ package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.domain.dto.WxCUserBasicInfoDto; | |||
| import com.iformall.domain.po.WxCUserBasicInfo; | |||
| import com.iformall.domain.po.WxCarPayRecord; | |||
| import com.iformall.domain.po.WxTags; | |||
| import com.iformall.domain.vo.CUserBaseInfoT; | |||
| @@ -108,4 +109,11 @@ public interface WxCUserBasicInfoService { | |||
| long findCount(WxCUserBasicInfoDto dto); | |||
| /** | |||
| * 停车会员记录导出 | |||
| * @param record | |||
| * @param request | |||
| * @param response | |||
| */ | |||
| void exportCarPayData(WxCarPayRecord record, HttpServletRequest request, HttpServletResponse response); | |||
| } | |||
| @@ -1,9 +1,6 @@ | |||
| package com.iformall.service; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.domain.po.WxFlowRecord; | |||
| import com.iformall.domain.po.WxMsgCallback; | |||
| import java.util.List; | |||
| /** | |||
| @@ -10,6 +10,7 @@ import java.util.Map; | |||
| * 流程审批服务 | |||
| */ | |||
| public interface WxFlowService { | |||
| ResultData getTaskStatusList(Long businessId,String tenantId); | |||
| /** | |||
| * 启动流程 | |||
| @@ -32,7 +33,7 @@ public interface WxFlowService { | |||
| * @param businessId | |||
| * @return | |||
| */ | |||
| ResultData applyHistory(Long businessId); | |||
| ResultData applyHistory(Long businessId,String tenantId); | |||
| /** | |||
| * 审批 | |||
| @@ -7,16 +7,14 @@ import com.iformall.common.IdWorker; | |||
| import com.iformall.domain.dto.WxCUserBasicInfoDto; | |||
| import com.iformall.domain.po.WxCUser; | |||
| import com.iformall.domain.po.WxCUserBasicInfo; | |||
| import com.iformall.domain.po.WxCarPayRecord; | |||
| import com.iformall.domain.po.WxTags; | |||
| import com.iformall.domain.vo.CUserBaseInfoT; | |||
| import com.iformall.domain.vo.CUserBaseVo; | |||
| import com.iformall.domain.vo.CUserTagVo; | |||
| import com.iformall.domain.vo.WxCUserBasicInfoVo; | |||
| import com.iformall.enums.EnumScoreType; | |||
| import com.iformall.mapper.WxCUserBasicInfoMapper; | |||
| import com.iformall.mapper.WxCUserMapper; | |||
| import com.iformall.mapper.WxCUserTagsMapper; | |||
| import com.iformall.mapper.WxTagsMapper; | |||
| import com.iformall.mapper.*; | |||
| import com.iformall.service.WxCUserBasicInfoService; | |||
| import com.iformall.service.WxCUserTagsService; | |||
| import com.iformall.service.WxScoreRulesService; | |||
| @@ -69,6 +67,9 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { | |||
| @Autowired | |||
| StringRedisTemplate stringRedisTemplate; | |||
| @Autowired | |||
| WxCarPayRecordMapper wxCarPayRecordMapper; | |||
| @Override | |||
| public PageInfo<WxCUserBasicInfo> listAsPage(WxCUserBasicInfo record, Integer pageIndex, Integer pageSize) { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCUserBasicInfoMapper.findList(record)); | |||
| @@ -629,5 +630,71 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { | |||
| return wxCUserBasicInfoMapper.findCount(dto); | |||
| } | |||
| @Override | |||
| public void exportCarPayData(WxCarPayRecord record, HttpServletRequest request, HttpServletResponse response) { | |||
| List<WxCarPayRecord> carPayList = wxCarPayRecordMapper.findCarPayList(record); | |||
| SXSSFWorkbook workbook; | |||
| String filepath = Constant.fileDirectory; | |||
| File savefile = new File(filepath); | |||
| if (!savefile.exists()) { | |||
| savefile.mkdirs(); | |||
| } | |||
| String filename = UUID.randomUUID() + ".xlsx"; | |||
| filepath = filepath + filename; | |||
| WxTags wxTagsQ = new WxTags(); | |||
| List<WxTags> tagList = wxTagsMapper.findList(wxTagsQ); | |||
| List<Long> tagIdList = new ArrayList<Long>(); | |||
| try { | |||
| File file = new File(filepath); | |||
| workbook = new SXSSFWorkbook(100); | |||
| SXSSFSheet sheetTwo = workbook.createSheet((1==record.getIsPay())?"线上缴费车辆列表":"进出车辆列表"); | |||
| Row rowtwo = sheetTwo.createRow(0); | |||
| Cell cell1 = rowtwo.createCell(0); | |||
| Cell cell2 = rowtwo.createCell(1); | |||
| Cell cell3 = rowtwo.createCell(2); | |||
| Cell cell4 = rowtwo.createCell(3); | |||
| Cell cell5 = rowtwo.createCell(4); | |||
| Cell cell6 = rowtwo.createCell(5); | |||
| cell1.setCellValue("车牌"); | |||
| cell2.setCellValue("车主电话"); | |||
| cell3.setCellValue("进场时间"); | |||
| cell4.setCellValue("出场时间"); | |||
| cell5.setCellValue("停车时长(分钟)"); | |||
| cell6.setCellValue("缴费金额"); | |||
| for (int i = 0; i < carPayList.size(); i++) { | |||
| rowtwo = sheetTwo.createRow(i + 1); | |||
| cell1 = rowtwo.createCell(0); | |||
| cell2 = rowtwo.createCell(1); | |||
| cell3 = rowtwo.createCell(2); | |||
| cell4 = rowtwo.createCell(3); | |||
| cell5 = rowtwo.createCell(4); | |||
| cell6 = rowtwo.createCell(5); | |||
| WxCarPayRecord entity = carPayList.get(i); | |||
| SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm"); | |||
| cell1.setCellValue(entity.getPlateNumber()); | |||
| cell2.setCellValue(entity.getPhone()); | |||
| cell3.setCellValue(sdf.format(entity.getEntranceTime())); | |||
| cell4.setCellValue(sdf.format(entity.getExitTime())); | |||
| //todo 加个逗留时长 | |||
| //cell5.setCellValue(entity.get()); | |||
| cell6.setCellValue(entity.getFee()); | |||
| } | |||
| FileOutputStream fileOut = new FileOutputStream(file); | |||
| workbook.write(fileOut); | |||
| fileOut.close(); | |||
| workbook.close(); | |||
| downFile(filepath, filename,(1==record.getIsPay())?"线上缴费车辆数据":"进出车辆数据"+".xlsx",response, request); | |||
| FileUtils.forceDelete(file); | |||
| } catch (Exception e) { | |||
| e.printStackTrace(); | |||
| } | |||
| } | |||
| } | |||
| @@ -18,6 +18,8 @@ import org.apache.commons.collections.CollectionUtils; | |||
| import org.apache.commons.collections.map.HashedMap; | |||
| import org.flowable.bpmn.model.BpmnModel; | |||
| import org.flowable.engine.*; | |||
| import org.flowable.engine.impl.RepositoryServiceImpl; | |||
| import org.flowable.engine.impl.persistence.entity.ProcessDefinitionEntity; | |||
| import org.flowable.engine.runtime.Execution; | |||
| import org.flowable.engine.runtime.ProcessInstance; | |||
| import org.flowable.identitylink.api.IdentityLink; | |||
| @@ -91,6 +93,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| map.put("startTime",new Date().getTime()); | |||
| map.put("businessId",businessId); | |||
| map.put("flowType",flowType); | |||
| map.put("taskAssignee",taskAssignee); | |||
| ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(getFlowKeyByType(flowType), map); | |||
| logger.debug("流程启动,流程id:{}",processInstance.getId()); | |||
| @@ -110,6 +113,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| wxFlowRecord.setUserId(userId); | |||
| wxFlowRecord.setUserName(userName); | |||
| wxFlowRecord.setStatus(EnumFlowRecordStatus.NEW.getCode()); | |||
| wxFlowRecord.setTaskName("发起"); | |||
| wxFlowRecordService.saveOrUpdate(wxFlowRecord); | |||
| // 给审批人发送代办通知短信 | |||
| @@ -153,8 +157,8 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| } | |||
| @Override | |||
| public ResultData applyHistory(Long businessId) { | |||
| List<WxFlowRecord> result = wxFlowRecordService.findList(new WxFlowRecord(businessId)); | |||
| public ResultData applyHistory(Long businessId,String tenantId) { | |||
| List<WxFlowRecord> result = wxFlowRecordService.findList(new WxFlowRecord(businessId,tenantId)); | |||
| if(CollectionUtils.isNotEmpty(result)){ | |||
| String processInstanceId = result.get(0).getProcessInstanceId(); | |||
| List<MallUserInfo> mallUserInfoList = getUserByProcessInstanceId(processInstanceId); | |||
| @@ -167,7 +171,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| } | |||
| WxFlowRecord wxFlowRecord = new WxFlowRecord(); | |||
| wxFlowRecord.setUserName(assignee); | |||
| wxFlowRecord.setUserName(assignee.trim()); | |||
| wxFlowRecord.setStatus(EnumFlowRecordStatus.ASSIGNEE.getCode()); | |||
| result.add(0,wxFlowRecord); | |||
| } | |||
| @@ -175,16 +179,67 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| return new ResultData(result); | |||
| } | |||
| @Override | |||
| public ResultData getTaskStatusList(Long businessId, String tenantId) { | |||
| List<WxFlowRecord> resultList = wxFlowRecordService.findList(new WxFlowRecord(businessId,tenantId)); | |||
| String processInstanceId = resultList.get(0).getProcessInstanceId(); | |||
| ProcessInstance pi = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult(); | |||
| Task task = taskService.createTaskQuery().processInstanceId(pi.getId()).singleResult(); | |||
| Map<String,Object> mapInfo = taskService.getVariables(task.getId()); | |||
| List<Map<String,String>> taskAssigneeList = (List)mapInfo.get("taskAssignee"); | |||
| for (int i = 0; i < taskAssigneeList.size()-1; i++) { | |||
| Map<String,String> assignee = taskAssigneeList.get(i); | |||
| if(task.getTaskDefinitionKey().equals(assignee.get("taskKey"))){ | |||
| //设置当前节点代办人信息 | |||
| String[] assigneeArray = assignee.get("assignee").split(","); | |||
| String userName = ""; | |||
| for (String userid:assigneeArray) { | |||
| MallUserInfo mallUserInfo = this.mallUserInfoService.getById(Long.parseLong(userid)); | |||
| userName += mallUserInfo.getName()+" "; | |||
| } | |||
| WxFlowRecord wxFlowRecord = new WxFlowRecord(); | |||
| wxFlowRecord.setUserName(userName.trim()); | |||
| wxFlowRecord.setStatus(EnumFlowRecordStatus.ASSIGNEE.getCode()); | |||
| resultList.add(0,wxFlowRecord); | |||
| if(i != taskAssigneeList.size()-1){ //不是最后一个节点,设置下一个待审批节点代办人 | |||
| assignee = taskAssigneeList.get(i+1); | |||
| assigneeArray = assignee.get("assignee").split(","); | |||
| userName = ""; | |||
| for (String userid:assigneeArray) { | |||
| MallUserInfo mallUserInfo = this.mallUserInfoService.getById(Long.parseLong(userid)); | |||
| userName += mallUserInfo.getName()+" "; | |||
| } | |||
| wxFlowRecord = new WxFlowRecord(); | |||
| wxFlowRecord.setUserName(userName.trim()); | |||
| wxFlowRecord.setStatus(EnumFlowRecordStatus.ASSIGNEE.getCode()); | |||
| resultList.add(0,wxFlowRecord); | |||
| break; | |||
| } | |||
| }else{ | |||
| continue; | |||
| } | |||
| } | |||
| return new ResultData(resultList); | |||
| } | |||
| @Override | |||
| @Transactional(propagation = Propagation.REQUIRED,rollbackFor = {Exception.class}) | |||
| public ResultData apply(Map<String, String> params,Long userId,String userName,String tenantId) { | |||
| String taskId = params.get("taskId"); | |||
| String processInstanceId = params.get("processInstanceId"); | |||
| String remark = params.get("remark"); | |||
| String taskName; | |||
| String taskKey; | |||
| Task task = taskService.createTaskQuery().taskId(taskId).singleResult(); | |||
| if (task == null) { | |||
| throw new MallinkException(Result.ERROR, "流程不存在"); | |||
| } | |||
| taskName = task.getName(); | |||
| taskKey = task.getTaskDefinitionKey(); | |||
| Map<String,Object> mapInfo = taskService.getVariables(task.getId()); | |||
| Long businessId = (Long)mapInfo.get("businessId"); | |||
| Integer flowType = (Integer)mapInfo.get("flowType"); | |||
| @@ -202,6 +257,8 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| wxFlowRecord.setBusinessId(businessId); | |||
| wxFlowRecord.setBusinessType(flowType); | |||
| wxFlowRecord.setUserName(userName); | |||
| wxFlowRecord.setTaskName(taskName); | |||
| wxFlowRecord.setTaskKey(taskKey); | |||
| wxFlowRecordService.saveOrUpdate(wxFlowRecord); | |||
| // 发送短信 | |||
| @@ -262,6 +319,15 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| Integer flowType = (Integer)mapInfo.get("flowType"); | |||
| MallUserInfo starter = (MallUserInfo)mapInfo.get("starter"); | |||
| String taskName; | |||
| String taskKey; | |||
| Task task = taskService.createTaskQuery().taskId(taskId).singleResult(); | |||
| if (task == null) { | |||
| throw new MallinkException(Result.ERROR, "流程不存在"); | |||
| } | |||
| taskName = task.getName(); | |||
| taskKey = task.getTaskDefinitionKey(); | |||
| runtimeService.deleteProcessInstance(processInstanceId, "驳回"); | |||
| // 修改合同审核状态为驳回 | |||
| @@ -280,6 +346,8 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| wxFlowRecord.setStatus(EnumFlowRecordStatus.REJECT.getCode()); | |||
| wxFlowRecord.setBusinessType(flowType); | |||
| wxFlowRecord.setUserName(userName); | |||
| wxFlowRecord.setTaskKey(taskKey); | |||
| wxFlowRecord.setTaskName(taskName); | |||
| wxFlowRecordService.saveOrUpdate(wxFlowRecord); | |||
| // 给发起人发送驳回消息 | |||
| @@ -613,6 +613,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| .map(r -> r.getId()).collect(Collectors.toList()); | |||
| if (!collect.isEmpty()) { | |||
| //中止 | |||
| //todo:结束审批流 by luozukai | |||
| } | |||
| //把状态为签约而商户未关联的数据改为待签约状态 | |||
| @@ -70,7 +70,13 @@ | |||
| from wx_car_pay_record | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| <select id="findCarPayList" parameterType="com.iformall.domain.po.WxCarPayRecord" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from wx_car_pay_record | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| </mapper> | |||
| @@ -15,10 +15,12 @@ | |||
| <result column="update_date" property="updateDate" /> | |||
| <result column="tenant_id" property="tenantId" /> | |||
| <result column="user_name" property="userName" /> | |||
| <result column="task_key" property="taskKey" /> | |||
| <result column="task_name" property="taskName" /> | |||
| </resultMap> | |||
| <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` | |||
| `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 | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||