Commit 4e2e7292 by 李小惠

修改装备类型接口和出入库

parent 97678fa6
...@@ -202,4 +202,6 @@ public class BusFormDto { ...@@ -202,4 +202,6 @@ public class BusFormDto {
* 单据上次状态(forbidden禁止使用,outgoing 仅出库使用,incoming仅入库使用,bothuseing出入库都可以使用一次) * 单据上次状态(forbidden禁止使用,outgoing 仅出库使用,incoming仅入库使用,bothuseing出入库都可以使用一次)
*/ */
private String orderLastState; private String orderLastState;
private String orderMainId;
} }
...@@ -23,7 +23,7 @@ public class LogSummaryReq extends BaseRequest { ...@@ -23,7 +23,7 @@ public class LogSummaryReq extends BaseRequest {
/** /**
* 组织机构ID * 组织机构ID
*/ */
@NotNull(message = "组织机构id不能为空",groups = {page.class}) // @NotNull(message = "组织机构id不能为空",groups = {page.class})
private Long orgId; private Long orgId;
/** /**
......
...@@ -125,6 +125,8 @@ public class OrderMainReq extends BaseRequest { ...@@ -125,6 +125,8 @@ public class OrderMainReq extends BaseRequest {
private List<OrderDetailReq> detailList; private List<OrderDetailReq> detailList;
private String receiveUserId; private String receiveUserId;
//发物单位,有可能是组织机构也有可能是供应商
private String name;
} }
......
...@@ -204,7 +204,7 @@ public class Inventory implements Serializable { ...@@ -204,7 +204,7 @@ public class Inventory implements Serializable {
@TableField(value = "create_user", fill = FieldFill.UPDATE) @TableField(value = "create_user", fill = FieldFill.UPDATE)
private String createUser; private String createUser;
@TableField(exist = false)
private String bussinessType;
} }
\ No newline at end of file
...@@ -23,6 +23,7 @@ public class InventorySummary implements Serializable { ...@@ -23,6 +23,7 @@ public class InventorySummary implements Serializable {
@TableId(type = IdType.AUTO) @TableId(type = IdType.AUTO)
private Long id; private Long id;
@TableField(value = "valuekey",updateStrategy = FieldStrategy.IGNORED)
private String valuekey; private String valuekey;
/** /**
* 组织机构id * 组织机构id
......
...@@ -118,7 +118,8 @@ import static com.junmp.junmpProcess.common.CommonConstants.*; ...@@ -118,7 +118,8 @@ import static com.junmp.junmpProcess.common.CommonConstants.*;
String Type= orderType.get(0).getValue().toString(); String Type= orderType.get(0).getValue().toString();
if (Type.equals("workOrder") || Type.equals("quickOrder"))//出入库单据(包含快速移库出库单) if (Type.equals("workOrder") )//出入库单据
// if (Type.equals("workOrder") || Type.equals("quickOrder"))//出入库单据
{ {
// OrderMainReq req=new OrderMainReq(); // OrderMainReq req=new OrderMainReq();
// req.setProcessId(processInstanceId); // req.setProcessId(processInstanceId);
......
...@@ -28,7 +28,7 @@ public class OutInLogsReceiver { ...@@ -28,7 +28,7 @@ public class OutInLogsReceiver {
channel.basicAck(deliveryTag, false); channel.basicAck(deliveryTag, false);
OutInLogsReq req = JSON.parseObject(msg, OutInLogsReq.class); OutInLogsReq req = JSON.parseObject(msg, OutInLogsReq.class);
//将消息进行消费 //将消息进行消费
Boolean result = logSummaryService.processInventoryRecords(req); Boolean result = logSummaryService.processInventoryRecords(req);
} catch (Exception e) { } catch (Exception e) {
// 处理消息过程中发生异常,拒绝消息并将其重新放回队列ms // 处理消息过程中发生异常,拒绝消息并将其重新放回队列ms
......
...@@ -91,7 +91,6 @@ public class EquipmentTypeServiceImpl extends ServiceImpl<EquipmentTypeMapper, E ...@@ -91,7 +91,6 @@ public class EquipmentTypeServiceImpl extends ServiceImpl<EquipmentTypeMapper, E
int newcode = parentType.getMaxCode() + 1; int newcode = parentType.getMaxCode() + 1;
type.setId(String.valueOf(newcode)); type.setId(String.valueOf(newcode));
type.setCode(String.valueOf(newcode)); type.setCode(String.valueOf(newcode));
parentType.setMaxCode(newcode); parentType.setMaxCode(newcode);
parentType.setCode(String.valueOf(newcode)); parentType.setCode(String.valueOf(newcode));
List<SupplierType> supplierType = new ArrayList<>(); List<SupplierType> supplierType = new ArrayList<>();
...@@ -424,10 +423,14 @@ public class EquipmentTypeServiceImpl extends ServiceImpl<EquipmentTypeMapper, E ...@@ -424,10 +423,14 @@ public class EquipmentTypeServiceImpl extends ServiceImpl<EquipmentTypeMapper, E
EquipmentTreeDto childDto = convertNode(childEntity, entityList,type); EquipmentTreeDto childDto = convertNode(childEntity, entityList,type);
if (childEntity.getType()!=1 && type==0){ if (childEntity.getType()!=1 && type==0){
children.add(childDto); children.add(childDto);
dto.setIsLeaf(false);
} else if (childEntity.getType()==1 && type==0) {
dto.setIsLeaf(true);
} else if (type==1) { } else if (type==1) {
children.add(childDto); children.add(childDto);
dto.setIsLeaf(false);
} }
dto.setIsLeaf(false); // 存在子节点,当前节点不是叶子节点 // dto.setIsLeaf(false); // 存在子节点,当前节点不是叶子节点
} }
} }
......
...@@ -412,7 +412,7 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa ...@@ -412,7 +412,7 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa
//位置id(单警柜/仓库) //位置id(单警柜/仓库)
wrapper.eq(ObjectUtil.isNotEmpty(req.getLocationId()), InventorySummary::getLocationId, req.getLocationId()); wrapper.eq(ObjectUtil.isNotEmpty(req.getLocationId()), InventorySummary::getLocationId, req.getLocationId());
//位置类型 //位置类型
wrapper.eq(ObjectUtil.isNotEmpty(req.getLocationType()),InventorySummary::getLocationType,req.getLocationType()); wrapper.eq(ObjectUtil.isNotNull(req.getLocationType())&& !req.getLocationType().trim().isEmpty(),InventorySummary::getLocationType,req.getLocationType());
//位置信息 //位置信息
wrapper.like(ObjectUtil.isNotEmpty(req.getLocationName()), InventorySummary::getLocationName, req.getLocationName()); wrapper.like(ObjectUtil.isNotEmpty(req.getLocationName()), InventorySummary::getLocationName, req.getLocationName());
//根据类别 //根据类别
......
...@@ -78,8 +78,9 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm ...@@ -78,8 +78,9 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
req.setOrder("desc"); req.setOrder("desc");
} }
LambdaQueryWrapper<LogSummary> eq = new LambdaQueryWrapper<LogSummary>() LambdaQueryWrapper<LogSummary> eq = new LambdaQueryWrapper<LogSummary>()
.eq(LogSummary::getOrgId,req.getOrgId()) .eq(ObjectUtil.isNotNull(req.getOrgId()),LogSummary::getOrgId,req.getOrgId())
.eq(LogSummary::getLocationType,req.getLocationType()) .eq(LogSummary::getLocationType,req.getLocationType())
.eq(ObjectUtil.isNotNull(req.getOrderMainId()),LogSummary::getOrderMainId,req.getOrderMainId())
.eq(ObjectUtil.isNotNull(req.getBussinessType()) && !req.getBussinessType().trim().isEmpty(),LogSummary::getBussinessType,req.getBussinessType()) .eq(ObjectUtil.isNotNull(req.getBussinessType()) && !req.getBussinessType().trim().isEmpty(),LogSummary::getBussinessType,req.getBussinessType())
.eq(ObjectUtil.isNotNull(req.getOutInState()) && !req.getOutInState().trim().isEmpty(),LogSummary::getOutInState,req.getOutInState()) .eq(ObjectUtil.isNotNull(req.getOutInState()) && !req.getOutInState().trim().isEmpty(),LogSummary::getOutInState,req.getOutInState())
.eq(ObjectUtil.isNotNull(req.getLocationId()),LogSummary::getLocationId,req.getLocationId()) .eq(ObjectUtil.isNotNull(req.getLocationId()),LogSummary::getLocationId,req.getLocationId())
...@@ -186,7 +187,11 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm ...@@ -186,7 +187,11 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
//存一个list用于修改库存inventory表的数据(采购时那么这个inventoryList就为空) //存一个list用于修改库存inventory表的数据(采购时那么这个inventoryList就为空)
List<Inventory> inventoryList=new ArrayList<>(); List<Inventory> inventoryList=new ArrayList<>();
List<OrderLog> orderLogList=new ArrayList<>(); List<OrderLog> orderLogList=new ArrayList<>();
String orderMainId="";
for (SummaryLogReq logreq:logSummaryList) { for (SummaryLogReq logreq:logSummaryList) {
if (ObjectUtil.isNotNull(logreq.getOrderMainId())){
orderMainId=logreq.getOrderMainId();
}
//如果类型为normal,那么则表示作为日常出入库的记录,否则则作为单据的出入库记录 //如果类型为normal,那么则表示作为日常出入库的记录,否则则作为单据的出入库记录
List<DetailLogReq> logList = logreq.getLogDetailList(); List<DetailLogReq> logList = logreq.getLogDetailList();
//出入库list //出入库list
...@@ -211,10 +216,10 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm ...@@ -211,10 +216,10 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
//判断logSummary是否为采购, //判断logSummary是否为采购,
//如果是采购则不处理,因为采购的inventory是跟着单子来处理的,其他的单子直接根据出入库记录来处理 //如果是采购则不处理,因为采购的inventory是跟着单子来处理的,其他的单子直接根据出入库记录来处理
if (!logreq.getBussinessType().equals("purchase")){ if (!logreq.getBussinessType().equals("purchase")){
if (logreq.getOutInState().equals("in")){ // if (logreq.getOutInState().equals("in")){
Inventory inventory = saveInventory(detailLogReq, map, logSummary.getOutInState()); Inventory inventory = saveInventory(logreq.getOrgId(),logreq.getLocationId(),detailLogReq, map, logSummary.getOutInState());
inventoryList.add(inventory); inventoryList.add(inventory);
} // }
// else { // else {
// Inventory inventory = saveInventory(detailLogReq, map, logSummary.getOutInState()); // Inventory inventory = saveInventory(detailLogReq, map, logSummary.getOutInState());
// inventoryList.add(inventory); // inventoryList.add(inventory);
...@@ -241,16 +246,36 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm ...@@ -241,16 +246,36 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
if (orderLogList.size()>0){ if (orderLogList.size()>0){
boolean b = orderLogService.saveBatch(orderLogList); boolean b = orderLogService.saveBatch(orderLogList);
} }
OrderMain ordermain=null;
if (ObjectUtil.isNotEmpty(orderMainId)){
ordermain = orderMainService.getById(orderMainId);
}
//修改inventory表中的数据(如果不为空则表示不是采购单或者已经将采购单的信息过滤掉) //修改inventory表中的数据(如果不为空则表示不是采购单或者已经将采购单的信息过滤掉)
if (inventoryList.size()>0){ if (inventoryList.size()>0){
LambdaUpdateWrapper<Inventory> updateStateWrapper = Wrappers.lambdaUpdate(); LambdaUpdateWrapper<Inventory> updateStateWrapper = Wrappers.lambdaUpdate();
LambdaUpdateWrapper<Inventory> allocateInWrapper = Wrappers.lambdaUpdate();
for (Inventory inventory:inventoryList) { for (Inventory inventory:inventoryList) {
updateStateWrapper.or().eq(Inventory::getEpc,inventory.getEpc()) if (inventory.getBussinessType().equals("allocate") && inventory.getLocationState().equals("in") && !ObjectUtil.isNull(ordermain)){
.set(Inventory::getLocationState,inventory.getLocationState()) //调拨入库
.set(Inventory::getBussinessState,inventory.getBussinessState()) allocateInWrapper.or().eq(Inventory::getEpc,inventory.getEpc())
.set(Inventory::getState,inventory.getState()); .set(Inventory::getOrgId,inventory.getOrgId())
.set(Inventory::getLocationId,inventory.getLocationId());
} else {
//其他情况
updateStateWrapper.or().eq(Inventory::getEpc,inventory.getEpc())
.set(Inventory::getLocationState,inventory.getLocationState())
.set(Inventory::getBussinessState,inventory.getBussinessState())
.set(Inventory::getState,inventory.getState());
}
} }
inventoryService.update(updateStateWrapper); inventoryService.update(updateStateWrapper);
inventoryService.update(allocateInWrapper);
} }
return returnList; return returnList;
...@@ -283,13 +308,16 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm ...@@ -283,13 +308,16 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
return logSummary; return logSummary;
} }
private Inventory saveInventory(DetailLogReq req,Map<String, String> map,String outInState){ private Inventory saveInventory(Long orgId,String locationId,DetailLogReq req,Map<String, String> map,String outInState){
Inventory inventory = new Inventory(); Inventory inventory = new Inventory();
BeanPlusUtil.copyProperties(req,inventory); BeanPlusUtil.copyProperties(req,inventory);
inventory.setId(req.getInventoryId()); inventory.setId(req.getInventoryId());
inventory.setLocationState(outInState); inventory.setLocationState(outInState);
inventory.setLocationId(locationId);
inventory.setState(map.get("state")); inventory.setState(map.get("state"));
inventory.setOrgId(orgId);
inventory.setBussinessState(map.get("bussinessType")); inventory.setBussinessState(map.get("bussinessType"));
inventory.setBussinessType(req.getBussinessType());
return inventory; return inventory;
} }
......
...@@ -254,23 +254,24 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman ...@@ -254,23 +254,24 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
PolicemanDto policemanDto = new PolicemanDto(); PolicemanDto policemanDto = new PolicemanDto();
BeanPlusUtil.copyProperties(one, policemanDto); BeanPlusUtil.copyProperties(one, policemanDto);
//将箱门信息展示: //将箱门信息展示:
List<Cabinet> cabinetInfo = cabinetMapper.getAllCabinetsWithSingleCabinet(String.valueOf(req.getOrgId()), req.getId()); List<Cabinet> cabinetInfo = cabinetMapper.getAllCabinetsWithSingleCabinet(String.valueOf(one.getOrgId()), req.getId());
List<String> boxList=new ArrayList<>(); List<String> boxList=new ArrayList<>();
String boxName="";
if (cabinetInfo.size()>0){ if (cabinetInfo.size()>0){
for (Cabinet cabinet:cabinetInfo) { for (Cabinet cabinet:cabinetInfo) {
// if (boxPolice.getContainType()==1){ if (cabinet.getContainType().equals("1")){
// soloList.add(boxPolice.getCabinetBoxId()); boxList.add(0,cabinet.getBoxId());
// soloName = soloName + boxPolice.getCabinetName()+","; boxName = (ObjectUtil.isNull(cabinet.getName())?cabinet.getName():cabinet.getLocation())+"单警"+cabinet.getNumber()+"号箱门,"+boxName;
//
// }else { }else {
// publicList.add(boxPolice.getCabinetBoxId()); boxList.add(cabinet.getBoxId());
// publicName = publicName + boxPolice.getCabinetName()+","; boxName = boxName + (ObjectUtil.isNull(cabinet.getName())?cabinet.getName():cabinet.getLocation())+"公共"+cabinet.getNumber()+"号箱门,";
// } }
} }
policemanDto.setBoxList(boxList); policemanDto.setBoxList(boxList);
} }
// policemanDto.setBoxName(soloName.trim().isEmpty()?soloName:soloName.substring(0,soloName.length()-1)); policemanDto.setBoxName(boxName.trim().isEmpty()?boxName:boxName.substring(0,boxName.length()-1));
//将警员的指纹信息查询出来 //将警员的指纹信息查询出来
List<PoliceFinger> list1 = policeFingerService.list(new LambdaQueryWrapper<PoliceFinger>() List<PoliceFinger> list1 = policeFingerService.list(new LambdaQueryWrapper<PoliceFinger>()
...@@ -343,6 +344,7 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman ...@@ -343,6 +344,7 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
//如果不为空则表示修改警员密码 //如果不为空则表示修改警员密码
if (req.getPassword()!=null && !req.getPassword().trim().isEmpty()) { if (req.getPassword()!=null && !req.getPassword().trim().isEmpty()) {
String newPassword = storedEncryptApi.encrypt(req.getPassword()); String newPassword = storedEncryptApi.encrypt(req.getPassword());
//同时修改警员密码
req.setPassword(newPassword); req.setPassword(newPassword);
//修改警员密码的同时修改账号表中的密码 //修改警员密码的同时修改账号表中的密码
sysUserService.update(new SysUser(), sysUserService.update(new SysUser(),
...@@ -485,8 +487,6 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman ...@@ -485,8 +487,6 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
req.setPageSize(10L); req.setPageSize(10L);
} }
long size=policemanMapper.count(req.getOrgId(),req.getAccount(),req.getName(),req.getPoliceCode(),req.getState(),req.getPhone(),req.getFlag()); long size=policemanMapper.count(req.getOrgId(),req.getAccount(),req.getName(),req.getPoliceCode(),req.getState(),req.getPhone(),req.getFlag());
System.out.println("req = " + (req.getPageNo()-1));
System.out.println("req = " + req.getPageSize());
List<PolicemanDto> policemanDtos = policemanMapper.selectUserBypoliceIds List<PolicemanDto> policemanDtos = policemanMapper.selectUserBypoliceIds
(req.getOrgId(),req.getAccount(),req.getName(),req.getPoliceCode(), (req.getOrgId(),req.getAccount(),req.getName(),req.getPoliceCode(),
req.getState(),req.getPhone(),req.getFlag(),(req.getPageNo()-1)*req.getPageSize(),req.getPageSize(),req.getColumn(),req.getOrder()); req.getState(),req.getPhone(),req.getFlag(),(req.getPageNo()-1)*req.getPageSize(),req.getPageSize(),req.getColumn(),req.getOrder());
......
...@@ -467,11 +467,11 @@ ...@@ -467,11 +467,11 @@
</foreach> </foreach>
</select> </select>
<select id="selectEqsByItem" resultType="com.junmp.jyzb.entity.Inventory"> <select id="selectEqsByItem" resultType="com.junmp.jyzb.entity.Inventory">
select * from base_inventory where ( select i.id,i.org_id_int as orgId,i.size_id,i.type_id,i.price from base_inventory i where (
<foreach collection="list" item="item" separator="or"> <foreach collection="list" item="item" separator="or">
( (
location_state = 'in' AND state = 'normal' AND org_id_int = ${item[0]} AND location_id = '${item[1]}' AND location_state = 'in' AND state = 'normal' AND org_id_int = ${item[0]} AND location_id = '${item[1]}' AND
type_id = ${item[3]} AND size_id = '${item[2]}' AND unit_price = ${item[4]} type_id = ${item[2]} AND size_id = '${item[3]}' AND price = ${item[4]}
) )
</foreach> </foreach>
) )
......
...@@ -87,6 +87,9 @@ ...@@ -87,6 +87,9 @@
<if test="req.orderState !=null and req.orderState != ''"> <if test="req.orderState !=null and req.orderState != ''">
and order_state = #{req.orderState} and order_state = #{req.orderState}
</if> </if>
<if test="req.name!=null and req.name!=''">
and (start_org_name LIKE CONCAT('%', #{req.name}, '%') or end_org_name LIKE CONCAT('%', #{req.name}, '%') or supplier_name LIKE CONCAT('%', #{req.name}, '%') )
</if>
<if test=" req.examineState=='unaudited'"> <if test=" req.examineState=='unaudited'">
and examine_state in('none','working') and examine_state in('none','working')
</if> </if>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论