feature:读入订单查询功能开发

zkh
路明慧 12 months ago
parent f81db55f71
commit 2f7df374f0
  1. 7
      order-management-order/src/main/java/com/dxhy/order/consumer/dao/SkOrderInfoMapper.java
  2. 4
      order-management-order/src/main/java/com/dxhy/order/consumer/dao/YyOrderInfoMapper.java
  3. 55
      order-management-order/src/main/java/com/dxhy/order/consumer/modules/bespoke/controller/OrderHandleController.java
  4. 3
      order-management-order/src/main/java/com/dxhy/order/consumer/modules/bespoke/model/req/ReqParam.java
  5. 7
      order-management-order/src/main/java/com/dxhy/order/consumer/modules/bespoke/service/OrderHandleService.java
  6. 3
      order-management-order/src/main/java/com/dxhy/order/consumer/modules/bespoke/service/OrderService.java
  7. 6
      order-management-order/src/main/java/com/dxhy/order/consumer/modules/bespoke/service/impl/OrderHandleServiceImpl.java
  8. 16
      order-management-order/src/main/java/com/dxhy/order/consumer/modules/bespoke/service/impl/SkOrderServiceImpl.java
  9. 21
      order-management-order/src/main/java/com/dxhy/order/consumer/modules/bespoke/service/impl/YyOrderServiceImpl.java
  10. 27
      order-management-order/src/main/resources/mybatis/mapper/SkOrderInfoMapper.xml
  11. 24
      order-management-order/src/main/resources/mybatis/mapper/YyOrderInfoMapper.xml
  12. 7
      sims-back-common/src/main/java/com/dxhy/management/common/constant/ConfigureConstant.java

@ -1,11 +1,18 @@
package com.dxhy.order.consumer.dao;
import com.dxhy.order.consumer.modules.bespoke.model.req.ReqParam;
import com.dxhy.order.consumer.modules.bespoke.model.sk.SkOrderInfo;
import java.util.List;
public interface SkOrderInfoMapper {
//插入订单信息
int insertSkOrderInfo(SkOrderInfo skOrderInfo);
//查询订单信息是否已存在
SkOrderInfo checkOrderExist(String xsddm);
//查询订单列表
List<SkOrderInfo> queryList(ReqParam reqParam);
}

@ -10,5 +10,9 @@ public interface YyOrderInfoMapper {
//插入订单
int insertYyOrderInfo(YyOrderInfo yyOrderInfo);
//查询订单是否存在
YyOrderInfo checkOrderExist(String cdlcode);
//查询订单列表
List<YyOrderInfo> queryList(ReqParam reqParam);
}

@ -2,13 +2,16 @@ package com.dxhy.order.consumer.modules.bespoke.controller;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson2.JSON;
import com.dxhy.base.common.constant.OrderManagementConstant;
import com.dxhy.base.common.model.R;
import com.dxhy.management.common.constant.ConfigureConstant;
import com.dxhy.order.baseservice.annotation.SysLog;
import com.dxhy.order.baseservice.constant.OrderValidateEnum;
import com.dxhy.order.baseservice.utils.PageUtils;
import com.dxhy.order.consumer.modules.bespoke.config.datasource.config.DynamicContextHolder;
import com.dxhy.order.consumer.modules.bespoke.model.req.ReqParam;
import com.dxhy.order.consumer.modules.bespoke.service.OrderHandleService;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
@ -74,5 +77,57 @@ public class OrderHandleController {
}
/**
* 订单列表查询
*
* @return
*/
@ApiOperation(value = "查询读入订单列表", notes = "查询读入订单列表")
@PostMapping("/queryList")
@SysLog(operation = "查询订单列表rest接口", operationDesc = "查询订单列表", key = "订单列表")
public R queryList(@RequestBody ReqParam reqParam) {
log.info("{}订单列表查询请求参数:{}", LOGGER_MSG, JSON.toJSONString(reqParam));
if (StringUtils.isNotBlank(reqParam.getStartTime())
&& StringUtils.isNotBlank(reqParam.getEndTime())) {
Date starttime = DateUtil.parseDate(reqParam.getStartTime());
Date endtime = DateUtil.parseDate(reqParam.getEndTime());
if (starttime.after(endtime)) {
log.error("{}开始时间不能大于结束时间", LOGGER_MSG);
return R.error(OrderValidateEnum.ORDER_TIME_ERROR.getKey(),
OrderValidateEnum.ORDER_TIME_ERROR.getMessage());
}
}
if (StringUtils.isNotBlank(reqParam.getReadTimeStart())
&& StringUtils.isNotBlank(reqParam.getReadTimeEnd())) {
Date starttime = DateUtil.parseDate(reqParam.getReadTimeEnd());
Date endtime = DateUtil.parseDate(reqParam.getReadTimeEnd());
if (starttime.after(endtime)) {
log.error("{}开始时间不能大于结束时间", LOGGER_MSG);
return R.error(OrderValidateEnum.ORDER_TIME_ERROR.getKey(),
OrderValidateEnum.ORDER_TIME_ERROR.getMessage());
}
}
if (StringUtils.isBlank(reqParam.getNsrsbh())) {
log.error("{},请求税号为空!", LOGGER_MSG);
return R.error(OrderValidateEnum.TAXCODE_ISNULL.getKey(), OrderValidateEnum.TAXCODE_ISNULL.getMessage());
}
if (StringUtils.isBlank(reqParam.getEntId())){
log.error("{},请求企业id为空!", LOGGER_MSG);
return R.error(OrderValidateEnum.ENTID_ISNULL.getKey(), OrderValidateEnum.ENTID_ISNULL.getMessage());
}
try {
return orderHandleService.queryList(reqParam);
}catch (Exception e){
log.error("{}查询读入订单异常", LOGGER_MSG, e);
return R.error("查询列表异常请联系运维人员");
}
}
}

