|
|
|
@@ -16,6 +16,7 @@ import com.iformall.mapper.*; |
|
|
|
import com.iformall.service.WxFlowRecordService; |
|
|
|
import com.iformall.service.WxFlowService; |
|
|
|
import com.iformall.service.WxPropertyContractService; |
|
|
|
import com.iformall.service.WxRentContractService; |
|
|
|
import com.iformall.utils.DateUtils; |
|
|
|
import org.apache.commons.collections.map.HashedMap; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
@@ -25,6 +26,7 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import java.io.*; |
|
|
|
@@ -69,6 +71,9 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService |
|
|
|
@Autowired |
|
|
|
WxFlowRecordService wxFlowRecordService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
WxRentContractService wxRentContractService; |
|
|
|
|
|
|
|
@Override |
|
|
|
public Map<String, Object> listAsPage(WxPropertyContract record, Integer pageIndex, Integer pageSize) { |
|
|
|
//Object rentContractStatusInfo = getRentContractStatusInfo(record); |
|
|
|
@@ -325,19 +330,42 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService |
|
|
|
message = "更新物业合同信息成功"; |
|
|
|
} |
|
|
|
|
|
|
|
if (!CollectionUtils.isEmpty(record.getFlowParams())) { |
|
|
|
if(wxFlowService.getModelByType((Integer)record.getFlowParams().get("businessType"),record.getTenantId()) == null){ |
|
|
|
updatePropertyContractStatus(record.getId()); |
|
|
|
}else{ |
|
|
|
record.getFlowParams().put("businessId", record.getId().toString()); |
|
|
|
wxFlowService.start(record.getFlowParams(), userId, userName, record.getTenantId()); |
|
|
|
|
|
|
|
// 合同状态改成待签约 |
|
|
|
WxPropertyContract updateRentContract = new WxPropertyContract(); |
|
|
|
updateRentContract.setId(record.getId()); |
|
|
|
updateRentContract.setStatus(EnumRentContractStatus.WAIT_SIGN.getCode()); |
|
|
|
wxPropertyContractMapper.updateStatus(updateRentContract); |
|
|
|
logger.info("id:{},启动审批流成功", record.getId().toString()); |
|
|
|
if (record.getOperationType().equals(EnumContractOperationType.PART.getCode())) { |
|
|
|
if (!CollectionUtils.isEmpty(record.getFlowParams())) { |
|
|
|
if (wxFlowService.getModelByType((Integer) record.getFlowParams().get("businessType"), record.getTenantId()) == null) { |
|
|
|
updatePropertyContractStatus(record.getId()); |
|
|
|
} else { |
|
|
|
record.getFlowParams().put("businessId", record.getId().toString()); |
|
|
|
wxFlowService.start(record.getFlowParams(), userId, userName, record.getTenantId()); |
|
|
|
|
|
|
|
// 合同状态改成待签约 |
|
|
|
WxPropertyContract updateRentContract = new WxPropertyContract(); |
|
|
|
updateRentContract.setId(record.getId()); |
|
|
|
updateRentContract.setStatus(EnumRentContractStatus.WAIT_SIGN.getCode()); |
|
|
|
wxPropertyContractMapper.updateStatus(updateRentContract); |
|
|
|
logger.info("id:{},启动审批流成功", record.getId().toString()); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
//有模板,启动审批流,没有,直接生产账单 |
|
|
|
if (!CollectionUtils.isEmpty(record.getFlowParams())) { |
|
|
|
if (wxFlowService.getModelByType((Integer) record.getFlowParams().get("businessType"), record.getTenantId()) == null |
|
|
|
&& record.getMerchantId() != null) { |
|
|
|
wxRentContractService.updateRentContractStatus(record.getId()); |
|
|
|
} else { |
|
|
|
record.getFlowParams().put("businessId", record.getId().toString()); |
|
|
|
if (record.getMerchantId() != null) { |
|
|
|
record.getFlowParams().put("supplement", true); //设置补录 |
|
|
|
} |
|
|
|
wxFlowService.start(record.getFlowParams(), userId, userName, record.getTenantId()); |
|
|
|
|
|
|
|
// 合同状态改成待签约 |
|
|
|
WxRentContract updateRentContract = new WxRentContract(); |
|
|
|
updateRentContract.setId(record.getId()); |
|
|
|
updateRentContract.setStatus(EnumRentContractStatus.WAIT_SIGN.getCode()); |
|
|
|
wxRentContractMapper.updateStatus(updateRentContract); |
|
|
|
logger.info("id:{},启动审批流成功,是否补录:{}", record.getId().toString(), record.getMerchantId() != null); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|