| @@ -31,7 +31,7 @@ public class WxCarPayRecord implements Serializable { | |||||
| private String phone; | private String phone; | ||||
| private Date createDate; | private Date createDate; | ||||
| private Date updateDate; | private Date updateDate; | ||||
| private Long stayedTime; | |||||
| @Transient | @Transient | ||||
| @io.swagger.annotations.ApiModelProperty(value="开始日期",name="startDate") | @io.swagger.annotations.ApiModelProperty(value="开始日期",name="startDate") | ||||
| @@ -43,6 +43,13 @@ public class WxCarPayRecord implements Serializable { | |||||
| @io.swagger.annotations.ApiModelProperty(value="是否缴费",name="isPay") | @io.swagger.annotations.ApiModelProperty(value="是否缴费",name="isPay") | ||||
| private Integer isPay; | private Integer isPay; | ||||
| public Long getStayedTime() { | |||||
| return stayedTime; | |||||
| } | |||||
| public void setStayedTime(Long stayedTime) { | |||||
| this.stayedTime = stayedTime; | |||||
| } | |||||
| public String getStartDate() { | public String getStartDate() { | ||||
| return startDate; | return startDate; | ||||
| @@ -27,12 +27,8 @@ public class WxFlowRecord implements Serializable { | |||||
| private String taskKey; // key | private String taskKey; // key | ||||
| private String taskName;// 名称 | private String taskName;// 名称 | ||||
| // 是否是当前代办节点 | |||||
| @Transient | @Transient | ||||
| private Integer isRunningTask; | |||||
| // 候选人列表 | |||||
| @Transient | |||||
| private List<MallUserInfo> assigneeUserList; | |||||
| protected List<Long> ids; | |||||
| public WxFlowRecord(){} | public WxFlowRecord(){} | ||||
| public WxFlowRecord(Long businessId){ | public WxFlowRecord(Long businessId){ | ||||
| @@ -43,6 +39,14 @@ public class WxFlowRecord implements Serializable { | |||||
| this.tenantId = tenantId; | this.tenantId = tenantId; | ||||
| } | } | ||||
| public List<Long> getIds() { | |||||
| return ids; | |||||
| } | |||||
| public void setIds(List<Long> ids) { | |||||
| this.ids = ids; | |||||
| } | |||||
| public String getTaskKey() { | public String getTaskKey() { | ||||
| return taskKey; | return taskKey; | ||||
| } | } | ||||
| @@ -59,22 +63,6 @@ public class WxFlowRecord implements Serializable { | |||||
| this.taskName = 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() { | public String getTenantId() { | ||||
| return tenantId; | return tenantId; | ||||
| } | } | ||||
| @@ -9,8 +9,8 @@ public enum EnumFlowRecordStatus { | |||||
| NEW(1, "发起申请"), | NEW(1, "发起申请"), | ||||
| APPLY(2, "审批通过"), | APPLY(2, "审批通过"), | ||||
| REJECT(3, "审批驳回"), | REJECT(3, "审批驳回"), | ||||
| ASSIGNEE(4, "待审批") | |||||
| //FINISH(4, "审批通过") | |||||
| ASSIGNEE(4, "待审批"), | |||||
| CANCLE(5, "合同作废") | |||||
| ; | ; | ||||
| public static EnumFlowRecordStatus getEnum(Integer code) { | public static EnumFlowRecordStatus getEnum(Integer code) { | ||||
| @@ -8,7 +8,8 @@ public enum EnumRentContractAppStatus { | |||||
| DEFAULT(0, "未审核"), | DEFAULT(0, "未审核"), | ||||
| APPLYING(1, "审核中"), | APPLYING(1, "审核中"), | ||||
| FINISH(2, "审核完成"), | FINISH(2, "审核完成"), | ||||
| REJECT(3, "驳回") | |||||
| REJECT(3, "驳回"), | |||||
| CANCLE(4,"合同作废") | |||||
| ; | ; | ||||
| public static EnumRentContractAppStatus getEnum(Integer code) { | public static EnumRentContractAppStatus getEnum(Integer code) { | ||||
| @@ -10,6 +10,7 @@ import java.util.Map; | |||||
| * 流程审批服务 | * 流程审批服务 | ||||
| */ | */ | ||||
| public interface WxFlowService { | public interface WxFlowService { | ||||
| ResultData getTaskStatusList(Long businessId,String tenantId); | ResultData getTaskStatusList(Long businessId,String tenantId); | ||||
| /** | /** | ||||
| @@ -642,14 +642,11 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { | |||||
| } | } | ||||
| String filename = UUID.randomUUID() + ".xlsx"; | String filename = UUID.randomUUID() + ".xlsx"; | ||||
| filepath = filepath + filename; | filepath = filepath + filename; | ||||
| WxTags wxTagsQ = new WxTags(); | |||||
| List<WxTags> tagList = wxTagsMapper.findList(wxTagsQ); | |||||
| List<Long> tagIdList = new ArrayList<Long>(); | |||||
| try { | try { | ||||
| File file = new File(filepath); | File file = new File(filepath); | ||||
| workbook = new SXSSFWorkbook(100); | workbook = new SXSSFWorkbook(100); | ||||
| SXSSFSheet sheetTwo = workbook.createSheet((1==record.getIsPay())?"线上缴费车辆列表":"进出车辆列表"); | |||||
| SXSSFSheet sheetTwo = workbook.createSheet((record.getIsPay()!=null && 1==record.getIsPay())?"线上缴费车辆列表":"进出车辆列表"); | |||||
| Row rowtwo = sheetTwo.createRow(0); | Row rowtwo = sheetTwo.createRow(0); | ||||
| Cell cell1 = rowtwo.createCell(0); | Cell cell1 = rowtwo.createCell(0); | ||||
| Cell cell2 = rowtwo.createCell(1); | Cell cell2 = rowtwo.createCell(1); | ||||
| @@ -681,17 +678,15 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { | |||||
| cell2.setCellValue(entity.getPhone()); | cell2.setCellValue(entity.getPhone()); | ||||
| cell3.setCellValue(sdf.format(entity.getEntranceTime())); | cell3.setCellValue(sdf.format(entity.getEntranceTime())); | ||||
| cell4.setCellValue(sdf.format(entity.getExitTime())); | cell4.setCellValue(sdf.format(entity.getExitTime())); | ||||
| //todo 加个逗留时长 | |||||
| //cell5.setCellValue(entity.get()); | |||||
| cell5.setCellValue(entity.getStayedTime()/60); | |||||
| cell6.setCellValue(entity.getFee()); | cell6.setCellValue(entity.getFee()); | ||||
| } | } | ||||
| FileOutputStream fileOut = new FileOutputStream(file); | FileOutputStream fileOut = new FileOutputStream(file); | ||||
| workbook.write(fileOut); | workbook.write(fileOut); | ||||
| fileOut.close(); | fileOut.close(); | ||||
| workbook.close(); | workbook.close(); | ||||
| downFile(filepath, filename,(1==record.getIsPay())?"线上缴费车辆数据":"进出车辆数据"+".xlsx",response, request); | |||||
| downFile(filepath, filename,(record.getIsPay()!=null && 1==record.getIsPay())?"线上缴费车辆数据":"进出车辆数据"+".xlsx",response, request); | |||||
| FileUtils.forceDelete(file); | FileUtils.forceDelete(file); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| e.printStackTrace(); | e.printStackTrace(); | ||||
| @@ -18,8 +18,6 @@ import org.apache.commons.collections.CollectionUtils; | |||||
| import org.apache.commons.collections.map.HashedMap; | import org.apache.commons.collections.map.HashedMap; | ||||
| import org.flowable.bpmn.model.BpmnModel; | import org.flowable.bpmn.model.BpmnModel; | ||||
| import org.flowable.engine.*; | 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.Execution; | ||||
| import org.flowable.engine.runtime.ProcessInstance; | import org.flowable.engine.runtime.ProcessInstance; | ||||
| import org.flowable.identitylink.api.IdentityLink; | import org.flowable.identitylink.api.IdentityLink; | ||||
| @@ -12,6 +12,8 @@ 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.*; | import com.iformall.mapper.*; | ||||
| import com.iformall.service.WxFlowRecordService; | |||||
| import com.iformall.service.WxFlowService; | |||||
| import com.iformall.service.WxMerchantService; | import com.iformall.service.WxMerchantService; | ||||
| import com.iformall.service.WxRentContractService; | import com.iformall.service.WxRentContractService; | ||||
| import com.iformall.utils.Constant; | import com.iformall.utils.Constant; | ||||
| @@ -19,12 +21,14 @@ import com.iformall.utils.DateUtils; | |||||
| import org.apache.commons.io.FileUtils; | import org.apache.commons.io.FileUtils; | ||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| import org.apache.poi.xwpf.usermodel.XWPFDocument; | import org.apache.poi.xwpf.usermodel.XWPFDocument; | ||||
| import org.flowable.engine.RuntimeService; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
| import org.springframework.transaction.annotation.Transactional; | import org.springframework.transaction.annotation.Transactional; | ||||
| import org.springframework.util.Assert; | import org.springframework.util.Assert; | ||||
| import org.springframework.util.CollectionUtils; | |||||
| import javax.servlet.http.HttpServletRequest; | import javax.servlet.http.HttpServletRequest; | ||||
| import javax.servlet.http.HttpServletResponse; | import javax.servlet.http.HttpServletResponse; | ||||
| @@ -73,6 +77,12 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| @Autowired | @Autowired | ||||
| WxBrandMapper WxBrandMapper; | WxBrandMapper WxBrandMapper; | ||||
| @Autowired | |||||
| WxFlowRecordService wxFlowRecordService; | |||||
| @Autowired | |||||
| RuntimeService runtimeService; | |||||
| @Override | @Override | ||||
| public Map<String, Object> listAsPage(WxRentContract record, Integer pageIndex, Integer pageSize) { | public Map<String, Object> listAsPage(WxRentContract record, Integer pageIndex, Integer pageSize) { | ||||
| Object rentContractStatusInfo = getRentContractStatusInfo(record.getTenantId()); | Object rentContractStatusInfo = getRentContractStatusInfo(record.getTenantId()); | ||||
| @@ -611,9 +621,39 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| //审核流程中止 | //审核流程中止 | ||||
| List<Long> collect = wxRentContractMapper.getRentInvalidList(wxRentContract).stream() | List<Long> collect = wxRentContractMapper.getRentInvalidList(wxRentContract).stream() | ||||
| .map(r -> r.getId()).collect(Collectors.toList()); | .map(r -> r.getId()).collect(Collectors.toList()); | ||||
| if (!collect.isEmpty()) { | |||||
| //中止 | |||||
| //todo:结束审批流 by luozukai | |||||
| if (!CollectionUtils.isEmpty(collect)) { | |||||
| // 结束审批流 by luozukai | |||||
| WxFlowRecord wxFlowRecord = new WxFlowRecord(); | |||||
| wxFlowRecord.setIds(collect); | |||||
| List<WxFlowRecord> flowRecordList = wxFlowRecordService.findList(wxFlowRecord); | |||||
| if (!CollectionUtils.isEmpty(flowRecordList)) { | |||||
| for (WxFlowRecord flowRecord:flowRecordList) { | |||||
| try { | |||||
| runtimeService.deleteProcessInstance(flowRecord.getProcessInstanceId(), "合同作废"); | |||||
| // 修改合同审核状态为驳回 | |||||
| WxRentContract rentContract = new WxRentContract(); | |||||
| rentContract.setId(flowRecord.getBusinessId()); | |||||
| rentContract.setApplyStatus(EnumRentContractAppStatus.REJECT.getCode()); | |||||
| updateApplyStatus(rentContract); | |||||
| // 保存审批历史入 | |||||
| WxFlowRecord updateRecord = new WxFlowRecord(); | |||||
| updateRecord.setBusinessId(flowRecord.getBusinessId()); | |||||
| updateRecord.setTaskId(flowRecord.getTaskId()); | |||||
| updateRecord.setProcessInstanceId(flowRecord.getProcessInstanceId()); | |||||
| updateRecord.setRemark(flowRecord.getRemark()); | |||||
| updateRecord.setUserId(flowRecord.getUserId()); | |||||
| updateRecord.setStatus(EnumFlowRecordStatus.CANCLE.getCode()); | |||||
| updateRecord.setBusinessType(flowRecord.getBusinessType()); | |||||
| updateRecord.setUserName(flowRecord.getUserName()); | |||||
| updateRecord.setTaskKey(flowRecord.getTaskKey()); | |||||
| updateRecord.setTaskName(flowRecord.getTaskName()); | |||||
| wxFlowRecordService.saveOrUpdate(updateRecord); | |||||
| }catch (Exception e){ | |||||
| logger.error("deleteProcessInstance error",e); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | } | ||||
| //把状态为签约而商户未关联的数据改为待签约状态 | //把状态为签约而商户未关联的数据改为待签约状态 | ||||
| @@ -23,12 +23,13 @@ | |||||
| <result column="phone" property="phone"/> | <result column="phone" property="phone"/> | ||||
| <result column="create_date" property="createDate"/> | <result column="create_date" property="createDate"/> | ||||
| <result column="update_date" property="updateDate"/> | <result column="update_date" property="updateDate"/> | ||||
| <result column="stayed_time" property="stayedTime"/> | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`tenant_id`,`vendor_type`,`create_date`,`update_date`,syn_id,park_id,park_name,user_type, | `id`,`tenant_id`,`vendor_type`,`create_date`,`update_date`,syn_id,park_id,park_name,user_type, | ||||
| plate_number,entrance_time,exit_time,fee,fee_time,coupon,coupon_code,fix_parking_id,remaining_days,discount_amount,phone | plate_number,entrance_time,exit_time,fee,fee_time,coupon,coupon_code,fix_parking_id,remaining_days,discount_amount,phone | ||||
| ,paid_service_fee,create_date,update_date | |||||
| ,paid_service_fee,create_date,update_date,stayed_time | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| @@ -34,7 +34,12 @@ | |||||
| <if test=" null != businessId "> | <if test=" null != businessId "> | ||||
| and `business_id` = #{businessId} | and `business_id` = #{businessId} | ||||
| </if> | </if> | ||||
| <if test=" null != ids "> | |||||
| and id in | |||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||||
| #{idItem} | |||||
| </foreach> | |||||
| </if> | |||||
| order by create_date desc | order by create_date desc | ||||
| </sql> | </sql> | ||||