Browse Source

opt:增加仓库搜索

master1
gongbaoxiong 6 months ago
parent
commit
c74dfebdb0
  1. 2
      nlsso-server/src/main/java/org/nl/common/base/CommonPage.java
  2. 2
      nlsso-server/src/main/java/org/nl/common/base/ResultCode.java
  3. 4
      nlsso-server/src/main/java/org/nl/wms/database/eas/controller/AllocationBillController.java
  4. 2
      nlsso-server/src/main/java/org/nl/wms/database/eas/controller/EasOutInBillController.java
  5. 2
      nlsso-server/src/main/java/org/nl/wms/database/eas/dao/mapper/EasOutInBillMapper.java
  6. 11
      nlsso-server/src/main/java/org/nl/wms/database/eas/dao/xml/AllocationBillMapper.xml
  7. 12
      nlsso-server/src/main/java/org/nl/wms/database/eas/dao/xml/EasOutInBillDetailMapper.xml
  8. 14
      nlsso-server/src/main/java/org/nl/wms/database/eas/dto/InventoryInfos.java
  9. 2
      nlsso-server/src/main/java/org/nl/wms/database/eas/service/IallocationBillService.java
  10. 52
      nlsso-server/src/main/java/org/nl/wms/database/eas/service/impl/AllocationBillServiceImpl.java
  11. 31
      nlsso-server/src/main/java/org/nl/wms/database/eas/service/impl/EasOutInBillServiceImpl.java
  12. 7
      nlsso-server/src/main/java/org/nl/wms/database/eas/service/impl/ReceiptBillServiceImpl.java
  13. 2
      nlsso-server/src/main/java/org/nl/wms/schedule/EasBillSchedule.java

2
nlsso-server/src/main/java/org/nl/common/base/CommonPage.java

@ -53,7 +53,7 @@ public class CommonPage<T> {
CommonPage<T> result = new CommonPage<>();
result.setResult(pageResult);
result.setCode(1);
result.setDesc("操作成");
result.setDesc("操作成");
return result;
}

2
nlsso-server/src/main/java/org/nl/common/base/ResultCode.java

