Просмотр исходного кода

[审批流][添加][添加合同提前终止审批]

release_toaliyun_real
luozukai 7 лет назад
Родитель
Сommit
fb55ec4761
8 измененных файлов: 71 добавлений и 15 удалений
  1. +15
    -0
      mallinkAdmin/src/main/java/com/iformall/controller/WxFlowAbleController.java
  2. +12
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxFlowRecord.java
  3. +1
    -1
      mallinkService/src/main/java/com/iformall/mapper/WxFlowRecordMapper.java
  4. +0
    -1
      mallinkService/src/main/java/com/iformall/service/WxFlowRecordService.java
  5. +10
    -1
      mallinkService/src/main/java/com/iformall/service/WxFlowService.java
  6. +20
    -6
      mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java
  7. +3
    -3
      mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java
  8. +10
    -3
      mallinkService/src/main/resources/mapper/WxFlowRecordMapper.xml

+ 15
- 0
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());
}


/**
* 审批历史
*/


+ 12
- 0
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<Long> 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;
}


+ 1
- 1
mallinkService/src/main/java/com/iformall/mapper/WxFlowRecordMapper.java Просмотреть файл

@@ -8,5 +8,5 @@ public interface WxFlowRecordMapper extends CommonMapper<WxFlowRecord, Long> {

List<WxFlowRecord> findList(WxFlowRecord flowRecord);
void updateCurrStatus(WxFlowRecord record);
}

+ 0
- 1
mallinkService/src/main/java/com/iformall/service/WxFlowRecordService.java Просмотреть файл

@@ -19,5 +19,4 @@ public interface WxFlowRecordService {
void saveOrUpdate(WxFlowRecord flowRecord);



}

+ 10
- 1
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);
}

+ 20
- 6
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<WxFlowRecord> 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;
}



}

+ 3
- 3
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) {


+ 10
- 3
mallinkService/src/main/resources/mapper/WxFlowRecordMapper.xml Просмотреть файл

@@ -17,10 +17,11 @@
<result column="user_name" property="userName" />
<result column="task_key" property="taskKey" />
<result column="task_name" property="taskName" />
<result column="curr_status" property="currStatus" />
</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`,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 id="dynamicWhereConditions">
@@ -31,6 +32,9 @@
<if test=" null != businessId ">
and `business_id` = #{businessId}
</if>
<if test=" null != user_id ">
and `user_id` = #{userId}
</if>
<if test=" null != ids ">
and id in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
@@ -45,9 +49,12 @@
<include refid="dynamicWhereConditions" />
order by createDate desc
</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>

Загрузка…
Отмена
Сохранить