opt:增加仓库搜索
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package org.nl.system.service.user.dao.mapper;
|
package org.nl.system.service.user.dao.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.nl.common.domain.query.PageQuery;
|
import org.nl.common.domain.query.PageQuery;
|
||||||
@@ -35,6 +36,9 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
|
|||||||
|
|
||||||
List<String> getUserIdByDeptId(String deptId);
|
List<String> getUserIdByDeptId(String deptId);
|
||||||
|
|
||||||
void insertBatch( List<SysUser> userList);
|
void insertBatch(@Param("entities") List<SysUser> entities);
|
||||||
|
|
||||||
|
@DS("oracle_eas")
|
||||||
|
List<SysUser> queryUserList() ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -150,17 +150,24 @@
|
|||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
<insert id="insertBatch" keyProperty="userId" useGeneratedKeys="true">
|
<insert id="insertBatch" keyProperty="userId">
|
||||||
insert into sys_user(username, person_name, gender, phone, email, avatar_name, avatar_path, password, is_admin,
|
insert into sys_user(user_id,username, person_name, gender, phone, email, avatar_name, avatar_path, password, is_admin,
|
||||||
is_used, pwd_reset_user_id, pwd_reset_time, create_id, create_name, create_time, update_id, update_name,
|
is_used, pwd_reset_user_id, pwd_reset_time, create_id, create_name, create_time, update_id, update_name,
|
||||||
update_time, extperson_id, extuser_id)
|
update_time, extperson_id, extuser_id)
|
||||||
values
|
values
|
||||||
<foreach collection="entities" item="entity" separator=",">
|
<foreach collection="entities" item="entity" separator=",">
|
||||||
(#{entity.username}, #{entity.personName}, #{entity.gender}, #{entity.phone}, #{entity.email},
|
(#{entity.user_id},#{entity.username}, #{entity.person_name}, #{entity.gender}, #{entity.phone}, #{entity.email},
|
||||||
#{entity.avatarName}, #{entity.avatarPath}, #{entity.password}, #{entity.isAdmin}, #{entity.isUsed},
|
#{entity.avatar_name}, #{entity.avatar_path}, #{entity.password}, #{entity.is_admin}, #{entity.is_used},
|
||||||
#{entity.pwdResetUserId}, #{entity.pwdResetTime}, #{entity.createId}, #{entity.createName},
|
#{entity.pwd_reset_user_id}, #{entity.pwd_reset_time}, #{entity.create_id}, #{entity.create_name},
|
||||||
#{entity.createTime}, #{entity.updateId}, #{entity.updateName}, #{entity.updateTime}, #{entity.extpersonId},
|
#{entity.create_time}, #{entity.update_id}, #{entity.update_name}, #{entity.update_time}, #{entity.extperson_id},
|
||||||
#{entity.extuserId})
|
#{entity.extperson_id})
|
||||||
</foreach>
|
</foreach>
|
||||||
</insert>
|
</insert>
|
||||||
|
<select id="queryUserList" resultType="org.nl.system.service.user.dao.SysUser">
|
||||||
|
SELECT
|
||||||
|
DISTINCT YHBM username,
|
||||||
|
YHMC person_name
|
||||||
|
FROM
|
||||||
|
EAS_NOBLE.V_UC_USERINFO
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -20,10 +20,10 @@ public interface AllocationBillMapper extends BaseMapper<AllocationBill> {
|
|||||||
|
|
||||||
|
|
||||||
@DS("oracle_eas")
|
@DS("oracle_eas")
|
||||||
Long getAllocationCount(@Param("fuzzy") String fuzzy);
|
Long getAllocationCount(@Param("fuzzy") String fuzzy,@Param("ckbm") String ckbm);
|
||||||
|
|
||||||
@DS("oracle_eas")
|
@DS("oracle_eas")
|
||||||
List<AllocationBillQuery> allocationPage(@Param("fuzzy") String fuzzy, @Param("page") Integer page, @Param("size") Integer size );
|
List<AllocationBillQuery> allocationPage(@Param("fuzzy") String fuzzy, @Param("ckbm") String ckbm,@Param("page") Integer page, @Param("size") Integer size );
|
||||||
|
|
||||||
|
|
||||||
@Select("SELECT COUNT(*) FROM EAS_NOBLE.V_UC_STOCKTRANSFERBILL WHERE DJID = #{djid}")
|
@Select("SELECT COUNT(*) FROM EAS_NOBLE.V_UC_STOCKTRANSFERBILL WHERE DJID = #{djid}")
|
||||||
|
|||||||
@@ -23,9 +23,7 @@ public interface ReceiptBillMapper extends BaseMapper<ReceiptBill> {
|
|||||||
Long receiptCounts();
|
Long receiptCounts();
|
||||||
|
|
||||||
@DS("mysql_srm")
|
@DS("mysql_srm")
|
||||||
Page<AllocationBillQuery> receiptPage(Page<AllocationBillQuery> page, @Param("fuzzy") String fuzzy);
|
Page<AllocationBillQuery> receiptPage(Page<AllocationBillQuery> page, @Param("fuzzy") String fuzzy, @Param("ckbm") String ckbm);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@DS("mysql_srm")
|
@DS("mysql_srm")
|
||||||
|
|||||||
@@ -8,8 +8,9 @@
|
|||||||
COUNT( 1 )
|
COUNT( 1 )
|
||||||
FROM
|
FROM
|
||||||
( SELECT temp.*, ROWNUM AS row_num FROM ( SELECT * FROM grouped_data
|
( SELECT temp.*, ROWNUM AS row_num FROM ( SELECT * FROM grouped_data
|
||||||
|
WHERE 1=1
|
||||||
<if test="fuzzy != null and fuzzy != ''">
|
<if test="fuzzy != null and fuzzy != ''">
|
||||||
WHERE (wlmc LIKE '%' || #{fuzzy} || '%'
|
AND (wlmc LIKE '%' || #{fuzzy} || '%'
|
||||||
OR djbh LIKE '%' || #{fuzzy} || '%'
|
OR djbh LIKE '%' || #{fuzzy} || '%'
|
||||||
OR wlbm LIKE '%' || #{fuzzy} || '%'
|
OR wlbm LIKE '%' || #{fuzzy} || '%'
|
||||||
OR wlmc LIKE '%' || #{fuzzy} || '%'
|
OR wlmc LIKE '%' || #{fuzzy} || '%'
|
||||||
@@ -18,15 +19,18 @@
|
|||||||
OR drkcmc LIKE '%' || #{fuzzy} || '%'
|
OR drkcmc LIKE '%' || #{fuzzy} || '%'
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
|
<if test="ckbm != null and ckbm != ''">
|
||||||
|
AND (drckbm = #{ckbm} OR dcckbm = #{ckbm})
|
||||||
|
</if>
|
||||||
ORDER BY CJSJ DESC ) temp )
|
ORDER BY CJSJ DESC ) temp )
|
||||||
</select>
|
</select>
|
||||||
<select id="allocationPage" resultType="org.nl.wms.database.eas.dto.AllocationBillQuery">
|
<select id="allocationPage" resultType="org.nl.wms.database.eas.dto.AllocationBillQuery">
|
||||||
WITH ranked_data AS ( SELECT t.*, ROW_NUMBER ( ) OVER ( PARTITION BY djbh ORDER BY CJSJ DESC ) AS rn FROM
|
WITH ranked_data AS ( SELECT t.*, ROW_NUMBER ( ) OVER ( PARTITION BY djbh ORDER BY CJSJ DESC ) AS rn FROM
|
||||||
EAS_NOBLE.V_UC_STOCKTRANSFERBILL t ),
|
EAS_NOBLE.V_UC_STOCKTRANSFERBILL t ),
|
||||||
grouped_data AS ( SELECT * FROM ranked_data WHERE rn = 1 ) SELECT * FROM
|
grouped_data AS ( SELECT * FROM ranked_data WHERE rn = 1 ) SELECT * FROM
|
||||||
( SELECT temp.*, ROWNUM AS row_num FROM ( SELECT * FROM grouped_data
|
( SELECT temp.*, ROWNUM AS row_num FROM ( SELECT * FROM grouped_data WHERE 1=1
|
||||||
<if test="fuzzy != null and fuzzy != ''">
|
<if test="fuzzy != null and fuzzy != ''">
|
||||||
WHERE (wlmc LIKE '%' || #{fuzzy} || '%'
|
AND (wlmc LIKE '%' || #{fuzzy} || '%'
|
||||||
OR djbh LIKE '%' || #{fuzzy} || '%'
|
OR djbh LIKE '%' || #{fuzzy} || '%'
|
||||||
OR wlbm LIKE '%' || #{fuzzy} || '%'
|
OR wlbm LIKE '%' || #{fuzzy} || '%'
|
||||||
OR wlmc LIKE '%' || #{fuzzy} || '%'
|
OR wlmc LIKE '%' || #{fuzzy} || '%'
|
||||||
@@ -35,6 +39,9 @@
|
|||||||
OR drkcmc LIKE '%' || #{fuzzy} || '%'
|
OR drkcmc LIKE '%' || #{fuzzy} || '%'
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
|
<if test="ckbm != null and ckbm != ''">
|
||||||
|
AND (drckbm = #{ckbm} OR dcckbm = #{ckbm})
|
||||||
|
</if>
|
||||||
ORDER BY CJSJ DESC ) temp WHERE <![CDATA[ ROWNUM <= #{size} * #{page} ]]>) WHERE
|
ORDER BY CJSJ DESC ) temp WHERE <![CDATA[ ROWNUM <= #{size} * #{page} ]]>) WHERE
|
||||||
<![CDATA[ row_num > #{size} * (#{page} - 1) ]]>
|
<![CDATA[ row_num > #{size} * (#{page} - 1) ]]>
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@@ -4,8 +4,9 @@
|
|||||||
<select id="receiptPage" resultType="org.nl.wms.database.eas.dto.ReceiptBillQuery">
|
<select id="receiptPage" resultType="org.nl.wms.database.eas.dto.ReceiptBillQuery">
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM v_wms_recbill_third
|
FROM v_wms_recbill_third
|
||||||
|
WHERE 1=1
|
||||||
<if test="fuzzy != null and fuzzy != ''">
|
<if test="fuzzy != null and fuzzy != ''">
|
||||||
WHERE djbh LIKE CONCAT('%', #{fuzzy}, '%')
|
AND(djbh LIKE CONCAT('%', #{fuzzy}, '%')
|
||||||
OR wlmc LIKE CONCAT('%', #{fuzzy}, '%')
|
OR wlmc LIKE CONCAT('%', #{fuzzy}, '%')
|
||||||
OR ggxh LIKE CONCAT('%', #{fuzzy}, '%')
|
OR ggxh LIKE CONCAT('%', #{fuzzy}, '%')
|
||||||
OR djbh LIKE CONCAT('%', #{fuzzy}, '%')
|
OR djbh LIKE CONCAT('%', #{fuzzy}, '%')
|
||||||
@@ -13,7 +14,10 @@
|
|||||||
OR zzmc LIKE CONCAT('%', #{fuzzy}, '%')
|
OR zzmc LIKE CONCAT('%', #{fuzzy}, '%')
|
||||||
OR ckmc LIKE CONCAT('%', #{fuzzy}, '%')
|
OR ckmc LIKE CONCAT('%', #{fuzzy}, '%')
|
||||||
OR kwmc LIKE CONCAT('%', #{fuzzy}, '%')
|
OR kwmc LIKE CONCAT('%', #{fuzzy}, '%')
|
||||||
OR gys LIKE CONCAT('%', #{fuzzy}, '%')
|
OR gys LIKE CONCAT('%', #{fuzzy}, '%'))
|
||||||
|
</if>
|
||||||
|
<if test="ckbm != null and ckbm != ''">
|
||||||
|
AND ckbm = #{ckbm}
|
||||||
</if>
|
</if>
|
||||||
GROUP BY
|
GROUP BY
|
||||||
DJID
|
DJID
|
||||||
|
|||||||
@@ -49,6 +49,10 @@ public class AllocationBillQuery extends BaseQuery<AllocationBillQuery> {
|
|||||||
*/
|
*/
|
||||||
private String dckcmc;
|
private String dckcmc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 仓库编码
|
||||||
|
*/
|
||||||
|
private String ckbm;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 调入库存组织编码
|
* 调入库存组织编码
|
||||||
|
|||||||
@@ -53,6 +53,11 @@ public class ReceiptBillQuery extends BaseQuery<ReceiptBillQuery> {
|
|||||||
*/
|
*/
|
||||||
private String cggs;
|
private String cggs;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 仓库编码
|
||||||
|
*/
|
||||||
|
private String ckbm;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 物料编码
|
* 物料编码
|
||||||
@@ -209,10 +214,7 @@ public class ReceiptBillQuery extends BaseQuery<ReceiptBillQuery> {
|
|||||||
*/
|
*/
|
||||||
private String ckmc;
|
private String ckmc;
|
||||||
|
|
||||||
/**
|
|
||||||
* 收货仓库编码
|
|
||||||
*/
|
|
||||||
private String ckbm;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 收货库位编码
|
* 收货库位编码
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import cn.dev33.satoken.annotation.SaIgnore;
|
|||||||
import com.alibaba.fastjson.serializer.SerializerFeature;
|
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import io.lettuce.core.dynamic.annotation.Param;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.nl.common.exception.BadRequestException;
|
import org.nl.common.exception.BadRequestException;
|
||||||
import org.nl.common.utils.SecurityUtils;
|
import org.nl.common.utils.SecurityUtils;
|
||||||
@@ -12,10 +11,9 @@ import org.nl.wms.database.eas.dao.AllocationBill;
|
|||||||
import org.nl.wms.database.eas.dto.*;
|
import org.nl.wms.database.eas.dto.*;
|
||||||
import org.nl.wms.database.eas.dao.mapper.AllocationBillMapper;
|
import org.nl.wms.database.eas.dao.mapper.AllocationBillMapper;
|
||||||
import org.nl.wms.database.eas.service.IallocationBillService;
|
import org.nl.wms.database.eas.service.IallocationBillService;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.nl.wms.ext.eas.WmsToEasService;
|
import org.nl.wms.ext.eas.WmsToEasService;
|
||||||
import org.nl.wms.ext.srm.WmsToSrmService;
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
@@ -23,14 +21,14 @@ import org.springframework.beans.BeanUtils;
|
|||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
import org.nl.common.base.CommonPage;
|
import org.nl.common.base.CommonPage;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Map;
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.Set;
|
import java.util.concurrent.ExecutionException;
|
||||||
import java.util.List;
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
|
import java.util.concurrent.atomic.AtomicLong;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -49,6 +47,9 @@ public class AllocationBillServiceImpl extends ServiceImpl<AllocationBillMapper,
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private WmsToEasService wmsToEasService;
|
private WmsToEasService wmsToEasService;
|
||||||
|
@Resource
|
||||||
|
@Qualifier("threadPoolExecutor")
|
||||||
|
private ThreadPoolExecutor pool;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询调拨单据
|
* 查询调拨单据
|
||||||
@@ -58,10 +59,37 @@ public class AllocationBillServiceImpl extends ServiceImpl<AllocationBillMapper,
|
|||||||
@Override
|
@Override
|
||||||
@SaIgnore
|
@SaIgnore
|
||||||
public CommonPage<AllocationBillQuery> allocationPage(AllocationBillQuery params) {
|
public CommonPage<AllocationBillQuery> allocationPage(AllocationBillQuery params) {
|
||||||
// 查询总记录数
|
AtomicLong totalCount = new AtomicLong(0L);
|
||||||
long totalCount = allocationBillMapper.getAllocationCount(params.getFuzzy());
|
CompletableFuture<Void> count = CompletableFuture.runAsync(() -> {
|
||||||
List<AllocationBillQuery> allocationBills = allocationBillMapper.allocationPage(params.getFuzzy(), params.getPage(), params.getSize());
|
try {
|
||||||
if (!allocationBills.isEmpty()) {
|
totalCount.set(allocationBillMapper.getAllocationCount(params.getFuzzy(), params.getCkbm()));
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("异常信息:" + e);
|
||||||
|
}
|
||||||
|
}, pool);
|
||||||
|
CompletableFuture<List<AllocationBillQuery>> page = CompletableFuture.supplyAsync(() -> {
|
||||||
|
try {
|
||||||
|
return allocationBillMapper.allocationPage(params.getFuzzy(), params.getCkbm(), params.getPage(), params.getSize());
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("异常信息:" + e);
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
}, pool);
|
||||||
|
// 等待所有异步任务完成
|
||||||
|
CompletableFuture<Void> allOf = CompletableFuture.allOf(count, page);
|
||||||
|
try {
|
||||||
|
allOf.get();
|
||||||
|
} catch (InterruptedException | ExecutionException e) {
|
||||||
|
log.error("异步任务异常:" + e);
|
||||||
|
}
|
||||||
|
List<AllocationBillQuery> allocationBills = null;
|
||||||
|
try {
|
||||||
|
allocationBills = page.get();
|
||||||
|
} catch (InterruptedException | ExecutionException e) {
|
||||||
|
log.error("获取分页结果异常:" + e);
|
||||||
|
}
|
||||||
|
// 处理查询结果
|
||||||
|
if (allocationBills != null && !allocationBills.isEmpty()) {
|
||||||
allocationBills = allocationBills.stream()
|
allocationBills = allocationBills.stream()
|
||||||
.peek(r -> {
|
.peek(r -> {
|
||||||
r.setJhdrrq(LocalDateTime.parse(r.getJhdrrq(), DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss")).toLocalDate().toString());
|
r.setJhdrrq(LocalDateTime.parse(r.getJhdrrq(), DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss")).toLocalDate().toString());
|
||||||
@@ -69,10 +97,13 @@ public class AllocationBillServiceImpl extends ServiceImpl<AllocationBillMapper,
|
|||||||
})
|
})
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
return CommonPage.getPage(allocationBills, totalCount, params.getPage(), params.getSize());
|
return CommonPage.getPage(allocationBills, totalCount.get(), params.getPage(), params.getSize());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询
|
* 分页查询
|
||||||
*
|
*
|
||||||
@@ -86,14 +117,13 @@ public class AllocationBillServiceImpl extends ServiceImpl<AllocationBillMapper,
|
|||||||
// 查询总记录数
|
// 查询总记录数
|
||||||
long totalCount = allocationBillMapper.getTotalCount(params.getDjid());
|
long totalCount = allocationBillMapper.getTotalCount(params.getDjid());
|
||||||
List<AllocationBillQuery> allocationBillList = allocationBillMapper.allocationDetailPage(params.getPage(), params.getSize(), params.getDjid(), params.getFuzzy());
|
List<AllocationBillQuery> allocationBillList = allocationBillMapper.allocationDetailPage(params.getPage(), params.getSize(), params.getDjid(), params.getFuzzy());
|
||||||
if (allocationBillList.isEmpty()) {
|
if (!allocationBillList.isEmpty()) {
|
||||||
allocationBillList = allocationBillList.stream().peek(r -> {
|
allocationBillList = allocationBillList.stream().peek(r -> {
|
||||||
if (r.getJhdrrq().contains("/") || r.getJhdcrq().contains("/")) {
|
if (r.getJhdrrq().contains("/") || r.getJhdcrq().contains("/")) {
|
||||||
r.setJhdrrq(LocalDateTime.parse(r.getJhdrrq(), DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss")).toLocalDate().toString());
|
r.setJhdrrq(LocalDateTime.parse(r.getJhdrrq(), DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss")).toLocalDate().toString());
|
||||||
r.setJhdcrq(LocalDateTime.parse(r.getJhdcrq(), DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss")).toLocalDate().toString());
|
r.setJhdcrq(LocalDateTime.parse(r.getJhdcrq(), DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss")).toLocalDate().toString());
|
||||||
}
|
}
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
} else {
|
|
||||||
// 获取更新列表
|
// 获取更新列表
|
||||||
List<AllocationBill> updateList = allocationBillMapper.selectList(
|
List<AllocationBill> updateList = allocationBillMapper.selectList(
|
||||||
new LambdaQueryWrapper<AllocationBill>().eq(AllocationBill::getDjid, allocationBillList.get(0).getDjid()));
|
new LambdaQueryWrapper<AllocationBill>().eq(AllocationBill::getDjid, allocationBillList.get(0).getDjid()));
|
||||||
@@ -167,7 +197,7 @@ public class AllocationBillServiceImpl extends ServiceImpl<AllocationBillMapper,
|
|||||||
allocationBillDto.setBillNo(params.get(0).getDjbh());
|
allocationBillDto.setBillNo(params.get(0).getDjbh());
|
||||||
allocationBillDto.setBizDate(params.get(0).getYwrq());
|
allocationBillDto.setBizDate(params.get(0).getYwrq());
|
||||||
allocationBillDto.setDescription(params.get(0).getBz());
|
allocationBillDto.setDescription(params.get(0).getBz());
|
||||||
allocationBillDto.setInWhUser("A110813006");
|
allocationBillDto.setInWhUser(SecurityUtils.getCurrentUsername());
|
||||||
List<AllocationBillDetailDto> entrys = new ArrayList<>();
|
List<AllocationBillDetailDto> entrys = new ArrayList<>();
|
||||||
params.forEach(r -> {
|
params.forEach(r -> {
|
||||||
AllocationBillDetailDto dto = new AllocationBillDetailDto();
|
AllocationBillDetailDto dto = new AllocationBillDetailDto();
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package org.nl.wms.database.eas.service.impl;
|
|||||||
import cn.dev33.satoken.annotation.SaIgnore;
|
import cn.dev33.satoken.annotation.SaIgnore;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.json.JSON;
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.alibaba.fastjson.serializer.SerializerFeature;
|
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||||
@@ -29,7 +28,6 @@ import org.nl.wms.ext.eas.WmsToEasService;
|
|||||||
import org.nl.wms.ext.srm.WmsToSrmService;
|
import org.nl.wms.ext.srm.WmsToSrmService;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Qualifier;
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
import org.springframework.scheduling.annotation.Async;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Propagation;
|
import org.springframework.transaction.annotation.Propagation;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@@ -43,7 +41,9 @@ import java.time.ZoneId;
|
|||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
import java.util.concurrent.ExecutionException;
|
||||||
import java.util.concurrent.ThreadPoolExecutor;
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@@ -84,42 +84,79 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
|
|||||||
/**
|
/**
|
||||||
* 首页显示出入库单据数量
|
* 首页显示出入库单据数量
|
||||||
*/
|
*/
|
||||||
@Override
|
|
||||||
public List<HomeBillCounts> getBillsCount() {
|
public List<HomeBillCounts> getBillsCount() {
|
||||||
Long receiptCount = 0L;
|
AtomicReference<Long> receiptCount = new AtomicReference<>(0L);
|
||||||
Long allocationCount = 0L;
|
AtomicReference<Long> allocationCount = new AtomicReference<>(0L);
|
||||||
List<HomeBillCounts> allCounts = easOutInBillMapper.getBillsCount();
|
AtomicReference<List<HomeBillCounts>> inOutBillList = new AtomicReference<>();
|
||||||
|
CompletableFuture<Void> receipt = CompletableFuture.runAsync(() -> {
|
||||||
|
try {
|
||||||
|
receiptCount.set(receiptBillMapper.receiptCounts());
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("异常信息:" + e);
|
||||||
|
}
|
||||||
|
}, pool);
|
||||||
|
CompletableFuture<Void> allocation = CompletableFuture.runAsync(() -> {
|
||||||
|
try {
|
||||||
|
allocationCount.set(allocationBillMapper.getAllocationCount("", ""));
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("异常信息:" + e);
|
||||||
|
}
|
||||||
|
}, pool);
|
||||||
|
CompletableFuture<Void> inOutBills = CompletableFuture.runAsync(() -> {
|
||||||
|
try {
|
||||||
|
inOutBillList.set(easOutInBillMapper.getBillsCount());
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("异常信息:" + e);
|
||||||
|
}
|
||||||
|
}, pool);
|
||||||
|
CompletableFuture<Void> allOf = CompletableFuture.allOf(receipt, allocation, inOutBills);
|
||||||
|
try {
|
||||||
|
allOf.get();
|
||||||
|
} catch (InterruptedException | ExecutionException e) {
|
||||||
|
log.error("异步任务异常:" + e);
|
||||||
|
}
|
||||||
|
List<HomeBillCounts> allCounts = inOutBillList.get();
|
||||||
HomeBillCounts allocations = new HomeBillCounts();
|
HomeBillCounts allocations = new HomeBillCounts();
|
||||||
HomeBillCounts receipts = new HomeBillCounts();
|
HomeBillCounts receipts = new HomeBillCounts();
|
||||||
receipts.setName(EasBillTypeEnum.SHDJ.getName());
|
receipts.setName(EasBillTypeEnum.SHDJ.getName());
|
||||||
receipts.setDjlx(EasBillTypeEnum.SHDJ.getCode());
|
receipts.setDjlx(EasBillTypeEnum.SHDJ.getCode());
|
||||||
receipts.setYwlx(EasBillTypeEnum.SH.getCode());
|
receipts.setYwlx(EasBillTypeEnum.SH.getCode());
|
||||||
|
receipts.setCounts(receiptCount.toString());
|
||||||
allocations.setName(EasBillTypeEnum.DBQR.getName());
|
allocations.setName(EasBillTypeEnum.DBQR.getName());
|
||||||
allocations.setDjlx(EasBillTypeEnum.DBQR.getCode());
|
allocations.setDjlx(EasBillTypeEnum.DBQR.getCode());
|
||||||
allocations.setYwlx(EasBillTypeEnum.DB.getCode());
|
allocations.setYwlx(EasBillTypeEnum.DB.getCode());
|
||||||
|
allocations.setCounts(allocationCount.toString());
|
||||||
receipts.setCounts(receiptCount.toString());
|
receipts.setCounts(receiptCount.toString());
|
||||||
allocations.setCounts(allocationCount.toString());
|
allocations.setCounts(allocationCount.toString());
|
||||||
try {
|
|
||||||
//receiptCount = receiptBillMapper.receiptCounts();
|
|
||||||
//allocationCount = allocationBillMapper.getAllocationCount("");
|
|
||||||
//receipts.setCounts(receiptCount.toString());
|
|
||||||
//allocations.setCounts(allocationCount.toString());
|
|
||||||
} catch (Exception e) {
|
|
||||||
allCounts.add(allocations);
|
|
||||||
allCounts.add(receipts);
|
|
||||||
return allCounts;
|
|
||||||
}
|
|
||||||
allCounts.add(allocations);
|
allCounts.add(allocations);
|
||||||
allCounts.add(receipts);
|
allCounts.add(receipts);
|
||||||
return allCounts;
|
return allCounts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取仓库信息
|
* 获取仓库信息
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<WarehouseInfo> getWarehouseInfo() {
|
public List<WarehouseInfo> getWarehouseInfo() {
|
||||||
return easOutInBillMapper.getWarehouseInfo();
|
List<WarehouseInfo> warehouseInfoList = easOutInBillMapper.getWarehouseInfo();
|
||||||
|
//三期的仓库放在前面
|
||||||
|
List<WarehouseInfo> second = warehouseInfoList.stream()
|
||||||
|
.filter(r -> r.getCkmc().contains("三期"))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
//三期原材料库放在最前面
|
||||||
|
Optional<WarehouseInfo> first = second.stream()
|
||||||
|
.filter(r -> r.getCkbm().equals("3.03.013"))
|
||||||
|
.findFirst();
|
||||||
|
List<WarehouseInfo> sortedList = new ArrayList<>();
|
||||||
|
first.ifPresent(sortedList::add);
|
||||||
|
second.stream()
|
||||||
|
.filter(r -> !r.equals(first.orElse(null)))
|
||||||
|
.forEach(sortedList::add);
|
||||||
|
warehouseInfoList.stream()
|
||||||
|
.filter(r -> !second.contains(r))
|
||||||
|
.forEach(sortedList::add);
|
||||||
|
return sortedList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ public class ReceiptBillServiceImpl extends ServiceImpl<ReceiptBillMapper, Recei
|
|||||||
@SaIgnore
|
@SaIgnore
|
||||||
public CommonPage<AllocationBillQuery> receiptPage(ReceiptBillQuery params) {
|
public CommonPage<AllocationBillQuery> receiptPage(ReceiptBillQuery params) {
|
||||||
Page<AllocationBillQuery> pageObject = new Page<>(params.getPage(), params.getSize());
|
Page<AllocationBillQuery> pageObject = new Page<>(params.getPage(), params.getSize());
|
||||||
Page<AllocationBillQuery> receiptBills = receiptBillMapper.receiptPage(pageObject, params.getFuzzy());
|
Page<AllocationBillQuery> receiptBills = receiptBillMapper.receiptPage(pageObject, params.getFuzzy(),params.getCkbm());
|
||||||
return CommonPage.getPage(receiptBills);
|
return CommonPage.getPage(receiptBills);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -128,7 +128,7 @@ public class ReceiptBillServiceImpl extends ServiceImpl<ReceiptBillMapper, Recei
|
|||||||
receiptBillDto.setBillId(params.get(0).getDjid());
|
receiptBillDto.setBillId(params.get(0).getDjid());
|
||||||
receiptBillDto.setBillNo(params.get(0).getDjbh());
|
receiptBillDto.setBillNo(params.get(0).getDjbh());
|
||||||
receiptBillDto.setBillType("SHDJ");
|
receiptBillDto.setBillType("SHDJ");
|
||||||
receiptBillDto.setRecUser("A110813006");
|
receiptBillDto.setRecUser(SecurityUtils.getCurrentUsername());
|
||||||
receiptBillDto.setDescription(params.get(0).getBtbz());
|
receiptBillDto.setDescription(params.get(0).getBtbz());
|
||||||
List<ReceiptBillDetailDto> details = new ArrayList<>();
|
List<ReceiptBillDetailDto> details = new ArrayList<>();
|
||||||
params.forEach(r -> {
|
params.forEach(r -> {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.nl.common.websocket.SendHomeWebSocketServer;
|
import org.nl.common.websocket.SendHomeWebSocketServer;
|
||||||
|
import org.nl.config.IdUtil;
|
||||||
import org.nl.system.service.user.dao.SysUser;
|
import org.nl.system.service.user.dao.SysUser;
|
||||||
import org.nl.system.service.user.dao.mapper.SysUserMapper;
|
import org.nl.system.service.user.dao.mapper.SysUserMapper;
|
||||||
import org.nl.wms.database.eas.dao.EasOutInBillDetail;
|
import org.nl.wms.database.eas.dao.EasOutInBillDetail;
|
||||||
@@ -45,7 +46,7 @@ public class EasBillSchedule {
|
|||||||
* eas单据数据同步
|
* eas单据数据同步
|
||||||
*/
|
*/
|
||||||
@Async("taskExecutor")
|
@Async("taskExecutor")
|
||||||
//@Scheduled(cron = "0/120 * * * * *")
|
@Scheduled(cron = "0/90 * * * * *")
|
||||||
public void getEasOutInBills() {
|
public void getEasOutInBills() {
|
||||||
// 获取eas视图查询未提交的单据
|
// 获取eas视图查询未提交的单据
|
||||||
List<EasOutInBillDetail> easOutInBillDetails = easOutInBillDetailMapper.selectPageWithInventory();
|
List<EasOutInBillDetail> easOutInBillDetails = easOutInBillDetailMapper.selectPageWithInventory();
|
||||||
@@ -64,13 +65,16 @@ public class EasBillSchedule {
|
|||||||
|
|
||||||
|
|
||||||
@Async("taskExecutor")
|
@Async("taskExecutor")
|
||||||
//@Scheduled(cron = "0/120 * * * * *")
|
@Scheduled(cron = "0/60 * * * * *")
|
||||||
public void insertUsers(List<SysUser> existingUsers, List<SysUser> newUsers) {
|
public void insertUsers() {
|
||||||
|
List<SysUser> newUsers =sysUserMapper.queryUserList();
|
||||||
|
List<SysUser> existingUsers =sysUserMapper.selectList(new LambdaQueryWrapper<SysUser>().eq(SysUser::getIs_used,"1"));
|
||||||
Set<String> ids = existingUsers.stream().map(SysUser::getUsername).collect(Collectors.toSet());
|
Set<String> ids = existingUsers.stream().map(SysUser::getUsername).collect(Collectors.toSet());
|
||||||
List<SysUser> insertUsers = newUsers.stream()
|
List<SysUser> insertUsers = newUsers.stream()
|
||||||
.filter(user -> !ids.contains(user.getUsername()))
|
.filter(user -> !ids.contains(user.getUsername()))
|
||||||
.peek(user -> {
|
.peek(user -> {
|
||||||
//默认启用
|
//默认启用
|
||||||
|
user.setUser_id(IdUtil.getStringId());
|
||||||
user.setIs_used(true);
|
user.setIs_used(true);
|
||||||
user.setIs_admin(true);
|
user.setIs_admin(true);
|
||||||
user.setPwd_reset_user_id(0L);
|
user.setPwd_reset_user_id(0L);
|
||||||
|
|||||||
Reference in New Issue
Block a user