|
|
@@ -33,6 +33,7 @@ import org.springblade.client.feign.ISerialClient;
|
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
|
import org.springblade.core.secure.utils.SecureUtil;
|
|
|
import org.springblade.core.tool.api.R;
|
|
|
+import org.springblade.core.tool.utils.Func;
|
|
|
import org.springblade.core.tool.utils.ObjectUtil;
|
|
|
import org.springblade.finance.dto.ApplyDTO;
|
|
|
import org.springblade.finance.feign.IFinanceClient;
|
|
|
@@ -630,6 +631,8 @@ public class DeclareCustomsServiceImpl extends ServiceImpl<DeclareCustomsMapper,
|
|
|
|
|
|
/**
|
|
|
* 撤销审核
|
|
|
+ * 初审撤销:提交后未审核,允许撤销;审核通过 admin允许撤销;提交复审后,不允许撤销
|
|
|
+ * 复审撤销:提交后未审核,允许撤销;审核通过 admin允许撤销同时撤销账单;做了账款结算,需撤销帐款结算后再撤销
|
|
|
*/
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@@ -639,29 +642,52 @@ public class DeclareCustomsServiceImpl extends ServiceImpl<DeclareCustomsMapper,
|
|
|
if (ObjectUtil.isEmpty(customs)) {
|
|
|
throw new SecurityException("撤销失败,未找到单据");
|
|
|
}
|
|
|
- if (customs.getStatus().equals(2)) {
|
|
|
- throw new SecurityException("撤销失败,订单正在审批中");
|
|
|
- } else if (customs.getStatus().equals(3)) {
|
|
|
- throw new SecurityException("撤销失败,订单已审核通过");
|
|
|
- } else if (customs.getStatus().equals(0)) {
|
|
|
- throw new SecurityException("撤销失败,订单未提交审核");
|
|
|
- } else if (customs.getStatus().equals(6)) {
|
|
|
- throw new SecurityException("撤销失败,订单正在复审审批中");
|
|
|
- } else if (customs.getStatus().equals(7)) {
|
|
|
- throw new SecurityException("撤销失败,订单复审已审核通过");
|
|
|
- } else if (customs.getStatus().equals(4)) {
|
|
|
- throw new SecurityException("撤销失败,订单未提交复审审核");
|
|
|
+ if (ObjectUtil.isEmpty(declareCustoms.getCheckFlag())){
|
|
|
+ throw new SecurityException("缺少必要参数");
|
|
|
}
|
|
|
|
|
|
- if (customs.getStatus() == 1) {
|
|
|
+ String role = AuthUtil.getUserRole();
|
|
|
+
|
|
|
+ if (declareCustoms.getCheckFlag() == 1){//初审撤销
|
|
|
+
|
|
|
+ if (customs.getStatus() == 0){
|
|
|
+ throw new SecurityException("撤销失败,订单未提交审核");
|
|
|
+ }
|
|
|
+ if (role.contains("admin")){
|
|
|
+ if (customs.getStatus() > 4){
|
|
|
+ throw new SecurityException("撤销失败,订单已进入复审流程");
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ if (customs.getStatus() == 2) {
|
|
|
+ throw new SecurityException("撤销失败,订单正在审批中");
|
|
|
+ } else if (customs.getStatus() == 3) {
|
|
|
+ throw new SecurityException("撤销失败,订单已审核通过");
|
|
|
+ } else if (customs.getStatus() == 4){
|
|
|
+ throw new SecurityException("撤销失败,订单初审已完成");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//修改单据状态
|
|
|
customs.setStatus(0);
|
|
|
- customs.setAuditStatus("初审撤销");
|
|
|
+ customs.setAuditStatus("录入");
|
|
|
customs.setUpdateUser(AuthUtil.getUserId());
|
|
|
customs.setUpdateTime(new Date());
|
|
|
//撤销
|
|
|
iCheckClient.deteleByBillIdOrGrade(declareCustoms.getId(), 1);
|
|
|
- } else if (customs.getStatus() == 5) {
|
|
|
+
|
|
|
+ } else if (declareCustoms.getCheckFlag() == 2){//复审撤销
|
|
|
+
|
|
|
+ if (customs.getStatus() == 4){
|
|
|
+ throw new SecurityException("撤销失败,订单未提交审核");
|
|
|
+ }
|
|
|
+ if (!role.contains("admin")){
|
|
|
+ if (customs.getStatus() == 6) {
|
|
|
+ throw new SecurityException("撤销失败,订单正在复审审批中");
|
|
|
+ } else if (customs.getStatus() == 7) {
|
|
|
+ throw new SecurityException("撤销失败,订单复审已审核通过");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//获取账单信息
|
|
|
Acc acc = new Acc();
|
|
|
acc.setSrcParentId(customs.getId());
|
|
|
@@ -686,7 +712,7 @@ public class DeclareCustomsServiceImpl extends ServiceImpl<DeclareCustomsMapper,
|
|
|
|
|
|
//修改单据状态
|
|
|
customs.setStatus(4);
|
|
|
- customs.setAuditStatus("复审撤销");
|
|
|
+ customs.setAuditStatus("初审完成");
|
|
|
customs.setUpdateUser(AuthUtil.getUserId());
|
|
|
customs.setUpdateTime(new Date());
|
|
|
|
|
|
@@ -703,7 +729,6 @@ public class DeclareCustomsServiceImpl extends ServiceImpl<DeclareCustomsMapper,
|
|
|
}
|
|
|
//撤销
|
|
|
iCheckClient.deteleByBillIdOrGrade(declareCustoms.getId(), 2);
|
|
|
-
|
|
|
}
|
|
|
|
|
|
baseMapper.updateById(customs);
|