添加改变暂挂状态接口

release
yishiqihuasheng 2 years ago
parent e883d86a87
commit aa0cc79890
  1. 61
      dxhy-base/src/main/java/com/dxhy/base/controller/BaseInvoiceController.java
  2. 2
      dxhy-base/src/main/java/com/dxhy/base/dao/BaseTDxRecordInvoiceDao.java
  3. 2
      dxhy-base/src/main/java/com/dxhy/base/entity/BaseTDxRecordInvoice.java
  4. 2
      dxhy-base/src/main/java/com/dxhy/base/model/BaseSggxCxRespVO.java
  5. 14
      dxhy-base/src/main/java/com/dxhy/base/service/invoicecheck/BaseInvoiceManualCheckServiceImpl.java
  6. 3
      dxhy-base/src/main/java/com/dxhy/base/service/tdxrecordinvoice/BaseIRzTDxRecordInvoiceService.java
  7. 20
      dxhy-base/src/main/java/com/dxhy/base/service/tdxrecordinvoice/BaseRzTDxRecordInvoiceServiceImpl.java
  8. 19
      dxhy-base/src/main/resources/mapper/BaseSggxcxMapper.xml

@ -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));
}
}
}

@ -214,4 +214,6 @@ public interface BaseTDxRecordInvoiceDao extends BaseMapper<BaseTDxRecordInvoice
BigDecimal selectCustomsDkse(Map<String, Object> pramsMap);
List<BaseTDxRecordInvoice> selectInTellingCheck(Map<String, Object> pramsMap);
void updateSuspendType(Map<String,Object> pramsMap);
}

@ -520,4 +520,6 @@ public class BaseTDxRecordInvoice implements Serializable {
private String suspendStatus;
private String suspendDate;
private String bzr;
}

@ -163,4 +163,6 @@ public class BaseSggxCxRespVO {
private String suspendDate;
private String bzr;
}

@ -205,6 +205,13 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx
} else if ("0".equals(pageList.get(i).getInAccountStatus())) {
vo.setInAccountStatus("未入账");
}
String suspendStatus = pageList.get(i).getSuspendStatus();
if ("1".equals(suspendStatus)){
vo.setSuspendStatus("是");
}else {
vo.setSuspendStatus("");
}
vo.setBzr(pageList.get(i).getBzr());
vo.setPaymentStatus(dictdetaServcice.queryDictName(DictConstant.FK_STATUS,pageList.get(i).getPaymentStatus()));
vo.setPaymentDate(pageList.get(i).getPaymentDate());
vo.setGfmc(pageList.get(i).getGfName());
@ -240,12 +247,7 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx
voList.add(vo);
continue;
}
String suspendStatus = pageList.get(i).getSuspendStatus();
if ("1".equals(suspendStatus)){
vo.setSuspendStatus("是");
}else {
vo.setSuspendDate("否");
}
voList.add(vo);
}
}

@ -1,5 +1,6 @@
package com.dxhy.base.service.tdxrecordinvoice;
import java.util.List;
import java.util.Map;
import com.dxhy.base.entity.BaseTDxRecordInvoice;
@ -68,4 +69,6 @@ public interface BaseIRzTDxRecordInvoiceService extends MpBaseService<BaseTDxRec
* @return 返回结果
*/
String identifiAllCount(Map<String, Object> pramsMap);
String updateSuspendType(Map<String,Object> pramsMap);
}

@ -421,6 +421,26 @@ public class BaseRzTDxRecordInvoiceServiceImpl extends MpBaseServiceImpl<BaseTDx
return super.responseResult(json);
}
@Override
public String updateSuspendType(Map<String,Object> pramsMap) {
String suspendType = (String) pramsMap.get("suspendType");
if ("0".equals(suspendType)){
pramsMap.put("suspendStatus","0");
pramsMap.put("suspendDate","");
}else {
pramsMap.put("suspendStatus","1");
String date = DateUtils.dateToStr(new Date());
String suspendDate = date.substring(0, 7);
pramsMap.put("suspendDate",suspendDate);
}
String dbName = (String) pramsMap.get("dbName");
DynamicContextHolder.push(dbName+DbConstant.BUSINESS_WRITE);
super.baseMapper.updateSuspendType(pramsMap);
return "操作成功";
}
@Override
public String identifiByAll(Map<String, Object> pramsMap) {

@ -34,6 +34,7 @@
<result column="comp_code" property="compCode"/>
<result column="suspend_status" property="suspendStatus"/>
<result column="suspend_date" property="suspendDate"/>
<result column="bzr" property="bzr"/>
</resultMap>
<resultMap id="hjResultMap"
type="com.dxhy.base.entity.BaseTDxRecordInvoice">
@ -60,7 +61,7 @@
</select>
<select id="selectSggxcx" parameterType="java.util.Map"
resultMap="SggxcxResultMap" databaseId="mysql">
select t.invoice_type,t.dept_id,t.dept_name,t.comp_code
select t.invoice_type,t.dept_id,t.dept_name,t.comp_code,t.bzr
,t.id,t.invoice_code,t.invoice_no,t.gf_name,t.gf_tax_no,t.xf_name,
DATE_FORMAT(t.invoice_date,'%Y-%m-%d')invoice_date,t.invoice_amount,t.tax_amount,t.invoice_status,DATE_FORMAT(t.qs_date,'%Y-%m-%d')qs_date
,t.qs_type,t.qs_status,t.dk_tax_amount,t.qs_name,t.sn_voucher_number,t.posting_time,t.image_id,t.account_period,
@ -114,6 +115,9 @@
<if test="suspendDate != null and suspendDate != '' and suspendDate != 'null' ">
t.suspend_date = #{suspendDate}
</if>
<if test="bzr != null and bzr != '' and bzr != 'null'">
t.bzr like concat('%',#{bzr},'%')
</if>
<if test="qszt != null and qszt != '' and qszt != 'null' ">
and t.qs_status = #{qszt}
</if>
@ -427,6 +431,9 @@
<if test="suspendDate != null and suspendDate != '' and suspendDate != 'null' ">
t.suspend_date = #{suspendDate}
</if>
<if test="bzr != null and bzr != '' and bzr != 'null'">
t.bzr like cancat('%',#{bzr},'%')
</if>
<if
test="qsksrq != null and qsksrq != '' and qsksrq != 'null' and qsjsrq != null and qsjsrq != '' and qsjsrq != 'null'">
and date_format(t.qs_date,'%Y-%m-%d') between #{qsksrq} and #{qsjsrq}
@ -1405,4 +1412,14 @@
</if>
</select>
<update id="updateSuspendType" parameterType="java.util.Map" databaseId="mysql">
update t_dx_record_invoice
set suspend_status = #{suspendStatus},
suspend_date = #{suspendDate}
where uuid in
<foreach collection="uuids" item="uuid" index="index" open="(" separator="," close=")">
#{uuid}
</foreach>
</update>
</mapper>

Loading…
Cancel
Save