|
@@ -9,7 +9,9 @@ import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
|
|
import com.yh.saas.plugin.yiliangyiyun.entity.ExpenseInfo;
|
|
import com.yh.saas.plugin.yiliangyiyun.entity.ExpenseInfo;
|
|
import com.yh.saas.plugin.yiliangyiyun.entity.FuelFillingInfo;
|
|
import com.yh.saas.plugin.yiliangyiyun.entity.FuelFillingInfo;
|
|
import com.yh.saas.plugin.yiliangyiyun.entity.ShortFillingInfo;
|
|
import com.yh.saas.plugin.yiliangyiyun.entity.ShortFillingInfo;
|
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.entity.StatusRecord;
|
|
import com.yh.saas.plugin.yiliangyiyun.mapper.CommonUserMapper;
|
|
import com.yh.saas.plugin.yiliangyiyun.mapper.CommonUserMapper;
|
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.mapper.StatusRecordMapper;
|
|
import com.yh.saas.plugin.yiliangyiyun.service.IExpenseInfoService;
|
|
import com.yh.saas.plugin.yiliangyiyun.service.IExpenseInfoService;
|
|
import com.yh.saas.plugin.yiliangyiyun.service.IFuelFillingInfoService;
|
|
import com.yh.saas.plugin.yiliangyiyun.service.IFuelFillingInfoService;
|
|
import com.yh.saas.plugin.yiliangyiyun.service.IShortFillingInfoService;
|
|
import com.yh.saas.plugin.yiliangyiyun.service.IShortFillingInfoService;
|
|
@@ -29,9 +31,14 @@ public class FuelFingListener extends AbstractWorkflowTaskListener {
|
|
private IExpenseInfoService expenseInfoService;
|
|
private IExpenseInfoService expenseInfoService;
|
|
@Autowired
|
|
@Autowired
|
|
private IAuditHistoryService auditHistoryService;
|
|
private IAuditHistoryService auditHistoryService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private StatusRecordMapper statusRecordMapper;
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
|
|
public void handleStatusChanged(String businessKey, String status, String statusEn, boolean processIsEnd) {
|
|
FuelFillingInfo fuelFillingInfo = fuelFillingInfoService.selectById(businessKey);
|
|
FuelFillingInfo fuelFillingInfo = fuelFillingInfoService.selectById(businessKey);
|
|
|
|
+ StatusRecord statusRecord = new StatusRecord();
|
|
|
|
+ StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
|
|
if (fuelFillingInfo == null) {
|
|
if (fuelFillingInfo == null) {
|
|
ShortFillingInfo shortFillingInfo = shortFillingInfoService.selectById(businessKey);
|
|
ShortFillingInfo shortFillingInfo = shortFillingInfoService.selectById(businessKey);
|
|
if (processIsEnd) {
|
|
if (processIsEnd) {
|
|
@@ -39,8 +46,28 @@ public class FuelFingListener extends AbstractWorkflowTaskListener {
|
|
// shortFillingInfo.setStatus(StatusEnum.ORDER_PASSED.getName());
|
|
// shortFillingInfo.setStatus(StatusEnum.ORDER_PASSED.getName());
|
|
shortFillingInfo.setWorkflowId(null);
|
|
shortFillingInfo.setWorkflowId(null);
|
|
shortFillingInfo.setApproveStatus(null);
|
|
shortFillingInfo.setApproveStatus(null);
|
|
|
|
+
|
|
|
|
+ if(statusRecord1 != null){
|
|
|
|
+ statusRecord1.setStatus(StatusEnum.ORDER_PASSED.getName());
|
|
|
|
+ statusRecordMapper.updateById(statusRecord1);
|
|
|
|
+ }
|
|
|
|
+ else{
|
|
|
|
+ statusRecord.setId(businessKey);
|
|
|
|
+ statusRecord.setStatus(StatusEnum.ORDER_PASSED.getName());
|
|
|
|
+ statusRecordMapper.insert(statusRecord);
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
shortFillingInfo.setApproveStatus(status);
|
|
shortFillingInfo.setApproveStatus(status);
|
|
|
|
+
|
|
|
|
+ if(statusRecord1 != null){
|
|
|
|
+ statusRecord1.setStatus(status);
|
|
|
|
+ statusRecordMapper.updateById(statusRecord1);
|
|
|
|
+ }
|
|
|
|
+ else{
|
|
|
|
+ statusRecord.setId(businessKey);
|
|
|
|
+ statusRecord.setStatus(status);
|
|
|
|
+ statusRecordMapper.insert(statusRecord);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
shortFillingInfoService.updateAllColumnById(shortFillingInfo);
|
|
shortFillingInfoService.updateAllColumnById(shortFillingInfo);
|
|
if (shortFillingInfo == null) {
|
|
if (shortFillingInfo == null) {
|
|
@@ -52,14 +79,26 @@ public class FuelFingListener extends AbstractWorkflowTaskListener {
|
|
fuelFillingInfo.setStatus(StatusEnum.ORDER_PASSED.getName());
|
|
fuelFillingInfo.setStatus(StatusEnum.ORDER_PASSED.getName());
|
|
fuelFillingInfo.setWorkflowId(null);
|
|
fuelFillingInfo.setWorkflowId(null);
|
|
fuelFillingInfo.setApproveStatus(null);
|
|
fuelFillingInfo.setApproveStatus(null);
|
|
-// ExpenseInfo expenseInfo=expenseInfoService.selectById(fuelFillingInfo.getExpenseId());
|
|
|
|
-// if (expenseInfo!=null){
|
|
|
|
-// expenseInfo.setStatusFlag(StatusEnum.COST_PAYMENT.getFlag());
|
|
|
|
-// expenseInfo.setStatus(StatusEnum.COST_PAYMENT.getName());
|
|
|
|
-// expenseInfoService.updateAllColumnById(expenseInfo);
|
|
|
|
-// }
|
|
|
|
|
|
+ if(statusRecord1 != null){
|
|
|
|
+ statusRecord1.setStatus(StatusEnum.ORDER_PASSED.getName());
|
|
|
|
+ statusRecordMapper.updateById(statusRecord1);
|
|
|
|
+ }
|
|
|
|
+ else{
|
|
|
|
+ statusRecord.setId(businessKey);
|
|
|
|
+ statusRecord.setStatus(StatusEnum.ORDER_PASSED.getName());
|
|
|
|
+ statusRecordMapper.insert(statusRecord);
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
fuelFillingInfo.setApproveStatus(status);
|
|
fuelFillingInfo.setApproveStatus(status);
|
|
|
|
+ if(statusRecord1 != null){
|
|
|
|
+ statusRecord1.setStatus(status);
|
|
|
|
+ statusRecordMapper.updateById(statusRecord1);
|
|
|
|
+ }
|
|
|
|
+ else{
|
|
|
|
+ statusRecord.setId(businessKey);
|
|
|
|
+ statusRecord.setStatus(status);
|
|
|
|
+ statusRecordMapper.insert(statusRecord);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
fuelFillingInfoService.updateAllColumnById(fuelFillingInfo);
|
|
fuelFillingInfoService.updateAllColumnById(fuelFillingInfo);
|
|
}
|
|
}
|
|
@@ -85,9 +124,17 @@ public class FuelFingListener extends AbstractWorkflowTaskListener {
|
|
// expenseInfoService.updateAllColumnById(expenseInfo);
|
|
// expenseInfoService.updateAllColumnById(expenseInfo);
|
|
// }
|
|
// }
|
|
fuelFillingInfoService.updateAllColumnById(fuelFillingInfo);
|
|
fuelFillingInfoService.updateAllColumnById(fuelFillingInfo);
|
|
-// auditHistoryService.delete(new EntityWrapper<AuditHistory>()
|
|
|
|
-// .eq("business_id",businessKey));
|
|
|
|
-// commonUserMapper.deleteWorkHis(businessKey);
|
|
|
|
|
|
+ StatusRecord statusRecord = new StatusRecord();
|
|
|
|
+ StatusRecord statusRecord1 = statusRecordMapper.selectById(businessKey);
|
|
|
|
+ if(statusRecord1 != null){
|
|
|
|
+ statusRecord1.setStatus(StatusEnum.PURCHASE_FAILED.getName());
|
|
|
|
+ statusRecordMapper.updateById(statusRecord1);
|
|
|
|
+ }
|
|
|
|
+ else{
|
|
|
|
+ statusRecord.setId(businessKey);
|
|
|
|
+ statusRecord.setStatus(StatusEnum.PURCHASE_FAILED.getName());
|
|
|
|
+ statusRecordMapper.insert(statusRecord);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|