bug修改

pro
anthonywj 2 years ago
parent 94a6af5fef
commit bd23124565

@ -1113,8 +1113,23 @@ public class IoCodeTempController extends BaseController {
if (codeTempEntity.getMyCount() <= 0) { if (codeTempEntity.getMyCount() <= 0) {
return ResultVOUtils.error(500, "数量需要大于0"); return ResultVOUtils.error(500, "数量需要大于0");
} }
IoCodeTempEntity tempEntity = codeTempService.selectById(codeTempEntity.getId());
codeTempEntity.setReCount(codeTempEntity.getMyCount() * udiCalCountUtil.getActCount(codeTempEntity.getNameCode())); 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); int b = codeTempService.updateById(codeTempEntity);
if (b > 0) if (b > 0)
return ResultVOUtils.success("修改成功"); return ResultVOUtils.success("修改成功");
else return ResultVOUtils.error(500, "修改失败!"); else return ResultVOUtils.error(500, "修改失败!");

@ -432,6 +432,9 @@ public class IoOrderDetailBizController extends BaseController {
purOrderEntity = purOrderService.selectById(purOrderEntity.getId()); purOrderEntity = purOrderService.selectById(purOrderEntity.getId());
List<PurOrderDetailEntity> purOrderDetailEntities = purOrderDetailService.findByOrderId(purOrderEntity.getId() + ""); List<PurOrderDetailEntity> purOrderDetailEntities = purOrderDetailService.findByOrderId(purOrderEntity.getId() + "");
BasicBusTypeChangeEntity basicBusTypeChangeEntity = basicBusTypeChangeService.selectByOriginAction(purOrderEntity.getBillType()); BasicBusTypeChangeEntity basicBusTypeChangeEntity = basicBusTypeChangeService.selectByOriginAction(purOrderEntity.getBillType());
if (basicBusTypeChangeEntity == null) {
return ResultVOUtils.error(500, "采购订单未配置转换单据类型!");
}
BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(basicBusTypeChangeEntity.getTargetAction()); BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(basicBusTypeChangeEntity.getTargetAction());
AuthAdmin authAdmin = getUser(); 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.inout.*;
import com.glxp.api.service.sync.SpsSyncDownloadService; import com.glxp.api.service.sync.SpsSyncDownloadService;
import com.glxp.api.service.system.SystemParamConfigService; import com.glxp.api.service.system.SystemParamConfigService;
import com.glxp.api.util.CustomUtil; import com.glxp.api.util.*;
import com.glxp.api.util.GennerOrderUtils;
import com.glxp.api.util.OrderNoTypeBean;
import com.glxp.api.util.RedisUtil;
import com.glxp.api.util.udi.UdiCalCountUtil; import com.glxp.api.util.udi.UdiCalCountUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
@ -338,11 +335,11 @@ public class IoOrderReviewController extends BaseController {
for (IoCodeEntity checkOrderCodesBean : codesList) { for (IoCodeEntity checkOrderCodesBean : codesList) {
if (checkOrderCodesBean.getCode().toUpperCase(Locale.ROOT).equals(code.toUpperCase(Locale.ROOT))) { if (checkOrderCodesBean.getCode().toUpperCase(Locale.ROOT).equals(code.toUpperCase(Locale.ROOT))) {
if (checkOrderCodesBean.getStatus() == Constant.DB_CHECK_ED if (checkOrderCodesBean.getStatus() == Constant.DB_CHECK_ED
&& checkOrderCodesBean.getMyCount() == checkOrderCodesBean.getScanCount()) { && IntUtil.value(checkOrderCodesBean.getReCount()) == checkOrderCodesBean.getScanCount()) {
return Constant.CHECK_REPEAT; return Constant.CHECK_REPEAT;
} }
int curCount = checkOrderCodesBean.getScanCount() + calCountUtil.getActCount(checkOrderCodesBean.getNameCode()); 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.setStatus(Constant.DB_CHECK_ED);
} }
checkOrderCodesBean.setScanCount(curCount); checkOrderCodesBean.setScanCount(curCount);

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

@ -28,6 +28,7 @@ import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.validation.Valid; import javax.validation.Valid;
import java.util.Comparator;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -189,6 +190,9 @@ public class SysParamConfigController {
filterParamConfigRequest.setParamType(2); filterParamConfigRequest.setParamType(2);
filterParamConfigRequest.setParamStatus(1); filterParamConfigRequest.setParamStatus(1);
List<SystemParamConfigEntity> systemParamConfigEntities = systemParamConfigService.queryPage(filterParamConfigRequest); List<SystemParamConfigEntity> systemParamConfigEntities = systemParamConfigService.queryPage(filterParamConfigRequest);
systemParamConfigEntities = systemParamConfigEntities.stream().sorted(Comparator.comparing(SystemParamConfigEntity::getParamKey))
.collect(Collectors.toList());
ProductRemarkSetEntity productRemarkSetEntity = new ProductRemarkSetEntity(); ProductRemarkSetEntity productRemarkSetEntity = new ProductRemarkSetEntity();
if (CollUtil.isNotEmpty(systemParamConfigEntities) && systemParamConfigEntities.size() == 8) { 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); IoOrderEntity orderEntity = findByBillNo(billNo);
if (orderEntity.getStatus() == ConstantStatus.ORDER_STATUS_AUDITED 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); IoCodeEntity ioCodeEntity = codeService.findByUnique(billNo, code);
if (ioCodeEntity.getMyCount() > 1) { if (ioCodeEntity.getMyCount() > 1) {

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

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

Loading…
Cancel
Save