修复系统繁忙问题,新增预验收按货位退回

master
anthonywj 2 years ago
parent ed08f88bf5
commit 009d0f0a39

@ -1,6 +1,7 @@
package com.glxp.api.controller.auth;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.PageInfo;
import com.glxp.api.annotation.AuthRuleAnnotation;
@ -228,6 +229,7 @@ public class DeptController extends BaseController {
deptEntity.setPcode(deptEntity.getPcode());
}
deptEntity.setUpdateTime(new Date());
deptEntity.setId(IdUtil.getSnowflakeNextId());
boolean b = deptService.insertInvWarehouse(deptEntity);
if (!b) {
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);

@ -79,6 +79,11 @@ public class DeptUserController {
FilterDeptUserReqeust filterDeptUserReqeust = new FilterDeptUserReqeust();
filterDeptUserReqeust.setUserId(deptUserEntity.getUserId());
List<DeptUserEntity> deptUserEntities = deptUserService.selectDeptUser(filterDeptUserReqeust);
for (int i = 0; i < deptUserEntities.size(); i++) {
if (deptUserEntities.get(i).getDeptId() == 1) {
deptUserEntities.remove(deptUserEntities.get(i));
}
}
if (deptUserEntities != null && deptUserEntities.size() > 1) {
return ResultVOUtils.error(500, "该用户已绑定多个部门,不能移除!");
}

@ -1,6 +1,7 @@
package com.glxp.api.controller.auth;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.IdUtil;
import com.github.pagehelper.PageInfo;
import com.glxp.api.annotation.AuthRuleAnnotation;
import com.glxp.api.annotation.Log;
@ -131,15 +132,16 @@ public class InvBusUserController {
@PostMapping("/spms/bus/user/warehouse/post")
@Log(title = "用户管理", businessType = BusinessType.INSERT)
public BaseResponse postRes(@RequestBody UpdateUserRelBusRequset relBusRequset) {
boolean b = invBusUserService.deleteByUnion(relBusRequset.getUserId(), relBusRequset.getSubInvCode());
if (CollUtil.isNotEmpty(relBusRequset.getSelectActions())) {
invBusUserService.deleteByUnion(relBusRequset.getUserId(), relBusRequset.getSubInvCode());
relBusRequset.getSelectActions().forEach(action ->
{
InvBusUserEntity invBusUserEntity = new InvBusUserEntity();
invBusUserEntity.setUserId(relBusRequset.getUserId());
invBusUserEntity.setSubInvCode(relBusRequset.getSubInvCode());
invBusUserEntity.setScAction(action);
invBusUserService.insertInvBusUser(invBusUserEntity);
invBusUserEntity.setId(IdUtil.getSnowflakeNextId());
invBusUserService.save(invBusUserEntity);
});
}
InvBusUserEntity invBusUserEntity = new InvBusUserEntity();

@ -3,6 +3,7 @@ package com.glxp.api.controller.auth;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import com.github.pagehelper.PageInfo;
import com.glxp.api.annotation.Log;
@ -194,7 +195,7 @@ public class SysUserController extends BaseController {
String pid = invWarehouseService.selectParentIdByCode(authUserSaveRequest.getLocInvCode());
authAdmin.setLocDeptCode(pid);
authAdmin.setLocInvCode(authUserSaveRequest.getLocInvCode());
authAdmin.setId(IdUtil.getSnowflakeNextId());
boolean b = userService.insertAuthAdmin(authAdmin);
authAdmin = userService.findByUserName(authAdmin.getUserName());
if (!b) {
@ -220,7 +221,6 @@ public class SysUserController extends BaseController {
authUserSaveRequest.setDepts(deptCodeList);
//插入部门
if (CollUtil.isNotEmpty(authUserSaveRequest.getDepts())) {
List<DeptUserEntity> list = new ArrayList<>();

@ -379,12 +379,10 @@ public class UdiRelevanceController extends BaseController {
//新增或修改关联
@AuthRuleAnnotation("")
@PostMapping("/udi/udirel/check/udi")
public BaseResponse checkUdi(@RequestBody UdiCombineRequest udiCombineRequest) {
List<String> keys = udiCombineRequest.getKeys();
if (keys != null && keys.size() > 0) {
List<UdiRelevanceEntity> datas = udiRelevanceService.batchSelectByUuid(keys);
if (datas.isEmpty()) {
return ResultVOUtils.success("无被选入!");

@ -27,7 +27,6 @@ public interface WarehouseBussinessTypeDao extends BaseMapperPlus<WarehouseBussi
int updateBatchSelective(List<WarehouseBussinessTypeEntity> list);
int batchInsert(@Param("list") List<WarehouseBussinessTypeEntity> list);
List<WarehouseBussinessTypeEntity> selectListByCode(@Param("code") String code);

@ -244,4 +244,12 @@ public class IoOrderEntity {
@TableField(value = "checkPreInOrders")
private String checkPreInOrders;
// 预验收按货位出库,退货
@TableField(value = "checkPreInInvCode")
private String checkPreInInvCode;
// 预验收按货位出库,退货
@TableField(value = "checkPreInSpaceCode")
private String checkPreInSpaceCode;
}

@ -12,7 +12,7 @@ public class BasicBussinessTypeResponse {
/**
* ID
*/
private Integer id;
private Long id;
/**
*

@ -68,7 +68,7 @@ public class WarehouseBussinessTypeServiceImpl implements WarehouseBussinessType
});
//加入新数据
warehouseBussinessTypeDao.batchInsert(warehouseBussinessTypeEntities);
warehouseBussinessTypeDao.insertBatch(warehouseBussinessTypeEntities);
}
}

@ -84,7 +84,8 @@ public class BasicBussinessTypeServiceImpl extends ServiceImpl<BasicBussinessTyp
* @param basicBussinessTypeEntity
*/
private void setSupplementOrderType(BasicBussinessTypeEntity basicBussinessTypeEntity) {
if (null == basicBussinessTypeEntity.getId()) {
boolean isExit = basicBussinessTypeDao.exists(new QueryWrapper<BasicBussinessTypeEntity>().eq(basicBussinessTypeEntity.getId() != null, "id", basicBussinessTypeEntity.getId()));
if (null == basicBussinessTypeEntity.getId() || !isExit) {
//处理添加新单据类型时的平衡补单逻辑
if (StrUtil.isNotBlank(basicBussinessTypeEntity.getSupplementOrderType())) {
//查询平衡补单的单据类型数据是否存在

@ -77,10 +77,10 @@
</select>
<insert id="insertAuthAdmin" keyProperty="id" parameterType="com.glxp.api.entity.auth.AuthAdmin">
INSERT INTO auth_user( userName, passWord, lastLoginIp, lastLoginTime, createTime, userFlag
INSERT INTO auth_user( id, userName, passWord, lastLoginIp, lastLoginTime, createTime, userFlag
, employeeName, CustomerId, lastModifyTime, locDeptCode, locInvCode, comments)
values
(#{userName},
(#{id}, #{userName},
<choose>
<when test="passWord != null">
#{passWord},
@ -119,7 +119,8 @@
<insert id="replaceAuthAdmin" keyProperty="id" parameterType="com.glxp.api.entity.auth.AuthAdmin">
replace
INTO auth_user(id, userName, passWord, lastLoginIp,
lastLoginTime, createTime, userFlag, lastModifyTime, employeeName, CustomerId, locDeptCode,
lastLoginTime, createTime, userFlag, lastModifyTime, employeeName, CustomerId,
locDeptCode,
locInvCode, comments)
values (#{id},
#{userName},

@ -2,7 +2,6 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.glxp.api.dao.auth.DeptDao">
<select id="filterInvWarehouse" parameterType="com.glxp.api.req.auth.FilterInvWarehouseRequest"
resultType="com.glxp.api.entity.auth.DeptEntity">
select *, (select name from auth_dept WHERE a.pcode = code) pName
@ -38,14 +37,13 @@
<if test="spUse != null">
AND a.spUse = #{spUse}
</if>
</where>
</select>
<select id="filterAllByUser" parameterType="com.glxp.api.req.auth.FilterInvWarehouseRequest"
resultType="com.glxp.api.entity.auth.DeptEntity">
select auth_dept.* from auth_dept INNER JOIN auth_warehouse
select auth_dept.* from auth_dept
INNER JOIN auth_warehouse
on auth_dept.`code` = auth_warehouse.parentId
<if test="CustomerId != '' and CustomerId != null">
INNER JOIN auth_warehouse_user on auth_warehouse_user.`code` = auth_warehouse.code
@ -84,7 +82,6 @@
</if>
</where>
group by auth_dept.code
</select>
@ -93,7 +90,6 @@
SELECT *
FROM auth_dept
WHERE id = #{id}
</select>
<select id="selectByIdCode"
@ -108,12 +104,12 @@
</foreach>
</if>
</where>
</select>
<select id="selectMaxCode" parameterType="com.glxp.api.req.auth.FilterInvWarehouseRequest"
resultType="com.glxp.api.entity.auth.DeptEntity">
select max(code) as code from auth_dept
select max(code) as code
from auth_dept
<where>
<if test="id != '' and id != null">
AND id = #{id}
@ -140,13 +136,13 @@
AND `level` = #{level}
</if>
</where>
</select>
<select id="filterGroupInvWarehouse" parameterType="com.glxp.api.req.auth.FilterInvWarehouseRequest"
resultType="com.glxp.api.entity.auth.DeptEntity">
SELECT * FROM auth_dept
SELECT *
FROM auth_dept
<where>
<if test="id != '' and id != null">
AND id = #{id}
@ -176,13 +172,16 @@
AND spUse = #{spUse}
</if>
<if test="updateTime != null and updateTime != ''">
<![CDATA[ and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{updateTime}, '%Y-%m-%d %H:%i:%S') ]]>
<![CDATA[
and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S') >= DATE_FORMAT(#{updateTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
<if test="lastUpdateTime != null and lastUpdateTime != ''">
<![CDATA[ and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]>
<![CDATA[
and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S') >= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
</where>
</select>
<select id="getNameByCode" resultType="java.lang.String">
select name
@ -198,10 +197,9 @@
parameterType="com.glxp.api.entity.auth.DeptEntity">
replace
INTO auth_dept
(pid, code, `name`, advanceType, isDefault,
(id, pid, code, `name`, advanceType, isDefault,
status, updateTime, remark, `level`, pcode, spUse, thirdId, thirdId1, thirdId2, thirdId3, thirdId4)
values (
#{pid},
values (#{id}, #{pid},
#{code},
#{name},
#{advanceType},
@ -216,8 +214,7 @@
#{thirdId1},
#{thirdId2},
#{thirdId3},
#{thirdId4}
)
#{thirdId4})
</insert>
@ -234,30 +231,59 @@
<foreach item="item" index="index" collection="ids" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<update id="updateInvWarehouse" parameterType="com.glxp.api.entity.auth.DeptEntity">
UPDATE auth_dept
<trim prefix="set" suffixOverrides=",">
<if test="pid != null">pid=#{pid},</if>
<if test="name != null">name=#{name},</if>
<if test="code != null">code=#{code},</if>
<if test="advanceType != null">advanceType=#{advanceType},</if>
<if test="isDefault != null">isDefault=#{isDefault},</if>
<if test="status != null">status=#{status},</if>
<if test="updateTime != null">updateTime=#{updateTime},</if>
<if test="remark != null">remark=#{remark},</if>
<if test="level != null">level=#{level},</if>
<if test="pcode != null">pcode=#{pcode},</if>
<if test="thirdId != null">remark=#{thirdId},</if>
<if test="thirdId1 != null">remark=#{thirdId1},</if>
<if test="thirdId2 != null">remark=#{thirdId2},</if>
<if test="thirdId3 != null">remark=#{thirdId3},</if>
<if test="thirdId4 != null">remark=#{thirdId4},</if>
<if test="spUse != null">spUse=#{spUse},</if>
<if test="pid != null">
pid=#{pid},
</if>
<if test="name != null">
name=#{name},
</if>
<if test="code != null">
code=#{code},
</if>
<if test="advanceType != null">
advanceType=#{advanceType},
</if>
<if test="isDefault != null">
isDefault=#{isDefault},
</if>
<if test="status != null">
status=#{status},
</if>
<if test="updateTime != null">
updateTime=#{updateTime},
</if>
<if test="remark != null">
remark=#{remark},
</if>
<if test="level != null">
level=#{level},
</if>
<if test="pcode != null">
pcode=#{pcode},
</if>
<if test="thirdId != null">
remark=#{thirdId},
</if>
<if test="thirdId1 != null">
remark=#{thirdId1},
</if>
<if test="thirdId2 != null">
remark=#{thirdId2},
</if>
<if test="thirdId3 != null">
remark=#{thirdId3},
</if>
<if test="thirdId4 != null">
remark=#{thirdId4},
</if>
<if test="spUse != null">
spUse=#{spUse},
</if>
</trim>
WHERE id = #{id}
</update>
@ -308,28 +334,42 @@
</select>
<select id="selectNameByCode" resultType="java.lang.String">
select name from auth_dept where code = #{code}
select name
from auth_dept
where code = #{code}
</select>
<select id="selectByPcode" resultType="com.glxp.api.entity.auth.DeptEntity">
select * from auth_dept where pcode = #{pcode}
select *
from auth_dept
where pcode = #{pcode}
</select>
<select id="selectupDeptAll" parameterType="java.lang.String" resultType="com.glxp.api.entity.auth.DeptEntity">
with recursive table_a as (
select * from auth_dept ta where code = #{pcode}
select *
from auth_dept ta
where code = #{pcode}
union all
select tb.* from auth_dept tb inner join table_a on table_a.pcode = tb.code
select tb.*
from auth_dept tb
inner join table_a on table_a.pcode = tb.code
)
select * from table_a
select *
from table_a
</select>
<select id="selectLowDeptAll" parameterType="java.lang.String" resultType="com.glxp.api.entity.auth.DeptEntity">
with recursive table_a as (
select * from auth_dept ta where pcode = #{pcode}
select *
from auth_dept ta
where pcode = #{pcode}
union all
select tb.* from auth_dept tb inner join table_a on table_a.code = tb.pcode
select tb.*
from auth_dept tb
inner join table_a on table_a.code = tb.pcode
)
select * from table_a
select *
from table_a
</select>
</mapper>

@ -2,7 +2,6 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.glxp.api.dao.auth.InvBusUserDao">
<select id="filterInvBusUser" parameterType="com.glxp.api.req.auth.FilterInvBusUserRequest"
resultType="com.glxp.api.entity.auth.InvBusUserEntity">
select *
@ -23,9 +22,7 @@
#{item}
</foreach>
</if>
</where>
</select>
@ -47,16 +44,15 @@
#{item}
</foreach>
</if>
</where>
</select>
<select id="filterJoinInvBusUser" parameterType="com.glxp.api.req.auth.FilterInvBusUserRequest"
resultType="com.glxp.api.res.auth.InvBusUserResponse">
select auth_user_bustype.*, basic_bussiness_type.name billTypeName
FROM auth_user_bustype left join basic_bussiness_type on auth_user_bustype.scAction = basic_bussiness_type.action
FROM auth_user_bustype
left join basic_bussiness_type on auth_user_bustype.scAction = basic_bussiness_type.action
<where>
<if test="userId != '' and userId != null">
AND userId = #{userId}
@ -67,24 +63,20 @@
<if test="scAction != '' and scAction != null">
AND scAction = #{scAction}
</if>
</where>
group by auth_user_bustype.id
</select>
<insert id="insertInvBusUser" keyProperty="id"
<insert id="insertInvBusUser"
parameterType="com.glxp.api.entity.auth.InvBusUserEntity">
replace
INTO auth_user_bustype
(userId, `subInvCode`, scAction, remark)
values (
#{userId},
values (#{userId},
#{subInvCode},
#{scAction},
#{remark}
)
#{remark})
</insert>
@ -118,12 +110,19 @@
<update id="updateInvBusUser" parameterType="com.glxp.api.entity.auth.InvBusUserEntity">
UPDATE auth_user_bustype
<trim prefix="set" suffixOverrides=",">
<if test="userId != null">userId=#{userId},</if>
<if test="subInvCode != null">subInvCode=#{subInvCode},</if>
<if test="scAction != null">scAction=#{scAction},</if>
<if test="remark != null">remark=#{remark},</if>
<if test="userId != null">
userId=#{userId},
</if>
<if test="subInvCode != null">
subInvCode=#{subInvCode},
</if>
<if test="scAction != null">
scAction=#{scAction},
</if>
<if test="remark != null">
remark=#{remark},
</if>
</trim>
WHERE id = #{id}
</update>
</mapper>

@ -135,15 +135,6 @@
#{item.id,jdbcType=INTEGER}
</foreach>
</update>
<insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into auth_warehouse_bustype
(code, `action`, `name`)
values
<foreach collection="list" item="item" separator=",">
(#{item.code,jdbcType=VARCHAR}, #{item.action,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR})
</foreach>
</insert>
<select id="selectListByCode" parameterType="java.lang.String" resultMap="BaseResultMap">
select auth_warehouse_bustype.id,

@ -88,6 +88,9 @@ CALL Pro_Temp_ColumnWork('basic_bussiness_type', 'checkCertExpire', 'tinyint', 1
CALL Pro_Temp_ColumnWork('basic_bussiness_type', 'preInBackAction', 'varchar(255) ', 1);
CALL Pro_Temp_ColumnWork('basic_bussiness_type', 'backPreinType', 'tinyint', 1);
CALL Pro_Temp_ColumnWork('io_order', 'checkPreInOrders', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('io_order', 'checkPreInSpaceCode', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('io_order', 'checkPreInInvCode', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('basic_bussiness_type', 'sortNum', 'int', 1);
@ -302,9 +305,6 @@ CREATE TABLE IF NOT EXISTS `sync_data_change_bustypes`
ROW_FORMAT = DYNAMIC;
# 修改主键为LONG
CALL Pro_Temp_ColumnWork('basic_hosp_type', 'id', 'bigint', 2);
CALL Pro_Temp_ColumnWork('basic_udirel', 'id', 'bigint', 2);

Loading…
Cancel
Save