bug修改

pro
anthonywj 2 years ago
parent 94a6af5fef
commit bd23124565

@ -1113,8 +1113,23 @@ public class IoCodeTempController extends BaseController {
if (codeTempEntity.getMyCount() <= 0) {
return ResultVOUtils.error(500, "数量需要大于0");
}
IoCodeTempEntity tempEntity = codeTempService.selectById(codeTempEntity.getId());
codeTempEntity.setReCount(codeTempEntity.getMyCount() * udiCalCountUtil.getActCount(codeTempEntity.getNameCode()));
int count = tempEntity.getCount() - codeTempEntity.getCount();
//更新扫码详情
IoOrderDetailCodeEntity orderDetailCodeEntity = ioOrderDetailCodeService.findByUnique(codeTempEntity.getOrderId(), codeTempEntity.getRelId(), codeTempEntity.getBatchNo());
if (orderDetailCodeEntity != null) {
//扫码数量-1
int orderCount = orderDetailCodeEntity.getCount();
orderDetailCodeEntity.setCount(orderCount - count);
orderDetailCodeEntity.setReCount(orderDetailCodeEntity.getCount() * udiCalCountUtil.getActCount(codeTempEntity.getNameCode()));
ioOrderDetailCodeService.update(orderDetailCodeEntity);
}
int b = codeTempService.updateById(codeTempEntity);
if (b > 0)
return ResultVOUtils.success("修改成功");
else return ResultVOUtils.error(500, "修改失败!");

@ -432,6 +432,9 @@ public class IoOrderDetailBizController extends BaseController {
purOrderEntity = purOrderService.selectById(purOrderEntity.getId());
List<PurOrderDetailEntity> purOrderDetailEntities = purOrderDetailService.findByOrderId(purOrderEntity.getId() + "");
BasicBusTypeChangeEntity basicBusTypeChangeEntity = basicBusTypeChangeService.selectByOriginAction(purOrderEntity.getBillType());
if (basicBusTypeChangeEntity == null) {
return ResultVOUtils.error(500, "采购订单未配置转换单据类型!");
}
BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(basicBusTypeChangeEntity.getTargetAction());
AuthAdmin authAdmin = getUser();

@ -33,10 +33,7 @@ import com.glxp.api.service.basic.IBasicBussinessTypeService;
import com.glxp.api.service.inout.*;
import com.glxp.api.service.sync.SpsSyncDownloadService;
import com.glxp.api.service.system.SystemParamConfigService;
import com.glxp.api.util.CustomUtil;
import com.glxp.api.util.GennerOrderUtils;
import com.glxp.api.util.OrderNoTypeBean;
import com.glxp.api.util.RedisUtil;
import com.glxp.api.util.*;
import com.glxp.api.util.udi.UdiCalCountUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.BindingResult;
@ -338,11 +335,11 @@ public class IoOrderReviewController extends BaseController {
for (IoCodeEntity checkOrderCodesBean : codesList) {
if (checkOrderCodesBean.getCode().toUpperCase(Locale.ROOT).equals(code.toUpperCase(Locale.ROOT))) {
if (checkOrderCodesBean.getStatus() == Constant.DB_CHECK_ED
&& checkOrderCodesBean.getMyCount() == checkOrderCodesBean.getScanCount()) {
&& IntUtil.value(checkOrderCodesBean.getReCount()) == checkOrderCodesBean.getScanCount()) {
return Constant.CHECK_REPEAT;
}
int curCount = checkOrderCodesBean.getScanCount() + calCountUtil.getActCount(checkOrderCodesBean.getNameCode());
if (curCount == checkOrderCodesBean.getMyCount()) {
if (curCount == IntUtil.value(checkOrderCodesBean.getReCount())) {
checkOrderCodesBean.setStatus(Constant.DB_CHECK_ED);
}
checkOrderCodesBean.setScanCount(curCount);

@ -797,7 +797,6 @@ public class SpsSyncDownloadController {
orderEntity.setUpdateTime(null);
PurOrderEntity temp = purOrderService.selectByBillNo(orderEntity.getBillNo());
if (temp == null) {
orderEntity.setId(null);
purOrderService.insert(orderEntity);
if (CollUtil.isNotEmpty(spsSyncBusOrderResponse.getPurOrderDetailEntities())) {
List<PurOrderDetailEntity> purOrderDetailEntities = spsSyncBusOrderResponse.getPurOrderDetailEntities();

@ -28,6 +28,7 @@ import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
@ -189,6 +190,9 @@ public class SysParamConfigController {
filterParamConfigRequest.setParamType(2);
filterParamConfigRequest.setParamStatus(1);
List<SystemParamConfigEntity> systemParamConfigEntities = systemParamConfigService.queryPage(filterParamConfigRequest);
systemParamConfigEntities = systemParamConfigEntities.stream().sorted(Comparator.comparing(SystemParamConfigEntity::getParamKey))
.collect(Collectors.toList());
ProductRemarkSetEntity productRemarkSetEntity = new ProductRemarkSetEntity();
if (CollUtil.isNotEmpty(systemParamConfigEntities) && systemParamConfigEntities.size() == 8) {

@ -11,7 +11,7 @@ public class PurOrderResponse {
/**
*
*/
private Integer id;
private Long id;
/**
*
*/

@ -285,7 +285,7 @@ public class IoOrderServiceImpl implements IoOrderService {
//查询条码
IoOrderEntity orderEntity = findByBillNo(billNo);
if (orderEntity.getStatus() == ConstantStatus.ORDER_STATUS_AUDITED
|| orderEntity.getStatus() == ConstantStatus.ORDER_STATUS_CHECK_SUCCESS) {
|| orderEntity.getStatus() == ConstantStatus.ORDER_STATUS_CHECK_SUCCESS || orderEntity.getStatus() == ConstantStatus.ORDER_STATUS_CHECK_REW) {
//更新正式表
IoCodeEntity ioCodeEntity = codeService.findByUnique(billNo, code);
if (ioCodeEntity.getMyCount() > 1) {

@ -1,5 +1,6 @@
package com.glxp.api.service.purchase.impl;
import cn.hutool.core.util.IdUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
import com.glxp.api.dao.purchase.PurOrderDao;
@ -54,6 +55,8 @@ public class PurOrderServiceImpl implements PurOrderService {
@Override
public Boolean insert(PurOrderEntity purOrderEntity) {
if (purOrderEntity.getId() == null)
purOrderEntity.setId(IdUtil.getSnowflakeNextId());
return purOrderDao.insert(purOrderEntity) > 0 ? true : false;
}

@ -1,133 +1,134 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.glxp.api.dao.purchase.PurOrderDetailDao">
<resultMap id="BaseResultMap" autoMapping="true" type="com.glxp.api.entity.purchase.PurOrderDetailEntity">
<!--@mbg.generated-->
<!--@Table pur_order_detail-->
<!-- <id column="id" jdbcType="INTEGER" property="id" />-->
<result column="orderIdFk" jdbcType="VARCHAR" property="orderIdFk" />
<result column="productId" jdbcType="INTEGER" property="productId" />
<result column="productName" jdbcType="VARCHAR" property="productName" />
<result column="count" jdbcType="INTEGER" property="count" />
<result column="supId" jdbcType="VARCHAR" property="supId" />
<result column="zczbhhzbapzbh" jdbcType="VARCHAR" property="zczbhhzbapzbh" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, orderIdFk, productId, productName, `count`, supId, zczbhhzbapzbh
</sql>
<select id="queryPageList" parameterType="com.glxp.api.req.purchase.PurOrderDetailRequest"
resultType="com.glxp.api.entity.purchase.PurOrderDetailEntity">
select *
FROM pur_order_detail
<where>
<if test="orderIdFk != '' and orderIdFk != null">
AND orderIdFk = #{orderIdFk}
</if>
<if test="productId != null">
AND productId = #{productId}
</if>
<if test="supId != '' and supId != null">
AND supId = #{supId}
</if>
</where>
</select>
<select id="joinQueryList" parameterType="com.glxp.api.req.purchase.PurOrderDetailRequest"
resultType="com.glxp.api.res.purchase.PurOrderDetailResponse">
SELECT
pur_order_detail.*,
basic_products.ggxh spec,
basic_products.measname,
basic_products.manufactory,
basic_products.ylqxzcrbarmc,
basic_corp.`name` supName
FROM
pur_order_detail
INNER JOIN basic_udirel ON pur_order_detail.productId = basic_udirel.id
INNER JOIN basic_products ON basic_udirel.uuid = basic_products.uuid
INNER JOIN basic_corp ON pur_order_detail.supId = basic_corp.erpId
<where>
<if test="orderIdFk != '' and orderIdFk != null">
AND orderIdFk = #{orderIdFk}
AND basic_products.diType=1
</if>
<if test="productId != null">
AND productId = #{productId}
</if>
<if test="supId != '' and supId != null">
AND supId = #{supId}
</if>
</where>
</select>
<delete id="deleteByIds" parameterType="java.util.List">
DELETE FROM pur_order_detail WHERE id in
<foreach collection="ids" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<delete id="deleteByOrderId" parameterType="map">
DELETE
FROM pur_order_detail
WHERE orderIdFk = #{orderIdFk}
</delete>
<update id="update" parameterType="com.glxp.api.entity.purchase.PurOrderDetailEntity">
UPDATE pur_order_detail
<trim prefix="set" suffixOverrides=",">
<if test="orderIdFk != null">orderIdFk=#{orderIdFk},</if>
<if test="productId != null">productId=#{productId},</if>
<if test="productName != null">productName=#{productName},</if>
<if test="count != null">`count`=#{count},</if>
<if test="supId != null">supId=#{supId},</if>
<if test="zczbhhzbapzbh != null">zczbhhzbapzbh=#{zczbhhzbapzbh},</if>
</trim>
WHERE id = #{id}
</update>
<insert id="insertPurOrderDetailEntity" keyProperty="id" parameterType="com.glxp.api.entity.purchase.PurOrderDetailEntity">
REPLACE INTO pur_order_detail
( orderIdFk,productId,productName,count,supId,zczbhhzbapzbh) values
<foreach collection="datas" item="item" index="index" separator=",">
(
#{item.orderIdFk},
#{item.productId},
#{item.productName},
#{item.count},
#{item.supId},
#{item.zczbhhzbapzbh}
)
</foreach>
</insert>
<select id="selectIoOrderDetailBiz" parameterType="long"
resultType="com.glxp.api.entity.basic.BasicProductsEntity">
SELECT
b2.*
FROM
pur_order_detail p1
LEFT JOIN basic_udirel b1 on b1.id=p1.productId
LEFT JOIN basic_products b2 on b1.uuid = b2 .uuid
<where>
<if test="id != null and id!='' ">
AND p1.id = #{id}
</if>
</where>
GROUP BY uuid
</select>
</mapper>
<resultMap id="BaseResultMap" autoMapping="true" type="com.glxp.api.entity.purchase.PurOrderDetailEntity">
<!--@mbg.generated-->
<!--@Table pur_order_detail-->
<!-- <id column="id" jdbcType="INTEGER" property="id" />-->
<result column="orderIdFk" jdbcType="VARCHAR" property="orderIdFk"/>
<result column="productId" jdbcType="INTEGER" property="productId"/>
<result column="productName" jdbcType="VARCHAR" property="productName"/>
<result column="count" jdbcType="INTEGER" property="count"/>
<result column="supId" jdbcType="VARCHAR" property="supId"/>
<result column="zczbhhzbapzbh" jdbcType="VARCHAR" property="zczbhhzbapzbh"/>
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, orderIdFk, productId, productName, `count`, supId, zczbhhzbapzbh
</sql>
<select id="queryPageList" parameterType="com.glxp.api.req.purchase.PurOrderDetailRequest"
resultType="com.glxp.api.entity.purchase.PurOrderDetailEntity">
select *
FROM pur_order_detail
<where>
<if test="orderIdFk != '' and orderIdFk != null">
AND orderIdFk = #{orderIdFk}
</if>
<if test="productId != null">
AND productId = #{productId}
</if>
<if test="supId != '' and supId != null">
AND supId = #{supId}
</if>
</where>
</select>
<select id="joinQueryList" parameterType="com.glxp.api.req.purchase.PurOrderDetailRequest"
resultType="com.glxp.api.res.purchase.PurOrderDetailResponse">
SELECT pur_order_detail.*,
basic_products.ggxh spec,
basic_products.measname,
basic_products.manufactory,
basic_products.ylqxzcrbarmc,
basic_corp.`name` supName
FROM pur_order_detail
left JOIN basic_udirel ON pur_order_detail.productId = basic_udirel.id
left JOIN basic_products ON basic_udirel.uuid = basic_products.uuid
left JOIN basic_corp ON pur_order_detail.supId = basic_corp.erpId
<where>
<if test="orderIdFk != '' and orderIdFk != null">
AND orderIdFk = #{orderIdFk}
AND basic_products.diType = 1
</if>
<if test="productId != null">
AND productId = #{productId}
</if>
<if test="supId != '' and supId != null">
AND supId = #{supId}
</if>
</where>
</select>
<delete id="deleteByIds" parameterType="java.util.List">
DELETE
FROM pur_order_detail WHERE id in
<foreach collection="ids" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<delete id="deleteByOrderId" parameterType="map">
DELETE
FROM pur_order_detail
WHERE orderIdFk = #{orderIdFk}
</delete>
<update id="update" parameterType="com.glxp.api.entity.purchase.PurOrderDetailEntity">
UPDATE pur_order_detail
<trim prefix="set" suffixOverrides=",">
<if test="orderIdFk != null">
orderIdFk=#{orderIdFk},
</if>
<if test="productId != null">
productId=#{productId},
</if>
<if test="productName != null">
productName=#{productName},
</if>
<if test="count != null">
`count`=#{count},
</if>
<if test="supId != null">
supId=#{supId},
</if>
<if test="zczbhhzbapzbh != null">
zczbhhzbapzbh=#{zczbhhzbapzbh},
</if>
</trim>
WHERE id = #{id}
</update>
<insert id="insertPurOrderDetailEntity" keyProperty="id"
parameterType="com.glxp.api.entity.purchase.PurOrderDetailEntity">
REPLACE INTO pur_order_detail
(orderIdFk, productId, productName, count, supId, zczbhhzbapzbh) values
<foreach collection="datas" item="item" index="index" separator=",">
(#{item.orderIdFk},
#{item.productId},
#{item.productName},
#{item.count},
#{item.supId},
#{item.zczbhhzbapzbh})
</foreach>
</insert>
<select id="selectIoOrderDetailBiz" parameterType="long"
resultType="com.glxp.api.entity.basic.BasicProductsEntity">
SELECT b2.*
FROM pur_order_detail p1
LEFT JOIN basic_udirel b1 on b1.id = p1.productId
LEFT JOIN basic_products b2 on b1.uuid = b2.uuid
<where>
<if test="id != null and id != ''">
AND p1.id = #{id}
</if>
</where>
GROUP BY uuid
</select>
</mapper>

Loading…
Cancel
Save