Commit 48c35e35 by 李小惠

添加警员查询条件,修改记账接口

parent 90e78870
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -78,7 +78,7 @@ public class OrderMainDto implements Serializable {
/**
* 调拨类型(2支拨,1价拨),调拨出入库才有
*/
private Integer transferType;
private Integer allocateType;
/**
* 归还人,归还入库特有
......
......@@ -13,7 +13,7 @@ import java.util.List;
@EqualsAndHashCode(callSuper = true)
public class PolicemanReq extends BaseRequest {
@NotBlank(message = "警员主键不能为空", groups = {add.class, detail.class})
@NotBlank(message = "警员主键不能为空", groups = {add.class})
private String id;
@NotBlank(message = "姓名不能为空")
......
......@@ -24,17 +24,18 @@ public class TemperatureRedisCache extends AbstractRedisCache<Object> {
return JYZBConstant.JYZB_TEMP_PREFIX;
}
public void addTemperatureHumidity(String warehouseId,String warehouseName,long timestamp, double humidity, double temperature) {
public void addTemperatureHumidity(String warehouseId,String warehouseName,long timestamp, double humidity, double temperature,String deviceName) {
HumidityAndtemperature data = new HumidityAndtemperature();
data.setHumidity(humidity);
data.setTemperature(temperature);
data.setCreateTime(timestamp);
data.setDeviceName(deviceName);
data.setWarehouseId(warehouseId);
data.setWarehouseName(warehouseName);
// String key = warehouseId;
// Long size = getRedisTemplate().opsForZSet().size(key);
getRedisTemplate().expire("WarehouseDev:"+warehouseId, 259200, TimeUnit.SECONDS);
getRedisTemplate().opsForZSet().add("WarehouseDev:"+warehouseId, data, timestamp);
getRedisTemplate().expire("WarehouseDev:"+warehouseId, 259200, TimeUnit.SECONDS);
// Setting expire directly on the key
put(warehouseId, data);
}
......
......@@ -90,7 +90,7 @@ public class OrderController {
}
//记账完成之后往消息队列推送消息表示该单子已经完成结算
@PostMapping(path="/",name="记账#logType=30")
@PostMapping(path="/Accounting",name="记账#logType=30")
@ApiOperation("记账")
public ApiRes<Boolean> Accounting(@RequestBody @Validated(ValidationApi.delete.class) UpdateOrderReq req){
return ApiRes.success(orderMainService.Accounting(req));
......
......@@ -173,7 +173,7 @@ public class PoliceController {
@PostMapping(path="/GetPoliceDetail",name="查询单个警员信息#enable")
@ApiOperation("查询单个警员信息")
public ApiRes<PolicemanDto> GetOnePolice(@RequestBody @Validated(ValidationApi.detail.class) PolicemanReq req) {
public ApiRes<PolicemanDto> GetOnePolice(@RequestBody PolicemanReq req) {
return ApiRes.success(policemanService.GetOnePolice(req));
}
......
......@@ -21,8 +21,9 @@ public class Inventory implements Serializable {
@TableId(value = "id",type=IdType.ASSIGN_UUID)
private String id;
@TableField(exist = false)
private Long inventoryId;
private Long wiId;
/**
* 装备包ID
......
......@@ -165,7 +165,7 @@ import static com.junmp.junmpProcess.common.CommonConstants.*;
orderDetailService.updateBatchById(list);
updateOrderReq.setDetailList(collect);
//将单据上传到rabbitmq
orderMainService.AddFinishOrder(updateOrderReq);
// orderMainService.AddFinishOrder(updateOrderReq);
} else
//业务单据
if (Type.equals("bussinessOrder")){
......
......@@ -91,7 +91,7 @@ public interface InventoryMapper extends BaseMapper<Inventory> {
List<Inventory> searchExpireEqs(@Param("list") List<Object[]> searchItem);
List<EquipmentDto> alignInventoryInfo(@Param("orgId")Long orgId,
@Param("locationId") String locationId,
@Param("warehouseId") String warehouseId,
@Param("date")String date,
@Param("typeIdList")List<String> typeIdList,
@Param("sizeIdList")List<String> sizeIdList);
......@@ -111,7 +111,7 @@ public interface InventoryMapper extends BaseMapper<Inventory> {
@Param("price")BigDecimal price, @Param("warrantyPeriod")Integer warrantyPeriod,
@Param("startTime") Date startTime,@Param("endTime") Date endTime);
void updateEqsInfo(@Param("list") List<InventoryReq> addInvList,@Param("updateTime") Date time);
void updateEqsInfo(@Param("list") List<Inventory> addInvList,@Param("updateTime") Date time);
List<Inventory> selectSum(@Param("list") List<Object[]> searchItem,@Param("epcType")Integer epcType);
......
......@@ -16,7 +16,7 @@ import java.util.List;
*/
public interface WarehouseInventoryMapper extends BaseMapper<WarehouseInventory> {
void updateWareInfo(@Param("list") List<InventoryReq> eqsList,@Param("updateTime") Date currentDateTime);
void updateWareInfo(@Param("list") List<WarehouseInventory> eqsList,@Param("updateTime") Date currentDateTime);
}
......
......@@ -381,7 +381,6 @@ public class BusFormServiceImpl extends ServiceImpl<BusFormMapper, BusForm> impl
map.put("busForm",busFormDtos.get(0));
}
return map.get("busForm");
}
......
......@@ -150,7 +150,7 @@ public class EquipmentTypeServiceImpl extends ServiceImpl<EquipmentTypeMapper, E
type.setUpdateTime(DateTimeUtil.getCurrentDateTime());
this.save(type);
//更新parent_ids字段
equipmentTypeMapper.setTypeParentIds(type.getId());
// equipmentTypeMapper.setTypeParentIds(type.getId());
String exchangeName="topicExchange";
MQDto mqDto = new MQDto();
......
......@@ -684,7 +684,7 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
@Override
public List<EquipmentDto> alignInventoryInfo(InventoryReq req) {
String date = DateTimeUtil.TimeLongToString(req.getUpdateTime());
List<EquipmentDto> equipmentDtos = inventoryMapper.alignInventoryInfo(req.getOrgId(), req.getLocationId(), date, req.getTypeIdList(), req.getSizeIdList());
List<EquipmentDto> equipmentDtos = inventoryMapper.alignInventoryInfo(req.getOrgId(), req.getWarehouseId(), date, req.getTypeIdList(), req.getSizeIdList());
return equipmentDtos;
}
......@@ -703,6 +703,7 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
PubOrg pubOrg = pubOrgService.getOne(new LambdaQueryWrapper<PubOrg>().eq(PubOrg::getDName, eqsList.get(0).getOrgName())
.or()
.eq(PubOrg::getOrgName, eqsList.get(0).getOrgName()));
//将summary表进行删除
inventorySummaryService.remove(new LambdaQueryWrapper<InventorySummary>().eq(InventorySummary::getOrgId,pubOrg.getOrgId()));
List<Inventory> addInvList=new ArrayList<>();
......@@ -741,9 +742,9 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
if (CollectionUtil.isNotEmpty(addWareList)){
warehouseInventoryService.saveBatch(addWareList);
}
//直接查询五张数据表并且更新
inventoryMapper.updateEqsInfo(eqsList,DateTimeUtil.getCurrentDateTime());
warehouseInventoryMapper.updateWareInfo(eqsList,DateTimeUtil.getCurrentDateTime());
inventoryMapper.updateEqsInfo(addInvList,DateTimeUtil.getCurrentDateTime());
warehouseInventoryMapper.updateWareInfo(addWareList,DateTimeUtil.getCurrentDateTime());
//重新计算summary表中的数据
inventorySummaryService.updateSummaryInsByOrder(pubOrg.getOrgId());
//是否需要创建报表(不创建,由定时任务进行。)但是在撤回时,需要将报表进行删除
......
......@@ -595,7 +595,6 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
// if (logreq.getOutInState().equals("in")){
Inventory inventory = saveInventory(logreq.getOrgId(),logreq.getLocationId(),logreq,detailLogReq, map, logSummary.getOutInState());
inventoryList.add(inventory);
}
// //如果是快速移库,那么直接将物资的locationId进行修改
if(logreq.getBussinessType().equals("quick")){
......
......@@ -1182,7 +1182,7 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
for (int i = 0; i < updateInvList.size(); i++) {
Inventory updateInv = updateInvList.get(i);
wp1.eq(Inventory::getId, updateInv.getId());
wp2.eq(WarehouseInventory::getId, updateInv.getInventoryId());
wp2.eq(WarehouseInventory::getId, updateInv.getWiId());
if (i < updateInvList.size()-1){
wp1.or();
wp2.or();
......
......@@ -464,10 +464,16 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
*/
@Override
public PolicemanDto GetOnePolice(PolicemanReq req) {
Policeman one = PoliceExist(req.getId());
PubOrg pubOrg = pubOrgService.PubOrgExist(one.getOrgId());
PolicemanDto policemanDto = new PolicemanDto();
if (ObjectUtil.isNull(req.getId()) && ObjectUtil.isNotNull(req.getUserId())){
Policeman one = getOne(new LambdaQueryWrapper<Policeman>().eq(Policeman::getUserId, req.getUserId()));
BeanPlusUtil.copyProperties(one,policemanDto);
return policemanDto;
}
Policeman one = PoliceExist(req.getId());
BeanPlusUtil.copyProperties(one, policemanDto);
PubOrg pubOrg = pubOrgService.PubOrgExist(one.getOrgId());
//将箱门信息展示:
List<Cabinet> cabinetInfo = cabinetMapper.getAllCabinetsWithSingleCabinet(String.valueOf(one.getOrgId()), req.getId());
List<String> boxList=new ArrayList<>();
......@@ -1501,8 +1507,10 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
public boolean changePoliceOrg(UpdateReassignmentReq req) {
//通过警员id查询出该警员的基本信息
Policeman policeman = getById(req.getPoliceId());
SysDict sysDict = sysDictService.getOne(new LambdaQueryWrapper<SysDict>().eq(SysDict::getDictCode, "reassignment_type"));
List<SysDictItem> list = sysDictItemService.list(new LambdaQueryWrapper<SysDictItem>().eq(SysDictItem::getDictId, sysDict.getDictId()));
SysDict sysDict = sysDictService.getOne(new LambdaQueryWrapper<SysDict>()
.eq(SysDict::getDictCode, "reassignment_type"));
List<SysDictItem> list = sysDictItemService.list(new LambdaQueryWrapper<SysDictItem>()
.eq(SysDictItem::getDictId, sysDict.getDictId()));
String itemValue = list.get(0).getItemValue();
String itemValue1 = list.get(1).getItemValue();
StringBuilder stringBuilder = new StringBuilder();
......@@ -1533,7 +1541,8 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
if(CollectionUtil.isNotEmpty(reqEquipments)){
for (PoliceEquipment equipment:reqEquipments) {
stringBuilder.append(equipment.getTypeName()+"【"+equipment.getSizeName()+"】,数量为:"+equipment.getNum()+"\n");
stringBuilder.append(equipment.getTypeName()+
"【"+equipment.getSizeName()+"】,数量为:"+equipment.getNum()+"\n");
inventoryQuantity+=equipment.getNum();
actualQuantity+=equipment.getNum();
}
......@@ -1569,15 +1578,18 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
List<PoliceEquipment> updateList=new ArrayList<>();
List<Object[]> searchItem=new ArrayList<>();
stringBuilder.append(req.getOrgName()+"的警员"+req.getPoliceName()+",警号为:"+req.getPoliceCode()+",因调岗拿走以下装备:");
stringBuilder.append(req.getOrgName()+"的警员"+req.getPoliceName()+
",警号为:"+req.getPoliceCode()+",因调岗拿走以下装备:");
for (PoliceEquipment policeEquipment:list1) {
boolean flag=false;
for (PoliceEquipment one:reqEquipments) {
if (policeEquipment.getSizeId().equals(one.getSizeId())
&& policeEquipment.getTypeId().equals(one.getTypeId())){
Object[] item=new Object[]{policeEquipment.getOrgId(),policeEquipment.getLocationId(),policeEquipment.getTypeId(),policeEquipment.getSizeId(),policeEquipment.getPrice(),one.getNum()};
Object[] item=new Object[]{policeEquipment.getOrgId(),policeEquipment.getLocationId(),
policeEquipment.getTypeId(),policeEquipment.getSizeId(),policeEquipment.getPrice(),one.getNum()};
searchItem.add(item);
stringBuilder.append(policeEquipment.getTypeName()+"【"+policeEquipment.getSizeName()+"】,原数量:"+policeEquipment.getNum()+",取走:"+one.getNum()+",剩余:"+(policeEquipment.getNum()-one.getNum())+"\n");
stringBuilder.append(policeEquipment.getTypeName()+"【"+policeEquipment.getSizeName()+
"】,原数量:"+policeEquipment.getNum()+",取走:"+one.getNum()+",剩余:"+(policeEquipment.getNum()-one.getNum())+"\n");
inventoryQuantity+=policeEquipment.getNum();
actualQuantity+=one.getNum();
policeEquipment.setNum(one.getNum());
......
......@@ -326,7 +326,7 @@ public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper,Warehouse>
Warehouse warehouse = getById(req.getWarehouseId());
//将数据放入redis
temperatureRedisCache.addTemperatureHumidity(req.getWarehouseId(),warehouse.getName(),
req.getCreateTime(),req.getHumidity(),req.getTemperature());
req.getCreateTime(),req.getHumidity(),req.getTemperature(),req.getDeviceName());
//更新仓库的温度和湿度
//将仓库信息存入redis中,
warehouse.setHumidity(req.getHumidity());
......
......@@ -39,16 +39,15 @@
<update id="updateEqsInfo">
<foreach collection="list" item="item" separator=";">
update
base_inventory
base_inventory i
set
size_id=(select DISTINCT id FROM base_equipment_size where name = #{item.sizeName} and
type_id =(select DISTINCT id FROM base_equipment_type where name = #{item.typeName} limit 1) limit 1),
type_id=(select DISTINCT id FROM base_equipment_type where name = #{item.typeName} limit 1),
location_id=(select DISTINCT id FROM base_warehouse where name = #{item.locationId} limit 1),
state="normal",bussiness_state="normal",update_time=#{updateTime},property=0,epc_type=1,location_state="in",
location_type=0
where note ="equipmentImport"
i.size_id=(select DISTINCT id FROM base_equipment_size where name = #{item.sizeName} and
i.type_id =(select DISTINCT id FROM base_equipment_type where name = #{item.typeName} limit 1) limit 1),
i.type_id=(select DISTINCT id FROM base_equipment_type where name = #{item.typeName} limit 1),
i.location_id=(select DISTINCT id FROM base_warehouse where name = #{item.locationName} limit 1),
i.state="normal",i.bussiness_state="normal",i.update_time=#{updateTime},i.property=0,i.epc_type=1,i.location_state="in",
i.location_type=0
where i.epc=#{item.epc}
</foreach>
</update>
......@@ -676,8 +675,8 @@
`base_warehouse_inventory` wi
WHERE
wi.org_id = #{orgId}
<if test="locationId!= null and locationId != ''">
and wi.location_id=#{locationId}
<if test="warehouseId!= null and warehouseId != ''">
and wi.location_id=#{warehouseId}
</if>
<if test="date!= null and date != ''">
and i.update_time >= #{date}
......@@ -829,7 +828,7 @@
</select>
<select id="getEqsInfo" resultType="com.junmp.jyzb.entity.Inventory">
SELECT wi.id as inventoryId,wi.type_id,wi.size_id,wi.shelf_id,wi.shelf_location, wi.epc,wi.org_id,wi.location_state,
SELECT wi.id as wiId,wi.type_id,wi.size_id,wi.shelf_id,wi.shelf_location, wi.epc,wi.org_id,wi.location_state,
wi.type_name,wi.org_name,wi.size_name,wi.location_name,
wi.location_type,wi.location_id,i.id ,i.price,i.state,i.bussiness_state,
i.production_date,i.warranty_period,i.maintenance_period, i.term_state
......
......@@ -37,9 +37,9 @@
size_id=(select DISTINCT id FROM base_equipment_size where name=#{item.sizeName} and
type_id =(select DISTINCT id FROM base_equipment_type where name=#{item.typeName} limit 1) limit 1),
type_id=(select DISTINCT id FROM base_equipment_type where name=#{item.typeName} limit 1),
location_id=(select DISTINCT id FROM base_warehouse where name=#{item.locationId} limit 1),
location_id=(select DISTINCT id FROM base_warehouse where name=#{item.locationName} limit 1),
update_time=#{updateTime},epc_type=1,location_state="in",location_type=0
where flag =2
where epc=#{item.epc}
</set>
</foreach>
......
......@@ -36,7 +36,7 @@ knife4j:
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.1.128:3306/db_jyzb_test?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&nullCatalogMeansCurrent=true
url: jdbc:mysql://192.168.1.128:3306/db_jyzb_test?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&nullCatalogMeansCurrent=true&allowMultiQueries=true
username: root
password: 123456
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论