@ -61,4 +61,7 @@ public class ReqParam {
//凭证号
private String pzh;
//购方名称
private String gfmc;
}

@ -10,4 +10,11 @@ public interface OrderHandleService {
* @return
*/
R readOrder(ReqParam reqParam);
/**
* 订单查询
* @param reqParam
* @return
*/
R queryList(ReqParam reqParam);
}

@ -7,4 +7,7 @@ public interface OrderService {
//订单读入
R orderRead(ReqParam reqParam);
//查询订单列表
R queryList(ReqParam reqParam);
}

@ -16,4 +16,10 @@ public class OrderHandleServiceImpl implements OrderHandleService {
OrderService orderService = SpringUtil.getBean(ServiceConfig.getService(reqParam.getNsrsbh()), OrderService.class);
return orderService.orderRead(reqParam);
}
@Override
public R queryList(ReqParam reqParam) {
OrderService orderService = SpringUtil.getBean(ServiceConfig.getService(reqParam.getNsrsbh()), OrderService.class);
return orderService.queryList(reqParam);
}
}

@ -1,7 +1,10 @@
package com.dxhy.order.consumer.modules.bespoke.service.impl;
import com.alibaba.fastjson2.JSON;
import com.dxhy.base.common.constant.OrderManagementConstant;
import com.dxhy.base.common.model.R;
import com.dxhy.base.common.utils.DecimalCalculateUtil;
import com.dxhy.base.common.utils.NsrsbhUtils;
import com.dxhy.base.thirdservice.module.base.service.BaseService;
import com.dxhy.management.common.constant.ConfigureConstant;
import com.dxhy.order.consumer.dao.SkOrderInfoMapper;
@ -13,6 +16,8 @@ import com.dxhy.order.consumer.modules.bespoke.model.sk.SkOrderInfo;
import com.dxhy.order.consumer.modules.bespoke.model.sk.SkOrderItemInfo;
import com.dxhy.order.consumer.modules.bespoke.service.OrderHandleService;
import com.dxhy.order.consumer.modules.bespoke.service.OrderService;
import com.github.pagehelper.PageInfo;
import com.github.pagehelper.page.PageMethod;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
@ -67,6 +72,17 @@ public class SkOrderServiceImpl implements OrderService {
return R.ok("成功读取" + count + "条订单数据");
}
@Override
public R queryList(ReqParam reqParam) {
int currPage = Integer.parseInt(reqParam.getCurrPage());
int pageSize = Integer.parseInt(reqParam.getPageSize());
log.debug("订单查询,当前页:{},页面条数:{}", currPage, pageSize);
PageMethod.startPage(currPage, pageSize);
List<SkOrderInfo> skOrderInfoList = skOrderInfoMapper.queryList(reqParam);
return R.ok().put(OrderManagementConstant.DATA, new PageInfo<>(skOrderInfoList));
}
@Transactional
public int saveOrder(SkOrderInfo skOrderInfo, List<SkOrderItemInfo> skOrderItemInfoList, ReqParam reqParam) {

@ -1,6 +1,7 @@
package com.dxhy.order.consumer.modules.bespoke.service.impl;
import com.alibaba.fastjson2.JSON;
import com.dxhy.base.common.constant.OrderManagementConstant;
import com.dxhy.base.common.model.R;
import com.dxhy.base.thirdservice.module.base.service.BaseService;
import com.dxhy.management.common.constant.ConfigureConstant;
@ -12,11 +13,12 @@ import com.dxhy.order.consumer.modules.bespoke.model.req.ReqParam;
import com.dxhy.order.consumer.modules.bespoke.model.yy.YyOrderInfo;
import com.dxhy.order.consumer.modules.bespoke.model.yy.YyOrderItemInfo;
import com.dxhy.order.consumer.modules.bespoke.service.OrderService;
import com.github.pagehelper.PageInfo;
import com.github.pagehelper.page.PageMethod;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.Date;
@ -66,6 +68,17 @@ public class YyOrderServiceImpl implements OrderService {
return R.ok("成功读取"+count+"条订单数据");
}
@Override
public R queryList(ReqParam reqParam) {
int currPage = Integer.parseInt(reqParam.getCurrPage());
int pageSize = Integer.parseInt(reqParam.getPageSize());
log.debug("订单查询,当前页:{},页面条数:{}", currPage, pageSize);
PageMethod.startPage(currPage, pageSize);
List<YyOrderInfo> yyOrderInfoList = yyOrderInfoMapper.queryList(reqParam);
return R.ok().put(OrderManagementConstant.DATA, new PageInfo<>(yyOrderInfoList));
}
@Transactional
public int saveOrder(YyOrderInfo yyOrderInfo, List<YyOrderItemInfo> yyOrderItemInfoList, ReqParam reqParam) {
@ -97,6 +110,12 @@ public class YyOrderServiceImpl implements OrderService {
yyOrderInfo.setDetailCount(String.valueOf(yyOrderItemInfoList.size()));
yyOrderInfo.setHsje(hsje.add(se).setScale(ConfigureConstant.INT_2).toPlainString());
yyOrderInfo.setSe(se.setScale(ConfigureConstant.INT_2).toPlainString());
if (yyOrderInfo.getCvouchtype().equals(ConfigureConstant.STRING_26)){
yyOrderInfo.setCvouchtype(ConfigureConstant.STRING_001);
}
if (yyOrderInfo.getCvouchtype().equals(ConfigureConstant.STRING_27)){
yyOrderInfo.setCvouchtype(ConfigureConstant.STRING_002);
}
yyOrderInfoMapper.insertYyOrderInfo(yyOrderInfo);
return ConfigureConstant.INT_1;

@ -133,4 +133,31 @@
where xsddm = #{xsddm}
and status = '0'
</select>
<select id="queryList" parameterType="com.dxhy.order.consumer.modules.bespoke.model.req.ReqParam" resultMap="SkOrderInfoResult">
<include refid="selectSkOrderInfoVo"/>
<where>
<if test="nsrsbh != null and nsrsbh != ''">
and nsrsbh = #{nsrsbh}
</if>
<if test="entId != null and entId != ''">
and ent_id = #{entId}
</if>
<if test="ddh != null and ddh != ''">
and xsddm = #{ddh}
</if>
<if test="gfmc != null and gfmc != ''">
and khmc = #{gfmc}
</if>
<if test="invoiceType != null and invoiceType != ''">
and fplx = #{invoiceType}
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
and kprq between #{startTime} and #{endTime}
</if>
<if test="readTimeStart != null and readTimeStart != '' and readTimeEnd != null and readTimeEnd != ''">
and create_time between #{readTimeStart} and #{readTimeEnd}
</if>
</where>
</select>
</mapper>

@ -140,4 +140,28 @@
where cdlcode = #{cdlcode}
and status = '0'
</select>
<select id="queryList" resultMap="YyOrderInfoResult" parameterType="com.dxhy.order.consumer.modules.bespoke.model.req.ReqParam">
<include refid="selectYyOrderInfoVo"/>
where nsrsbh = #{nsrsbh}
and ent_id = #{entId}
<if test="ddh != null and ddh != ''">
and cdlcode = #{ddh}
</if>
<if test="gfmc != null and gfmc != ''">
and ccusname = #{gfmc}
</if>
<if test="invoiceType != null and invoiceType != ''">
and cvouchtype = #{invoiceType}
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
and cdldate between #{startTime} and #{endTime}
</if>
<if test="pzh != null and pzh != ''">
and cpznum = #{pzh}
</if>
<if test="readTimeStart != null and readTimeStart != '' and readTimeEnd != null and readTimeEnd != ''">
and create_time between #{readTimeStart} and #{readTimeEnd}
</if>
</select>
</mapper>

@ -101,6 +101,10 @@ public class ConfigureConstant {
public static final String STRING_10 = "10";
public static final String STRING_26 = "26";
public static final String STRING_27 = "27";
public static final String STRING_100 = "100";
public static final String STRING_0000 = "0000";
@ -220,4 +224,7 @@ public class ConfigureConstant {
public static final int SPECIAL_MAX_ITEM_LENGTH = 8;
public static final String STRING_001 = "001";
public static final String STRING_002 = "002";
}

Loading…
Cancel
Save