@ -7,7 +7,7 @@ import com.baomidou.mybatisplus.extension.api.IErrorCode;
*/
public enum ResultCode implements IErrorCode {
//
SUCCESS(1, "操作成"),
SUCCESS(1, "操作成"),
FAILED(0, "操作失败"),
MISS_PARAMETER(400, "参数缺失"),
UNAUTHORIZED(401, "暂未登录或token已经过期"),

4
nlsso-server/src/main/java/org/nl/wms/database/eas/controller/AllocationBillController.java

@ -81,9 +81,9 @@ public class AllocationBillController {
*
* @param params 根据条件查询库存跟踪号
*/
@PostMapping("/getInventoryInfo")
@PostMapping("/queryInventoryInfo")
@Log("根据条件查询库存跟踪号")
public ResponseEntity<List<InventoryInfos>> getInventoryInfo(@RequestBody AllocationBillVO params) {
public ResponseEntity<CommonPage<InventoryInfos>> queryInventoryInfo(@RequestBody AllocationBillVO params) {
return new ResponseEntity<>(allocationBillService.getInventoryInfo(params), HttpStatus.OK);
}

2
nlsso-server/src/main/java/org/nl/wms/database/eas/controller/EasOutInBillController.java

@ -110,7 +110,7 @@ public class EasOutInBillController {
/**
* 获取仓库信息
*/
@PostMapping("/getUserInfo")
@PostMapping("/getWarehouseInfo")
@Log("获取仓库信息")
public CommonResult<List<WarehouseInfo>> getWarehouseInfo() {
return RestBusinessTemplate.execute(() -> easOutInBillService.getWarehouseInfo());

2
nlsso-server/src/main/java/org/nl/wms/database/eas/dao/mapper/EasOutInBillMapper.java

@ -50,7 +50,7 @@ public interface EasOutInBillMapper extends BaseMapper<EasOutInBill> {
List<WarehouseInfo> getOrganizationInfo();
@Select("SELECT * FROM EAS_NOBLE.V_UC_USERINFO")
@Select("SELECT YHBM AS CGYBM,YHMC AS CGYMC FROM EAS_NOBLE.V_UC_USERINFO")
@DS("oracle_eas")
List<WarehouseInfo> getUserInfo();

11
nlsso-server/src/main/java/org/nl/wms/database/eas/dao/xml/AllocationBillMapper.xml

@ -58,16 +58,7 @@
<select id="selectByCondition" resultType="org.nl.wms.database.eas.dto.InventoryInfos">
SELECT
materialNo,
materialName,
warehouseNo,
warehouseName
locationNo,
locationName,
lot,
curStoreQty,
unitNo,
trackNo
*
FROM EAS_NOBLE.V_UC_INVENTORYINFO
<where>
<if test="dckcbm != null and dckcbm != ''">

12
nlsso-server/src/main/java/org/nl/wms/database/eas/dao/xml/EasOutInBillDetailMapper.xml

@ -5,7 +5,7 @@
SELECT *
FROM EAS_NOBLE.V_UC_OUTINBILL
WHERE DJZT = '提交'
AND TO_DATE(cjsj, 'YYYY-MM-DD HH24:MI:SS') >= TRUNC(SYSDATE) - INTERVAL '1' DAY(3)
AND TO_DATE(cjsj, 'YYYY-MM-DD HH24:MI:SS') >= TRUNC(SYSDATE) - INTERVAL '60' DAY(3)
</select>
<select id="selectSrmPages" resultType="org.nl.wms.database.eas.dao.EasOutInBillDetail">
SELECT *,
@ -14,13 +14,13 @@
WHERE DJZT = '未入库'
AND CJSJ >= DATE_SUB(
CURDATE(),
INTERVAL 1 DAY)
INTERVAL 60 DAY)
</select>
<select id="selectPageWithInventory" resultType="org.nl.wms.database.eas.dao.EasOutInBillDetail">
SELECT *
FROM EAS_NOBLE.V_UC_OUTINBILL
WHERE DJZT = '提交'
AND TO_DATE(cjsj, 'YYYY-MM-DD HH24:MI:SS') >= TRUNC(SYSDATE) - INTERVAL '30' DAY(3)
AND TO_DATE(cjsj, 'YYYY-MM-DD HH24:MI:SS') >= TRUNC(SYSDATE) - INTERVAL '15' DAY(3)
</select>
<select id="selectSrmPageWithInventory" resultType="org.nl.wms.database.eas.dao.EasOutInBillDetail">
SELECT *,
@ -29,21 +29,21 @@
WHERE DJZT = '未入库'
AND CJSJ >= DATE_SUB(
CURDATE(),
INTERVAL 30 DAY)
INTERVAL 15 DAY)
</select>
<select id="selectEasIds" resultType="org.nl.wms.database.eas.dao.EasOutInBillDetail">
SELECT DJID,
FLID
FROM EAS_NOBLE.V_UC_OUTINBILL
WHERE DJZT = '提交'
AND TO_DATE(cjsj, 'YYYY-MM-DD') >= TRUNC(SYSDATE) - INTERVAL '30' DAY(3)
AND TO_DATE(cjsj, 'YYYY-MM-DD') >= TRUNC(SYSDATE) - INTERVAL '15' DAY(3)
</select>
<select id="selectSrmIds" resultType="org.nl.wms.database.eas.dao.EasOutInBillDetail">
SELECT FLID,
DJID
FROM V_WMS_INBILL_THIRD
WHERE DJZT = '未入库'
AND CJSJ >= DATE_SUB(CURDATE(), INTERVAL 30 DAY)
AND CJSJ >= DATE_SUB(CURDATE(), INTERVAL 15 DAY)
</select>
<select id="selectByConditions" resultType="org.nl.wms.database.eas.dao.InventoryInfo">
SELECT

14
nlsso-server/src/main/java/org/nl/wms/database/eas/dto/InventoryInfos.java

@ -23,17 +23,8 @@ public class InventoryInfos extends Model<InventoryInfos> {
private static final long serialVersionUID = -7739291296662381393L;
//@TableId(value = "id", type = IdType.NONE)
/**
* 主键id
*/
private String trackNo;
/**
* 单据编号
*/
private String djbh;
/**
* 物料编码
@ -69,10 +60,7 @@ public class InventoryInfos extends Model<InventoryInfos> {
private String locationName;
/**
* 库存数量
*/
private BigDecimal kcsl;
/**
* 数量

2
nlsso-server/src/main/java/org/nl/wms/database/eas/service/IallocationBillService.java

@ -61,7 +61,7 @@ public interface IallocationBillService extends IService<AllocationBill> {
* @param params 查询条件
* @return String
*/
List<InventoryInfos> getInventoryInfo(AllocationBillVO params);
CommonPage<InventoryInfos> getInventoryInfo(AllocationBillVO params);
/**
* 创建

52
nlsso-server/src/main/java/org/nl/wms/database/eas/service/impl/AllocationBillServiceImpl.java

@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.sun.org.apache.regexp.internal.RE;
import org.apache.commons.lang3.StringUtils;
import org.nl.common.exception.BadRequestException;
import org.nl.common.utils.SecurityUtils;
@ -96,15 +97,11 @@ public class AllocationBillServiceImpl extends ServiceImpl<AllocationBillMapper,
// 处理查询结果
if (allocationBills != null && !allocationBills.isEmpty()) {
// 获取更新列表
List<AllocationBill> updateList = allocationBillMapper.selectList(
new LambdaQueryWrapper<AllocationBill>()
.in(AllocationBill::getDjid, allocationBills.stream().map(AllocationBillQuery::getDjid).collect(Collectors.toList())));
List<AllocationBill> updateList = allocationBillMapper.selectList(new LambdaQueryWrapper<AllocationBill>().in(AllocationBill::getFlid, allocationBills.stream().map(AllocationBillQuery::getDjid).collect(Collectors.toList())));
if (!updateList.isEmpty()) {
Map<String, AllocationBill> updateMap = updateList.stream()
.collect(Collectors.toMap(AllocationBill::getFlid, updateBill -> updateBill));
Map<String, AllocationBill> updateMap = updateList.stream().collect(Collectors.toMap(AllocationBill::getFlid, updateBill -> updateBill));
// 替换为修改记录
allocationBills = allocationBills.stream()
.map(a -> {
allocationBills = allocationBills.stream().map(a -> {
AllocationBill updatedBill = updateMap.get(a.getDjid());
if (updatedBill != null) {
a.setUpdate_id(updatedBill.getUpdate_id());
@ -115,8 +112,7 @@ public class AllocationBillServiceImpl extends ServiceImpl<AllocationBillMapper,
a.setJhdrrq(LocalDateTime.parse(a.getJhdrrq(), DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss")).toLocalDate().toString());
a.setJhdcrq(LocalDateTime.parse(a.getJhdcrq(), DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss")).toLocalDate().toString());
return a;
})
.collect(Collectors.toList());
}).collect(Collectors.toList());
}
}
return CommonPage.getPage(allocationBills, totalCount.get(), params.getPage(), params.getSize());
@ -144,14 +140,11 @@ public class AllocationBillServiceImpl extends ServiceImpl<AllocationBillMapper,
}
}).collect(Collectors.toList());
// 获取更新列表
List<AllocationBill> updateList = allocationBillMapper.selectList(
new LambdaQueryWrapper<AllocationBill>().eq(AllocationBill::getDjid, allocationBillList.get(0).getDjid()));
List<AllocationBill> updateList = allocationBillMapper.selectList(new LambdaQueryWrapper<AllocationBill>().eq(AllocationBill::getDjid, allocationBillList.get(0).getDjid()));
if (!updateList.isEmpty()) {
Map<String, AllocationBill> updateMap = updateList.stream()
.collect(Collectors.toMap(AllocationBill::getFlid, updateBill -> updateBill));
Map<String, AllocationBill> updateMap = updateList.stream().collect(Collectors.toMap(AllocationBill::getFlid, updateBill -> updateBill));
// 替换为修改记录
allocationBillList = allocationBillList.stream()
.map(allocationBill -> {
allocationBillList = allocationBillList.stream().map(allocationBill -> {
AllocationBill updatedBill = updateMap.get(allocationBill.getFlid());
if (updatedBill != null) {
allocationBill.setYwrq(updatedBill.getYwrq());
@ -175,8 +168,7 @@ public class AllocationBillServiceImpl extends ServiceImpl<AllocationBillMapper,
allocationBill.setBtbz(updatedBill.getBz());
}
return allocationBill;
})
.collect(Collectors.toList());
}).collect(Collectors.toList());
}
}
return CommonPage.getPage(allocationBillList, totalCount, params.getPage(), params.getSize());
@ -190,12 +182,7 @@ public class AllocationBillServiceImpl extends ServiceImpl<AllocationBillMapper,
*/
@Override
public List<AllocationBill> query(AllocationBillVO params) {
return allocationBillMapper.selectList(new QueryWrapper<AllocationBill>()
.lambda()
.eq(ObjectUtil.isNotEmpty(params), AllocationBill::getDjbh, params.getFuzzy())
.or()
.eq(ObjectUtil.isNotEmpty(params), AllocationBill::getDjid, params.getFuzzy())
);
return allocationBillMapper.selectList(new QueryWrapper<AllocationBill>().lambda().eq(ObjectUtil.isNotEmpty(params), AllocationBill::getDjbh, params.getFuzzy()).or().eq(ObjectUtil.isNotEmpty(params), AllocationBill::getDjid, params.getFuzzy()));
}
/**
@ -204,8 +191,15 @@ public class AllocationBillServiceImpl extends ServiceImpl<AllocationBillMapper,
* @param params 查询条件
*/
@Override
public List<InventoryInfos> getInventoryInfo(AllocationBillVO params) {
return allocationBillMapper.selectByCondition(params.getDckcbm(), params.getDcckbm(), params.getDckwbm(), params.getWlbm(), params.getPc(), params.getGzh());
public CommonPage<InventoryInfos> getInventoryInfo(AllocationBillVO params) {
// if (StringUtils.isBlank(params.getDckcbm()) && StringUtils.isBlank(params.getDcckbm()) && StringUtils.isBlank(params.getDckwbm()) && StringUtils.isBlank(params.getWlbm()) && StringUtils.isBlank(params.getPc())&& StringUtils.isBlank(params.getGzh())
// {
// return null;
// }else{
// List<InventoryInfos> result = allocationBillMapper.selectByCondition(params.getDckcbm(), params.getDcckbm(), params.getDckwbm(), params.getWlbm(), params.getPc(), "999");
// return CommonPage.restPage(result);
// }
return null;
}
@ -250,8 +244,7 @@ public class AllocationBillServiceImpl extends ServiceImpl<AllocationBillMapper,
}
dto.setRemark(r.getBz());
entrys.add(dto);
}
);
});
allocationBillDto.setEntrys(entrys);
AllocationEasData easData = new AllocationEasData();
easData.setData(allocationBillDto);
@ -270,8 +263,11 @@ public class AllocationBillServiceImpl extends ServiceImpl<AllocationBillMapper,
if (allocationBill == null) {
// 如果不存在该记录,则插入数据
AllocationBill bill = new AllocationBill();
bill.setDjid(id);
bill.setFlid(id);
bill.setShjg(msgDto.getMsg());
bill.setUpdate_id(SecurityUtils.getCurrentUsername());
bill.setUpdate_name(SecurityUtils.getCurrentNickName());
bill.setUpdate_time(DateUtil.format(DateUtil.beginOfDay(DateUtil.date()), "yyyy-MM-dd"));
this.save(bill);
} else {
// 如果存在该记录,则更新数据

31
nlsso-server/src/main/java/org/nl/wms/database/eas/service/impl/EasOutInBillServiceImpl.java

@ -162,19 +162,19 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
}
/**
* 获取仓库信息
* 获取用户信息
*/
@Override
public List<WarehouseInfo> getUserInfo() {
return easOutInBillMapper.getWarehouseInfo();
return easOutInBillMapper.getUserInfo();
}
/**
* 获取仓库信息
* 获取组织信息
*/
@Override
public List<WarehouseInfo> getOrganizationInfo() {
return easOutInBillMapper.getWarehouseInfo();
return easOutInBillMapper.getOrganizationInfo();
}
@ -204,7 +204,7 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
.eq(ObjectUtil.isNotEmpty(params.getCkbm()), EasOutInBill::getCkbm, params.getCkbm())
.eq(ObjectUtil.isNotEmpty(params.getCgybm()), EasOutInBill::getCgybm, params.getCgybm())
//.eq(ObjectUtil.isNotEmpty(params.getDjzt()), EasOutInBill::getDjzt, "1".equals(params.getDjzt()) ? "提交" : "审核")
.eq(ObjectUtil.isNotEmpty(params.getDjzt()), EasOutInBill::getDjzt, "提交")
.eq(EasOutInBill::getDjzt, "提交")
.nested(ObjectUtil.isNotEmpty(params.getFuzzy()),
i -> i.like(EasOutInBill::getDjid, params.getFuzzy())
.or()
@ -604,22 +604,6 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
}
@Async("taskExecutor")
public void confirmDtl(String billJson, String id) {
try {
SrmMsgDto srmMsgDto = wmsToSrmService.sendWebPostData(billJson, 2);
if (srmMsgDto != null) {
if ("false".equals(srmMsgDto.getSuccess())) {
ReceiptBill bill = new ReceiptBill();
bill.setDjid(id);
bill.setShjg(srmMsgDto.getMessage());
receiptBillMapper.updateById(bill);
}
}
} catch (Exception e) {
log.error("审核失败,异常原因:" + e.toString());
}
}
/**
@ -650,7 +634,7 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
}
}
}
updateBills(bill, "审核成功!");
updateBills(bill, msg);
} catch (Exception e) {
updateBills(bill, msg);
log.error("推送Eas单据失败,单据号为:[" + bill.getBillId() + "]异常原因:" + e.toString());
@ -701,6 +685,9 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
} else {
updateWrapper.set("shjg", msg);
}
updateWrapper.set("update_id",SecurityUtils.getCurrentUsername());
updateWrapper.set("update_name",SecurityUtils.getCurrentNickName());
updateWrapper.set("update_time",DateUtil.format(DateUtil.beginOfDay(DateUtil.date()), "yyyy-MM-dd"));
easOutInBillMapper.update(null, updateWrapper);
}

7
nlsso-server/src/main/java/org/nl/wms/database/eas/service/impl/ReceiptBillServiceImpl.java

@ -66,7 +66,7 @@ public class ReceiptBillServiceImpl extends ServiceImpl<ReceiptBillMapper, Recei
if (receiptBillList != null && !receiptBillList.isEmpty()) {
List<ReceiptBill> updateList = receiptBillMapper.selectList(
new LambdaQueryWrapper<ReceiptBill>()
.in(ReceiptBill::getDjid, receiptBillList.stream().map(ReceiptBillQuery::getDjid).collect(Collectors.toList())));
.in(ReceiptBill::getFlid, receiptBillList.stream().map(ReceiptBillQuery::getDjid).collect(Collectors.toList())));
if (updateList != null && !updateList.isEmpty()) {
Map<String, ReceiptBill> updateMap = updateList.stream()
.collect(Collectors.toMap(ReceiptBill::getFlid, updateBill -> updateBill));
@ -186,8 +186,11 @@ public class ReceiptBillServiceImpl extends ServiceImpl<ReceiptBillMapper, Recei
if (receiptBill == null) {
// 如果不存在该记录,则插入数据
ReceiptBill bill = new ReceiptBill();
bill.setDjid(id);
bill.setFlid(id);
bill.setShjg(srmMsgDto.getMessage());
bill.setUpdate_id(SecurityUtils.getCurrentUsername());
bill.setUpdate_name(SecurityUtils.getCurrentNickName());
bill.setUpdate_time(DateUtil.format(DateUtil.beginOfDay(DateUtil.date()), "yyyy-MM-dd"));
this.save(bill);
} else {
// 如果存在该记录,则更新数据

2
nlsso-server/src/main/java/org/nl/wms/schedule/EasBillSchedule.java

@ -112,7 +112,7 @@ public class EasBillSchedule {
* 定时清空单据
*/
@Async("taskExecutor")
@Scheduled(cron = "0/86400 * * * * *")
//@Scheduled(cron = "0/86400 * * * * *")
public void autoDeleteTask() {
LocalDate threeMonthsAgo = LocalDate.now().minusMonths(3);
String days = threeMonthsAgo.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));

Loading…
Cancel
Save