|
|
|
@ -2,6 +2,8 @@ package com.dxhy.base.controller; |
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import com.dxhy.base.entity.BaseTDxRecordInvoice; |
|
|
|
|
import com.dxhy.base.model.BaseDrgxReqVO; |
|
|
|
|
import com.dxhy.base.service.fpxxrz.BaseCxrzfpService; |
|
|
|
|
import com.dxhy.base.service.fpxxrz.BaseRzFpxxService; |
|
|
|
@ -9,7 +11,9 @@ import com.dxhy.base.service.invoicecheck.*; |
|
|
|
|
import com.dxhy.base.service.tdxrecordinvoice.BaseIRzTDxRecordInvoiceService; |
|
|
|
|
import com.dxhy.common.aspect.SysLog; |
|
|
|
|
import com.dxhy.common.constant.CommonConstants; |
|
|
|
|
import com.dxhy.common.constant.DbConstant; |
|
|
|
|
import com.dxhy.common.controller.AbstractController; |
|
|
|
|
import com.dxhy.common.datasource.config.DynamicContextHolder; |
|
|
|
|
import com.dxhy.common.util.InvoiceUtil; |
|
|
|
|
import com.dxhy.common.util.StringHelper; |
|
|
|
|
import com.dxhy.common.util.UserInfoUtil; |
|
|
|
@ -29,6 +33,7 @@ import javax.annotation.Resource; |
|
|
|
|
import java.util.*; |
|
|
|
|
import java.util.regex.Matcher; |
|
|
|
|
import java.util.regex.Pattern; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @author kangzq |
|
|
|
@ -475,6 +480,7 @@ public class BaseInvoiceController extends AbstractController { |
|
|
|
|
String companyCode = (String) map.get("companyCode"); |
|
|
|
|
String suspendStatus = (String) map.get("suspendStatus"); |
|
|
|
|
String suspendDate = (String) map.get("suspendDate"); |
|
|
|
|
String bzr = (String) map.get("bzr"); |
|
|
|
|
if (StringUtils.isNotEmpty(suspendDate) && suspendDate.length() >7){ |
|
|
|
|
suspendDate = suspendDate.substring(0,7); |
|
|
|
|
} |
|
|
|
@ -516,6 +522,7 @@ public class BaseInvoiceController extends AbstractController { |
|
|
|
|
pramsMap.put("imageNumber", map.get("imageNumber")); |
|
|
|
|
pramsMap.put("suspendStatus",suspendStatus); |
|
|
|
|
pramsMap.put("suspendDate",suspendDate); |
|
|
|
|
pramsMap.put("bzr",bzr); |
|
|
|
|
if (map.get("accountPeriod") != null && !"".equals(map.get("accountPeriod"))) { |
|
|
|
|
String accountPeriod = map.get("accountPeriod").toString().substring(0,7); |
|
|
|
|
pramsMap.put("accountPeriod", accountPeriod); |
|
|
|
@ -1243,4 +1250,58 @@ public class BaseInvoiceController extends AbstractController { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@PostMapping("/sgrz/changeSuspend") |
|
|
|
|
@SysLog("修改暂挂状态") |
|
|
|
|
public Object changeSuspend(@RequestBody Map<String,Object> map){ |
|
|
|
|
|
|
|
|
|
if (map == null){ |
|
|
|
|
return ResponseEntity.ok(R.error("缺少请求参数")); |
|
|
|
|
} |
|
|
|
|
List<String> gfshAll = UserInfoUtil.getGfshAll(getUserInfo().getOrg()); |
|
|
|
|
if (gfshAll ==null || gfshAll.isEmpty()){ |
|
|
|
|
return ResponseEntity.ok(R.error("购方信息不能为空")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
JSONObject jsonObject = new JSONObject(map); |
|
|
|
|
String uuids = jsonObject.getString("uuids"); |
|
|
|
|
if (StringUtils.isEmpty(uuids)){ |
|
|
|
|
return ResponseEntity.ok(R.error("请先选择要暂挂的数据")); |
|
|
|
|
} |
|
|
|
|
String suspendType = jsonObject.getString("suspendType"); |
|
|
|
|
if (StringUtils.isEmpty(suspendType)){ |
|
|
|
|
return ResponseEntity.ok(R.error("暂挂状态不能为空")); |
|
|
|
|
} |
|
|
|
|
String[] uuidArray = uuids.split(","); |
|
|
|
|
List<String> uuidList = Arrays.asList(uuidArray); |
|
|
|
|
|
|
|
|
|
//查询库中是否包含对应数据
|
|
|
|
|
QueryWrapper<BaseTDxRecordInvoice> queryWrap = new QueryWrapper<>(); |
|
|
|
|
queryWrap.in("uuid",uuidList); |
|
|
|
|
|
|
|
|
|
DynamicContextHolder.push(getUserInfo().getDbName()+ DbConstant.BUSINESS_READ); |
|
|
|
|
List<BaseTDxRecordInvoice> list = baseIRzTDxRecordInvoiceService.list(queryWrap); |
|
|
|
|
if (list == null || list.isEmpty()){ |
|
|
|
|
return ResponseEntity.ok(R.error("没有可操作的数据")); |
|
|
|
|
} |
|
|
|
|
List<String> suspendTypes = list.stream().map(BaseTDxRecordInvoice::getSuspendStatus).collect(Collectors.toList()); |
|
|
|
|
if (suspendTypes.contains("1")&& (suspendTypes.contains("0")||suspendTypes.contains(null) || suspendTypes.contains(""))){ |
|
|
|
|
return ResponseEntity.ok(R.error("同时存在暂挂状态为是和否的数据,请重新选择!")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Map<String,Object> pramsMap = new HashMap<>(); |
|
|
|
|
pramsMap.put("suspendType",suspendType); |
|
|
|
|
pramsMap.put("uuids",uuids); |
|
|
|
|
pramsMap.put("dbName",getUserInfo().getDbName()); |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
return ResponseEntity |
|
|
|
|
.ok(R.ok().put("data",baseIRzTDxRecordInvoiceService.updateSuspendType(pramsMap))); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
log.error("", e); |
|
|
|
|
return ResponseEntity.ok(R.error(CommonConstants.MSG_ERR_DEFAULT)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|