Commit c92d5990 by 赵剑炜

Merge branch 'develop' of http://gitlab.sothing.top/843502640/jyzb_platformV2 into develop-zhaojw

parents 1ef0ce55 98ecfe55
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.
...@@ -19,6 +19,6 @@ public class DetailLogReq { ...@@ -19,6 +19,6 @@ public class DetailLogReq {
private BigDecimal price; private BigDecimal price;
private Integer equipmentType; private Integer equipmentType;
//Epc类型(0固定资产1库存物资非固定资产) //Epc类型(0固定资产1库存物资非固定资产)
private Integer epcType; private Integer property;
} }
...@@ -12,7 +12,7 @@ public class PurchaseEqsReq { ...@@ -12,7 +12,7 @@ public class PurchaseEqsReq {
private String sizeId; private String sizeId;
private String sizeName; private String sizeName;
private String productionDate; private String productionDate;
private Integer warranyPeriod; private Integer warrantyPeriod;
private Integer maintenancePeriod; private Integer maintenancePeriod;
//仓库id和仓库name //仓库id和仓库name
private String locationId; private String locationId;
...@@ -24,4 +24,6 @@ public class PurchaseEqsReq { ...@@ -24,4 +24,6 @@ public class PurchaseEqsReq {
private BigDecimal price; private BigDecimal price;
private Integer epcType; private Integer epcType;
private Integer property;
} }
...@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.toolkit.AES; ...@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.toolkit.AES;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.junmp.jyzb.api.bean.dto.UploadPolicePhotoDto; import com.junmp.jyzb.api.bean.dto.UploadPolicePhotoDto;
import com.junmp.jyzb.api.bean.query.DbAccessReq; import com.junmp.jyzb.api.bean.query.DbAccessReq;
import com.junmp.jyzb.api.bean.query.InAndOutRecordReq.PurchaseEqsReq;
import com.junmp.jyzb.api.bean.query.OrderMainReq; import com.junmp.jyzb.api.bean.query.OrderMainReq;
import com.junmp.jyzb.api.bean.query.PolicemanReq; import com.junmp.jyzb.api.bean.query.PolicemanReq;
import com.junmp.jyzb.api.bean.req.UploadPolicePhotoReq; import com.junmp.jyzb.api.bean.req.UploadPolicePhotoReq;
...@@ -15,8 +16,10 @@ import com.junmp.jyzb.api.bean.vo.AuthAccessVo; ...@@ -15,8 +16,10 @@ import com.junmp.jyzb.api.bean.vo.AuthAccessVo;
import com.junmp.jyzb.api.exception.enums.PublicExceptionEnum; import com.junmp.jyzb.api.exception.enums.PublicExceptionEnum;
import com.junmp.jyzb.cache.MsgRedisCache; import com.junmp.jyzb.cache.MsgRedisCache;
import com.junmp.jyzb.cache.OutInRecordRedisCache; import com.junmp.jyzb.cache.OutInRecordRedisCache;
import com.junmp.jyzb.entity.Inventory;
import com.junmp.jyzb.entity.Policeman; import com.junmp.jyzb.entity.Policeman;
import com.junmp.jyzb.entity.PubOrg; import com.junmp.jyzb.entity.PubOrg;
import com.junmp.jyzb.service.InventoryService;
import com.junmp.jyzb.service.PolicemanService; import com.junmp.jyzb.service.PolicemanService;
import com.junmp.jyzb.service.PubOrgService; import com.junmp.jyzb.service.PubOrgService;
import com.junmp.jyzb.service.PublicService; import com.junmp.jyzb.service.PublicService;
...@@ -61,9 +64,7 @@ import java.io.File; ...@@ -61,9 +64,7 @@ import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.IOException; import java.io.IOException;
import java.net.URL; import java.net.URL;
import java.util.Date; import java.util.*;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -97,6 +98,8 @@ public class PublicController { ...@@ -97,6 +98,8 @@ public class PublicController {
@Resource @Resource
private RabbitAdmin rabbitAdmin; private RabbitAdmin rabbitAdmin;
@Resource
private InventoryService inventoryService;
@Resource @Resource
private OutInRecordRedisCache outInRecordRedisCache; private OutInRecordRedisCache outInRecordRedisCache;
...@@ -164,12 +167,28 @@ public class PublicController { ...@@ -164,12 +167,28 @@ public class PublicController {
} }
@PostMapping("/bbb") @PostMapping("/bbb")
public ApiRes<Boolean> bbb(){ public ApiRes<Boolean> bbb(@RequestBody PurchaseEqsReq eqsReq){
List<Inventory> collect1=new ArrayList<>();
// TopicExchange exchange = new TopicExchange("DevMonitorMsg"); Inventory inventory = new Inventory();
// String exchangeName="DevMonitorMsg"; inventory.setEpc(eqsReq.getEpc());
// rabbitAdmin.declareExchange(exchange); inventory.setTypeId(eqsReq.getTypeId());
// rabbitTemplate.convertAndSend(exchangeName, "1369509498032811869", "设备下线"); inventory.setSizeId(eqsReq.getSizeId());
inventory.setMaintenancePeriod(eqsReq.getMaintenancePeriod());
inventory.setWarrantyPeriod(eqsReq.getWarrantyPeriod());
inventory.setProperty(eqsReq.getProperty());
inventory.setLocationId(eqsReq.getLocationId());
inventory.setSupplierId(eqsReq.getSupplierId());
inventory.setPrice(eqsReq.getPrice());
// BeanPlusUtil.copyProperties(eqsReq, inventory);
inventory.setId(UUID.randomUUID().toString());
inventory.setCreateTime(DateTimeUtil.getCurrentDateTime());
inventory.setState("normal");
inventory.setBussinessState("normal");
inventory.setLocationState("in");
inventory.setLocationType(0);
// inventory.setOrgId(order.getOrgId());
collect1.add(inventory);
inventoryService.saveBatch(collect1);
return ApiRes.success(true); return ApiRes.success(true);
} }
......
...@@ -162,7 +162,7 @@ public class WarehouseController { ...@@ -162,7 +162,7 @@ public class WarehouseController {
return ApiRes.success(warehouseService.alignWarehouseInfo(req)); return ApiRes.success(warehouseService.alignWarehouseInfo(req));
} }
@PostMapping(path="/updateHumidityAndtemperature",name="更新温湿度#logType=30") @PostMapping(path="/updateHumidityAndtemperature",name="更新温湿度#enable")
@ApiOperation("更新温湿度") @ApiOperation("更新温湿度")
public ApiRes<Boolean> updateHumidityAndtemperature(@RequestBody HumidityAndtemperature req){ public ApiRes<Boolean> updateHumidityAndtemperature(@RequestBody HumidityAndtemperature req){
return ApiRes.success(warehouseService.updateHumidityAndtemperature(req)); return ApiRes.success(warehouseService.updateHumidityAndtemperature(req));
......
...@@ -21,6 +21,8 @@ public class Inventory implements Serializable { ...@@ -21,6 +21,8 @@ public class Inventory implements Serializable {
@TableId(value = "id",type=IdType.ASSIGN_UUID) @TableId(value = "id",type=IdType.ASSIGN_UUID)
private String id; private String id;
@TableField(exist = false)
private Long inventoryId;
/** /**
* 装备包ID * 装备包ID
......
...@@ -137,7 +137,8 @@ public class LogDetail implements Serializable { ...@@ -137,7 +137,8 @@ public class LogDetail implements Serializable {
@TableField(value = "picture") @TableField(value = "picture")
private String picture; private String picture;
@TableField(value = "property")
private Integer property;
@TableField(value = "price") @TableField(value = "price")
private BigDecimal price; private BigDecimal price;
......
...@@ -114,6 +114,9 @@ public class WarehouseInventory implements Serializable { ...@@ -114,6 +114,9 @@ public class WarehouseInventory implements Serializable {
@TableField(value = "shelf_id") @TableField(value = "shelf_id")
private String shelfId; private String shelfId;
@TableField(value = "location_name")
private String locationName;
@TableField(exist = false) @TableField(exist = false)
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
......
...@@ -17,6 +17,7 @@ import com.junmp.junmpProcess.utils.RabbitMQUtils2; ...@@ -17,6 +17,7 @@ import com.junmp.junmpProcess.utils.RabbitMQUtils2;
import com.junmp.jyzb.api.bean.dto.MQDto; import com.junmp.jyzb.api.bean.dto.MQDto;
import com.junmp.jyzb.api.bean.dto.OrderDto; import com.junmp.jyzb.api.bean.dto.OrderDto;
import com.junmp.jyzb.api.bean.query.BussinessOrderDetialReq; import com.junmp.jyzb.api.bean.query.BussinessOrderDetialReq;
import com.junmp.jyzb.api.bean.query.InAndOutRecordReq.DetailJsonReq;
import com.junmp.jyzb.api.bean.query.OrderMainReq; import com.junmp.jyzb.api.bean.query.OrderMainReq;
import com.junmp.jyzb.api.bean.req.UpdateBusFormReq; import com.junmp.jyzb.api.bean.req.UpdateBusFormReq;
import com.junmp.jyzb.api.bean.req.UpdateOrderDetailReq; import com.junmp.jyzb.api.bean.req.UpdateOrderDetailReq;
...@@ -57,10 +58,7 @@ import javax.annotation.Resource; ...@@ -57,10 +58,7 @@ import javax.annotation.Resource;
import java.beans.Transient; import java.beans.Transient;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.junmp.junmpProcess.common.CommonConstants.*; import static com.junmp.junmpProcess.common.CommonConstants.*;
...@@ -195,15 +193,45 @@ import static com.junmp.junmpProcess.common.CommonConstants.*; ...@@ -195,15 +193,45 @@ import static com.junmp.junmpProcess.common.CommonConstants.*;
.eq(OrderMain::getProcessId, processInstanceId)); .eq(OrderMain::getProcessId, processInstanceId));
existOrder.setExamineState("finished"); existOrder.setExamineState("finished");
existOrder.setOrderState("finished"); existOrder.setOrderState("finished");
existOrder.setManualState(1); List<OrderDetail> list = orderDetailService.list(new LambdaQueryWrapper<OrderDetail>()
.eq(OrderDetail::getOrderId, existOrder.getId()));
//通过summaryId将出库记录取出来,并且分类存入orderDetail中
LogSummary one = logSummaryService.getOne(new LambdaQueryWrapper<LogSummary>()
.eq(LogSummary::getOrderMainId, existOrder.getId()));
List<LogDetail> logDetailList = logDetailService.list(new LambdaQueryWrapper<LogDetail>()
.eq(LogDetail::getSummaryId, one.getId()));
Map<String, DetailJsonReq> map=new HashMap<>();
for (LogDetail logDetail:logDetailList){
String key=logDetail.getTypeId()+logDetail.getSizeId()+logDetail.getPrice()+logDetail.getProperty();
if (map.containsKey(key)){
DetailJsonReq detailJsonReq = map.get(key);
detailJsonReq.setNum(detailJsonReq.getNum()+1);
map.put(key,detailJsonReq);
}else {
DetailJsonReq detailJsonReq = new DetailJsonReq();
detailJsonReq.setNum(1);
detailJsonReq.setLocationName(one.getLocationName());
detailJsonReq.setLocationId(one.getLocationId());
detailJsonReq.setPrice(logDetail.getPrice());
detailJsonReq.setProperty(logDetail.getProperty());
map.put(key,detailJsonReq);
}
}
for (OrderDetail orderDetail:list) {
for (String key:map.keySet()) {
if (key.equals(orderDetail.getTypeId()+orderDetail.getSizeId()+orderDetail.getPrice()+orderDetail.getProperty())){
orderDetail.setDetailJson(JSONObject.toJSONString(map.get(key)));
}
}
}
orderMainService.updateById(existOrder); orderMainService.updateById(existOrder);
orderDetailService.updateBatchById(list);
MQDto mqDto = new MQDto(); MQDto mqDto = new MQDto();
mqDto.setApi("NormalToOrder"); mqDto.setApi("NormalToOrder");
mqDto.setType(existOrder.getOrderType().equals("in")?0:1); mqDto.setType(existOrder.getOrderType().equals("in")?0:1);
LogSummary one = logSummaryService.getOne(new LambdaQueryWrapper<LogSummary>() List<String> collect = logDetailList
.eq(LogSummary::getOrderMainId, existOrder.getId()));
List<String> collect = logDetailService.list(new LambdaQueryWrapper<LogDetail>()
.eq(LogDetail::getSummaryId, one.getId()))
.stream().map(LogDetail::getInventoryId) .stream().map(LogDetail::getInventoryId)
.collect(Collectors.toList()); .collect(Collectors.toList());
mqDto.setIdList(collect); mqDto.setIdList(collect);
......
...@@ -19,14 +19,14 @@ import liquibase.pro.packaged.S; ...@@ -19,14 +19,14 @@ import liquibase.pro.packaged.S;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@Mapper @Mapper
public interface InventoryMapper extends BaseMapper<Inventory> { public interface InventoryMapper extends BaseMapper<Inventory> {
List<Map<String, Object>> getLocationInventory(@Param("queryType")String queryType, @Param("idMsg")String idMsg);
//根据单警柜统计装备信息 //根据单警柜统计装备信息
boolean SetCabinetInventory(@Param("brokenNumberDays") Integer brokenNumberDays); boolean SetCabinetInventory(@Param("brokenNumberDays") Integer brokenNumberDays);
...@@ -98,6 +98,11 @@ public interface InventoryMapper extends BaseMapper<Inventory> { ...@@ -98,6 +98,11 @@ public interface InventoryMapper extends BaseMapper<Inventory> {
List<PeriodAndDateDto> GetByPeriodAndDate(@Param("req") InventoryReq req); List<PeriodAndDateDto> GetByPeriodAndDate(@Param("req") InventoryReq req);
List<Inventory> getEqsInfo(@Param("orgId") Long orgId,@Param("locationId") String locationId,
@Param("typeId") String typeId, @Param("sizeId")String sizeId,
@Param("price")BigDecimal price, @Param("warrantyPeriod")Integer warrantyPeriod,
@Param("startTime") Date startTime,@Param("endTime") Date endTime);
// IPage<InventoryDto> GetDetailByTerms(@Param("page") Page<Object> defaultPage, @Param("req") InventoryReq req); // IPage<InventoryDto> GetDetailByTerms(@Param("page") Page<Object> defaultPage, @Param("req") InventoryReq req);
......
...@@ -14,7 +14,10 @@ import com.junmp.jyzb.entity.InventorySummary; ...@@ -14,7 +14,10 @@ import com.junmp.jyzb.entity.InventorySummary;
import com.junmp.jyzb.entity.LogDetail; import com.junmp.jyzb.entity.LogDetail;
import com.junmp.jyzb.entity.LogSummary; import com.junmp.jyzb.entity.LogSummary;
import com.junmp.v2.db.api.page.PageResult; import com.junmp.v2.db.api.page.PageResult;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List; import java.util.List;
public interface InventoryService extends IService<Inventory> { public interface InventoryService extends IService<Inventory> {
...@@ -92,4 +95,5 @@ public interface InventoryService extends IService<Inventory> { ...@@ -92,4 +95,5 @@ public interface InventoryService extends IService<Inventory> {
PageResult<InventoryDto> EqsByState(InventoryReq req); PageResult<InventoryDto> EqsByState(InventoryReq req);
List<PeriodAndDateDto> GetByPeriodAndDate(InventoryReq req); List<PeriodAndDateDto> GetByPeriodAndDate(InventoryReq req);
} }
...@@ -237,7 +237,8 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm ...@@ -237,7 +237,8 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
inventory.setTypeId(eqsReq.getTypeId()); inventory.setTypeId(eqsReq.getTypeId());
inventory.setSizeId(eqsReq.getSizeId()); inventory.setSizeId(eqsReq.getSizeId());
inventory.setMaintenancePeriod(eqsReq.getMaintenancePeriod()); inventory.setMaintenancePeriod(eqsReq.getMaintenancePeriod());
inventory.setWarrantyPeriod(eqsReq.getWarranyPeriod()); inventory.setWarrantyPeriod(eqsReq.getWarrantyPeriod());
inventory.setProperty(eqsReq.getProperty());
inventory.setLocationId(eqsReq.getLocationId()); inventory.setLocationId(eqsReq.getLocationId());
inventory.setSupplierId(eqsReq.getSupplierId()); inventory.setSupplierId(eqsReq.getSupplierId());
inventory.setPrice(eqsReq.getPrice()); inventory.setPrice(eqsReq.getPrice());
...@@ -260,18 +261,19 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm ...@@ -260,18 +261,19 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
//3.处理出入库记录对象 //3.处理出入库记录对象
//判断出入库记录是否为空 //判断出入库记录是否为空
List<NormalInOutDto> normalInOutDtos=new ArrayList<>(); // List<NormalInOutDto> normalInOutDtos=new ArrayList<>();
boolean d=true;
if(ObjectUtil.isNotNull(req.getLogList()) && req.getLogList().size()>0){ if(ObjectUtil.isNotNull(req.getLogList()) && req.getLogList().size()>0){
// normalInOutDtos = saveInOutRecords(req); // normalInOutDtos = saveInOutRecords(req);
normalInOutDtos = saveInOutRecordsToRedis(req); d = saveInOutRecordsToRedis(req);
} }
//4.对日常出入库记录进行装备汇总统计 //4.对日常出入库记录进行装备汇总统计
boolean d=true; // boolean d=true;
if (normalInOutDtos.size()>0){ // if (normalInOutDtos.size()>0){
String outInState = normalInOutDtos.get(0).getOutInState(); // String outInState = normalInOutDtos.get(0).getOutInState();
d = updateNumToSum(outInState, normalInOutDtos); // d = updateNumToSum(outInState, normalInOutDtos);
} // }
return a && b && c && c1 && d; return a && b && c && c1 && d;
} }
...@@ -703,14 +705,14 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm ...@@ -703,14 +705,14 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
} }
public List<NormalInOutDto> saveInOutRecordsToRedis(OutInLogsReq req) { public boolean saveInOutRecordsToRedis(OutInLogsReq req) {
//返回结果,用于日常出入库时计算更新库存汇总表 //返回结果,用于日常出入库时计算更新库存汇总表
List<SummaryLogReq> logSummaryList = req.getLogList(); List<SummaryLogReq> logSummaryList = req.getLogList();
//遍历logSummaryList查询出没有单据的作为日常出入库,并再次存放到list中,后面用于进行修改库存汇总 //遍历logSummaryList查询出没有单据的作为日常出入库,并再次存放到list中,后面用于进行修改库存汇总
//返回returnList结果,用于日常出入库时计算更新库存汇总表 //返回returnList结果,用于日常出入库时计算更新库存汇总表
List<NormalInOutDto> returnList=new ArrayList<>(); // List<NormalInOutDto> returnList=new ArrayList<>();
//存一个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<>();
...@@ -773,17 +775,16 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm ...@@ -773,17 +775,16 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
List<LogDetailReq> detailReqList=new ArrayList<>(); List<LogDetailReq> detailReqList=new ArrayList<>();
for (DetailLogReq detailLogReq : logList) { for (DetailLogReq detailLogReq : logList) {
//将所有装备信息进行存放(为后面计算汇总信息) //将所有装备信息进行存放(为后面计算汇总信息)
if (logreq.getBussinessType().equals("normal")) { // if (logreq.getBussinessType().equals("normal")) {
NormalInOutDto normalInOutDto = new NormalInOutDto(); // NormalInOutDto normalInOutDto = new NormalInOutDto();
BeanPlusUtil.copyProperties(detailLogReq, normalInOutDto); // BeanPlusUtil.copyProperties(detailLogReq, normalInOutDto);
normalInOutDto.setLocationId(logSummary.getLocationId()); // normalInOutDto.setLocationId(logSummary.getLocationId());
normalInOutDto.setLocationName(logSummary.getLocationName()); // normalInOutDto.setLocationName(logSummary.getLocationName());
normalInOutDto.setOrgId(logSummary.getOrgId()); // normalInOutDto.setOrgId(logSummary.getOrgId());
normalInOutDto.setOrgName(logSummary.getOrgName()); // normalInOutDto.setOrgName(logSummary.getOrgName());
normalInOutDto.setNumber(1); // normalInOutDto.setNumber(1);
normalInOutDto.setOutInState(logSummary.getOutInState()); // normalInOutDto.setOutInState(logSummary.getOutInState());
returnList.add(normalInOutDto); // }
}
//判断logSummary是否为采购,快速移库,和领用出库 //判断logSummary是否为采购,快速移库,和领用出库
//如果是采购则不处理,因为采购的inventory是跟着单子来处理的,其他的单子直接根据出入库记录来处理 //如果是采购则不处理,因为采购的inventory是跟着单子来处理的,其他的单子直接根据出入库记录来处理
if (!logreq.getBussinessType().equals("purchase") && !logreq.getBussinessType().equals("quick") ){ if (!logreq.getBussinessType().equals("purchase") && !logreq.getBussinessType().equals("quick") ){
...@@ -935,7 +936,7 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm ...@@ -935,7 +936,7 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
} }
return returnList; return true;
} }
} }
......
...@@ -312,9 +312,10 @@ public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper,Warehouse> ...@@ -312,9 +312,10 @@ public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper,Warehouse>
temperatureRedisCache.addTemperatureHumidity(req.getWarehouseId(),warehouse.getName(), temperatureRedisCache.addTemperatureHumidity(req.getWarehouseId(),warehouse.getName(),
req.getCreateTime(),req.getHumidity(),req.getTemperature()); req.getCreateTime(),req.getHumidity(),req.getTemperature());
//更新仓库的温度和湿度 //更新仓库的温度和湿度
warehouse.setHumidity(req.getHumidity()); // warehouse.setHumidity(req.getHumidity());
warehouse.setTemperature(req.getTemperature()); // warehouse.setTemperature(req.getTemperature());
return updateById(warehouse); return true;
// return updateById(warehouse);
} }
//获取redis中的温湿度记录 //获取redis中的温湿度记录
......
...@@ -5,7 +5,7 @@ import cn.hutool.core.util.ObjectUtil; ...@@ -5,7 +5,7 @@ import cn.hutool.core.util.ObjectUtil;
import java.text.DateFormat; import java.text.DateFormat;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.LocalDate; import java.time.*;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
...@@ -110,4 +110,42 @@ public class DateTimeUtil { ...@@ -110,4 +110,42 @@ public class DateTimeUtil {
return date; return date;
} }
//将时分秒转成00:00:00
public static Date DaysToZero(Date time){
// 将Date转换为Instant
Instant instant = time.toInstant();
// 获取默认时区的ZonedDateTime对象
ZonedDateTime zonedDateTime = instant.atZone(ZoneId.systemDefault());
// 将ZonedDateTime转换为LocalDateTime对象
LocalDateTime dateTime = zonedDateTime.toLocalDateTime();
// 将时分秒部分设置为0
LocalDateTime newDateTime = dateTime.with(LocalTime.MIN);
// 将LocalDateTime转换为Date
Date newDate = Date.from(newDateTime.atZone(ZoneId.systemDefault()).toInstant());
return newDate;
}
//将时分秒转成23:59:59
public static Date setTimeToMax(Date time) {
// 将Date转换为Instant
Instant instant = time.toInstant();
// 获取默认时区的ZonedDateTime对象
ZonedDateTime zonedDateTime = instant.atZone(ZoneId.systemDefault());
// 将ZonedDateTime转换为LocalDateTime对象
LocalDateTime dateTime = zonedDateTime.toLocalDateTime();
// 将时分秒部分设置为23:59:59
LocalDateTime newDateTime = dateTime.with(LocalTime.MAX);
// 将LocalDateTime转换为Date
Date newDate = Date.from(newDateTime.atZone(ZoneId.systemDefault()).toInstant());
return newDate;
}
} }
\ No newline at end of file
...@@ -38,38 +38,6 @@ ...@@ -38,38 +38,6 @@
</sql> </sql>
<select id="getLocationInventory" resultType="Map">
select
id,
<if test="queryType == 'org'">
org_id_int as locationId,
</if>
<if test="queryType == 'warehouse' or queryType == 'cabinet'">
location_id as locationId,
</if>
<if test="queryType == 'org'">
org_name as locationName,
</if>
<if test="queryType == 'warehouse' or queryType == 'cabinet'">
location_name as locationName,
</if>
type_id as typeId,
type_name as typeName,
size_id as sizeId,
size_name as sizeName,
number,
price,
stock_number as stockNumber,
outbound_number as outboundNumber
from base_inventory_summary
<if test="queryType == 'org'">
where org_id_int = #{idMsg}
</if>
<if test="queryType == 'warehouse' or queryType == 'cabinet'">
where location_id = #{idMsg}
</if>
</select>
<insert id="SetCabinetInventory"> <insert id="SetCabinetInventory">
...@@ -554,40 +522,7 @@ ...@@ -554,40 +522,7 @@
limit ${item[2]},${item[3]} limit ${item[2]},${item[3]}
</foreach> </foreach>
</select> </select>
<!-- <select id="GetDetailByTerms" resultType="com.junmp.jyzb.api.bean.dto.InventoryDto">-->
<!-- </select>-->
<!--&lt;!&ndash; <select id="alignInventoryInfo" resultType="com.junmp.jyzb.api.bean.dto.FetchingDataDto.EquipmentDto"&ndash;&gt;-->
<!--&lt;!&ndash; parameterType="com.junmp.jyzb.api.bean.query.InventoryReq">&ndash;&gt;-->
<!-- SELECT i.id,i.package_id,i.type_id,i.size_id,i.supplier_id,i.epc,-->
<!-- i.org_id_int as org_id,i.state as equ_state,i.bussiness_state,i.location_state as state,-->
<!-- i.production_date,i.warranty_period,i.maintenance_period,i.fix_count,i.location_id,i.location_type,i.lost_flag,-->
<!-- i.price,i.create_time,i.update_time,i.note,es.name as size_name,et.name as type_name,bs.name as supplier_name, bw.name as location_name-->
<!--&lt;!&ndash; FROM `base_inventory` i&ndash;&gt;-->
<!-- join base_equipment_size es on i.size_id=es.id-->
<!-- join base_equipment_type et on i.type_id=et.id-->
<!-- join base_warehouse bw on bw.id=i.location_id-->
<!-- join base_supplier bs on bs.id=i.supplier_id-->
<!--&lt;!&ndash; where i.org_id_int=#{orgId}&ndash;&gt;-->
<!-- <if test="locationId!= null and locationId != ''">-->
<!-- and i.location_id=#{locationId}-->
<!-- </if>-->
<!-- <if test="date!= null and date != ''">-->
<!-- and i.update_time &gt; #{date}-->
<!-- </if>-->
<!-- <if test="typeIdList != null and typeIdList.size()>0">-->
<!-- and type_id in-->
<!-- <foreach collection="typeIdList" item="item" open="(" separator="," close=")">-->
<!-- #{item}-->
<!-- </foreach>-->
<!-- </if>-->
<!-- <if test="sizeIdList != null and sizeIdList.size()>0">-->
<!-- and size_id in-->
<!-- <foreach collection="sizeIdList" item="item" open="(" separator="," close=")">-->
<!-- #{item}-->
<!-- </foreach>-->
<!-- </if>-->
<!-- </select>-->
<select id="alignInventoryInfo" resultType="com.junmp.jyzb.api.bean.dto.FetchingDataDto.EquipmentDto" <select id="alignInventoryInfo" resultType="com.junmp.jyzb.api.bean.dto.FetchingDataDto.EquipmentDto"
parameterType="com.junmp.jyzb.api.bean.query.InventoryReq"> parameterType="com.junmp.jyzb.api.bean.query.InventoryReq">
...@@ -708,7 +643,7 @@ ...@@ -708,7 +643,7 @@
</select> </select>
<select id="GetByPeriodAndDate" resultType="com.junmp.jyzb.api.bean.PeriodAndDateDto"> <select id="GetByPeriodAndDate" resultType="com.junmp.jyzb.api.bean.PeriodAndDateDto">
select count(*) as zkCount,location_id,max(location_name) as location_name,warranty_period,production_date,price,org_id FROM( select count(*) as zkCount,location_id,max(location_name) as location_name,warranty_period,production_date,price as unit_price,org_id FROM(
SELECT a.*,b.warranty_period,b.production_date,b.price FROM SELECT a.*,b.warranty_period,b.production_date,b.price FROM
(SELECT org_id,size_id,type_id,location_id,epc,location_name FROM `base_warehouse_inventory` wi (SELECT org_id,size_id,type_id,location_id,epc,location_name FROM `base_warehouse_inventory` wi
where org_id=#{req.orgId} and type_id=#{req.typeId} where org_id=#{req.orgId} and type_id=#{req.typeId}
...@@ -742,6 +677,21 @@ ...@@ -742,6 +677,21 @@
</if> </if>
</select> </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,
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
FROM base_warehouse_inventory wi
LEFT JOIN base_inventory i ON i.epc = wi.epc
WHERE wi.org_id=#{orgId} and wi.type_id=#{typeId}
and wi.location_type=0
and wi.location_id =#{locationId}
and i.location_state = "in"
and wi.size_id=#{sizeId}
and i.price=#{price}
and i.warranty_period=#{warrantyPeriod}
and i.production_date >= #{startTime} and i.production_date &lt; #{endTime}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -316,7 +316,7 @@ ...@@ -316,7 +316,7 @@
<select id="selectSum" resultType="com.junmp.jyzb.entity.InventorySummary"> <select id="selectSum" resultType="com.junmp.jyzb.entity.InventorySummary">
select id,valuekey,org_id_int as org_id,org_name,org_code,type_id,type_name,size_id,size_name,location_id,location_name,location_type, select id,valuekey,org_id_int as org_id,org_name,org_code,type_id,type_name,size_id,size_name,location_id,location_name,location_type,
number,unit_price,price,stock_number,outbound_number,destruction_price,destruction_number,expire_number,expire_price, number,unit_price,price,stock_number,outbound_number,destruction_price,destruction_number,expire_number,expire_price,
broken_price,broken_number,near_broken_price,near_broken_number,use_number,agent_broken_num,fix_count,use_count,create_time,update_time,threshold,property broken_price,broken_number,fix_price,fix_number,use_number,agent_broken_num,fix_count,use_count,create_time,update_time,threshold,property
from base_inventory_summary where from base_inventory_summary where
<foreach collection="list" item="item" separator="or"> <foreach collection="list" item="item" separator="or">
( (
......
...@@ -36,7 +36,7 @@ knife4j: ...@@ -36,7 +36,7 @@ knife4j:
spring: spring:
datasource: datasource:
driver-class-name: com.mysql.cj.jdbc.Driver 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?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&nullCatalogMeansCurrent=true
username: root username: root
password: 123456 password: 123456
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论