Commit b413bd27 by 赵剑炜

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

# Conflicts:
#	jyzb-biz/src/main/resources/mapper/InventorySummaryMapper.xml
parents 66bfb3f0 7952b8c4
......@@ -1403,7 +1403,7 @@ Was expecting one of:
at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:77)
at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$PlainMethodInvoker.invoke(MybatisMapperProxy.java:148)
at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89)
at com.sun.proxy.$Proxy273.GetDetailByTerms(Unknown Source)
at com.sun.proxy.$Proxy273.s(Unknown Source)
at com.junmp.jyzb.service.impl.InventoryServiceImpl.GetDetailByTerms(InventoryServiceImpl.java:305)
at com.junmp.jyzb.service.impl.InventoryServiceImpl$$FastClassBySpringCGLIB$$43c51e0c.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
......
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.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -117,5 +117,6 @@ public class LogDetailReq {
private String userName;
private Long orgId;
private Integer property;
}
package com.junmp.jyzb.controller;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.junmp.jyzb.entity.Inventory;
import com.junmp.jyzb.entity.InventorySummary;
import com.junmp.jyzb.service.EquipmentTypeService;
import com.junmp.jyzb.service.InventoryService;
import com.junmp.jyzb.service.InventorySummaryService;
import com.junmp.v2.common.bean.response.ApiRes;
import com.junmp.v2.db.api.factory.PageFactory;
import com.junmp.v2.dict.entity.SysDictItem;
import com.junmp.v2.dict.service.SysDictItemService;
import com.junmp.v2.message.api.MessageApi;
import com.junmp.v2.message.api.bean.req.MessageReq;
import com.junmp.v2.message.api.bean.req.MessageSendReq;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@RestController
@Api("消息推送")
@RequestMapping("/MessageSend")
@Slf4j
public class MessageSendController {
@Resource
private InventoryService inventoryService;
@Resource
private InventorySummaryService inventorySummaryService;
@Resource
private EquipmentTypeService equipmentTypeService;
@Resource
private MessageApi messageApi;
@Resource
private SysDictItemService sysDictItemService;
// MessageSendReq sendReq = new MessageSendReq();
// sendReq.setSendUserId("1000");
// sendReq.setReceiveUserIds(userIds);
// sendReq.setMsgTitle(msgtTitle);
// sendReq.setBizType(bizType);
// sendReq.setMsgContent(msgContent);
// sendReq.setPriority("0");
// sendReq.setSendTime(DateTime.now());
// messageApi.sendMessage(sendReq);
// messageApi.queryCount(new MessageReq());
// /*推送发送未读数量*/
// for(Long userId :userIdList){
// MessageReq req1 = new MessageReq();
// req1.setReadFlag(0);
// req1.setReceiveUserId(userId);
// Integer count1 = messageApi.queryCount(req1);
// messageApi.pushMsgToUser(String.valueOf(userId),count1);
//消息推送场景1:物资低于物资阈值
// @PostMapping("/aaa")
// public ApiRes<Boolean> action1() {
//获取装备信息汇总,并且判断装备的汇总数量是否低于装备阈值,如果低于装备阈值,则进行消息提醒
//所有待判断的物资
// LambdaQueryWrapper<InventorySummary> wrapper = new LambdaQueryWrapper<InventorySummary>()
// .eq(InventorySummary::getLocationType, 0);
// //分页参数
// int pageSize=1000;
// int currentPage=1;
// //获取装备的所有库存数量
// long termCount= inventorySummaryService.count(wrapper);
// List<InventorySummary> list=new ArrayList<>();
// if (termCount>0) {
// // 分页查询
// while ((currentPage - 1) * pageSize < termCount) {
// List<InventorySummary> inventorySummaryList = processPageData1(currentPage, pageSize);
// currentPage++;
// list.addAll(inventorySummaryList);
// }
// }
// //超期物资查询出来之后,将超期物资进行消息推送提醒
// //直接对list进行处理操作推送消息即可
// for (InventorySummary inventorySummary:list) {
// MessageSendReq sendReq = new MessageSendReq();
// sendReq.setSendUserId("1000");
// sendReq.setReceiveUserIds("1000");
// sendReq.setMsgTitle("物资低于阈值");
// //设置业务类型
// SysDictItem one = sysDictItemService.getOne(new LambdaQueryWrapper<SysDictItem>()
// .eq(SysDictItem::getDictItemId, "1698969902300176385"));
// sendReq.setBizType(one.getItemValue());
// sendReq.setMsgContent(inventorySummary.getLocationName()+"仓库下的"+inventorySummary.getTypeName()+",号型为:"+inventorySummary.getSizeName()+"的物资低于阈值");
// sendReq.setPriority("0");
// sendReq.setSendTime(DateTime.now());
// messageApi.sendMessage(sendReq);
// }
// messageApi.queryCount(new MessageReq());
// /*推送发送未读数量*/
// List<Long> userIdList=new ArrayList<>();
// userIdList.add(1000L);
// for(Long userId :userIdList){
// MessageReq req1 = new MessageReq();
// req1.setReadFlag(0);
// req1.setReceiveUserId(userId);
// Integer count1 = messageApi.queryCount(req1);
// messageApi.pushMsgToUser(String.valueOf(userId),count1);
// }
// return ApiRes.success(true);
// }
// // 处理每页数据
// private List<InventorySummary> processPageData1(long pageSize, long currentPage) {
// //得到全局默认值(随机处理数据表中的一条数据为默认值)
// Integer threshold = equipmentTypeService.getById(100001).getThreshold();
// //查询inventory_summary表中的threshold字段是否存在值,
// // 如果存在则用summary表中的字段进行比较物资阈值,如果不存在则默认使用全局物资阈值进行比较
// LambdaQueryWrapper<InventorySummary> wrapper = new LambdaQueryWrapper<InventorySummary>()
// .eq(InventorySummary::getLocationType, 0);
// Page<InventorySummary> page = inventorySummaryService.page(PageFactory.getDefaultPage(pageSize, currentPage),wrapper);
// List<InventorySummary> records = page.getRecords();
// //使用自定义物资阈值进行比较
// List<InventorySummary> collect1 = records.stream()
// .filter(data -> ObjectUtil.isNotNull(data.getThreshold()))
// .filter(data -> data.getNumber() <= data.getThreshold())
// .collect(Collectors.toList());
// //使用全局物资阈值进行比较
// List<InventorySummary> collect2 = records.stream()
// .filter(data -> data.getNumber() <= threshold && ObjectUtil.isNull(data.getThreshold()))
// .collect(Collectors.toList());
// //将数据存储到一个list中
// List<InventorySummary> inventorySummaryList=new ArrayList<>();
// inventorySummaryList.addAll(collect1);
// inventorySummaryList.addAll(collect2);
// return inventorySummaryList;
// }
//消息推送场景2:物资超期
//消息推送场景3:过质保期
@PostMapping("/ccc")
public void action3() {
// LambdaQueryWrapper<Inventory> wrapper = new LambdaQueryWrapper<>();
// // 分页参数
// int pageSize = 1000; // 每页记录数,可以根据需求调整
// int currentPage = 1; // 当前页数
//
// //所有待判断的物资
// wrapper.eq( Inventory::getTermState, 0);
// //获取未超期的物资数量(并且他的state不是销毁状态)
// long termCount= inventoryService.count(wrapper);
// List<Inventory> list=new ArrayList<>();
// if (termCount>0) {
// // 分页查询
// while ((currentPage - 1) * pageSize < termCount) {
// List<Inventory> inventoryList = processPageData3(currentPage, pageSize);
// currentPage++;
// list.addAll(inventoryList);
// }
// }
// System.out.println(list);
// //超期物资查询出来之后,将超期物资进行消息推送提醒
// //直接对list进行处理操作推送消息即可
}
// 处理每页数据
private List<Inventory> processPageData3(long pageSize, long currentPage)
{
LocalDate localdate =LocalDate.now();
// 使用LambdaQueryWrapper构建查询条件
LambdaQueryWrapper<Inventory> wrapper = Wrappers.lambdaQuery();
wrapper.eq( Inventory::getTermState, 0);
//如果 生产日期 < 当前日期减去质保数,表示该装备已经超过质保期
wrapper.apply("production_date <= DATE_SUB({0}, INTERVAL warranty_period DAY)", "1970-03-01 00:00:00");
//获取过质保期的物资信息
List<Inventory> page= inventoryService.page(PageFactory.getDefaultPage(pageSize,currentPage),wrapper).getRecords();
page.forEach(o->o.setTermState(1));
inventoryService.saveOrUpdateBatch(page);
return page;
}
}
......@@ -153,12 +153,18 @@ public class PublicController {
}
@PostMapping(path = "/updateMessage",name = "更新消息#logType30")
@PostMapping(path = "/updateMessage",name = "更新消息#logType=30")
@ApiOperation("更新消息")
public ApiRes<Boolean> updateMessage(@RequestBody MessageReq req){
return ApiRes.success(publicService.updateMessage(req));
}
@PostMapping(path = "/setReadMessage",name = "将消息设置为已读状态#logType=30")
@ApiOperation("将消息设置为已读状态")
public ApiRes<Boolean> setReadMessage(@RequestBody MessageReq req){
return ApiRes.success(publicService.setReadMessage(req));
}
@PostMapping("/aaa")
public ApiRes<List<Object>> aaa(@RequestBody OrderMainReq req){
......
......@@ -18,4 +18,5 @@ public interface PublicService {
boolean updateMessage(MessageReq req);
boolean setReadMessage(MessageReq req);
}
......@@ -902,10 +902,9 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
}
//前端传递的子单数据
List<UpdateOrderDetailReq> reqList = req.getDetailList();
//将记账数量进行相加
Integer updateQuantity=0;
//将价格进行添加修改
BigDecimal priceTotal=new BigDecimal(0);
//获取子单据
List<OrderDetail> list = orderDetailService.list(new LambdaQueryWrapper<OrderDetail>()
.eq(OrderDetail::getOrderId,req.getId()));
......@@ -929,12 +928,33 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
List<WarehouseInventory> addWareInvList=new ArrayList<>();
//编辑装备(出库)
List<Inventory> updateInvList=new ArrayList<>();
//用于判断是否是空账
boolean flag=false;
//遍历子单
for (UpdateOrderDetailReq uploadDetailReq : reqList) {
OrderDetail orderDetail = new OrderDetail();
BeanPlusUtil.copyProperties(uploadDetailReq,orderDetail);
//记空账(识别0,记账0)
if (uploadDetailReq.getActualNum()==0 && uploadDetailReq.getModifyQuantity()==0){
//添加出入库日志记录
if (orderMain.getOrderType().equals("in")){
s = s+uploadDetailReq.getTypeName()+"【"+
uploadDetailReq.getSizeName()+"】,单价:"+uploadDetailReq.getPrice()
+",数量实入:0,记账:0"+"\n";
}else {
s = s+uploadDetailReq.getTypeName()+"【"+
uploadDetailReq.getSizeName()+"】,单价:"+uploadDetailReq.getPrice()
+",数量实出:0,记账:0"+"\n";
}
orderDetail.setModifyQuantity(uploadDetailReq.getModifyQuantity());
orderDetail.setUpdateTime(DateTimeUtil.getCurrentDateTime());
orderDetailList.add(orderDetail);
updateQuantity+=orderDetail.getModifyQuantity();
continue;
}
flag=true;
List<DetailJsonReq> JsonList = uploadDetailReq.getChildJson();
String jsonString = JSONObject.toJSONString(JsonList);
orderDetail.setDetailJson(jsonString);
......@@ -945,7 +965,6 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
if (ObjectUtil.isNull(uploadDetailReq.getModifyQuantity())){
throw new ServiceException(OrderExceptionEnum.ORDER_NUM_IS_NULL);
}
if (uploadDetailReq.getModifyQuantity() >= 0 ){
//遍历子单据下面的详细记账信息
......@@ -1089,6 +1108,18 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
throw new ServiceException(OrderExceptionEnum.ORDERDETAIL_ERROR);
}
}
//记账0
if (!flag){
orderMain.setActualQuantity(updateQuantity);
orderMain.setOrderState("finished");
//修改记账状态,0未记账,1已记账
orderMain.setManualState(1);
orderMain.setUpdateTime(DateTimeUtil.getCurrentDateTime());
boolean a = orderDetailService.updateBatchById(orderDetailList);
boolean b = updateById(orderMain);
boolean c = saveAccountingLog(req, s, updateQuantity);
return a && b && c;
}
//入库添加虚拟装备
if (CollectionUtil.isNotEmpty(addInvList)){
......@@ -1108,14 +1139,15 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
LogDetailReq logDetailReq = new LogDetailReq();
BeanPlusUtil.copyProperties(inv,logDetailReq);
logDetailReq.setOutInState(req.getOrderType());
logDetailReq.setBussinessType(orderMain.getBussinessType());
logDetailReq.setCreateTime(DateTimeUtil.getCurrentDateTime());
if (CollectionUtil.isEmpty(logDetailList)) {
lsReq.setLogList(new ArrayList<>());
logDetailList = lsReq.getLogList();
}
logDetailList.add(logDetailReq);
LogSummaryReq logSummaryReq = logMap.get(inv.getLocationId());
logSummaryReq.setLogList(logDetailList);
logMap.put(inv.getLocationId(),logSummaryReq);
lsReq.setLogList(logDetailList);
logMap.put(inv.getLocationId(),lsReq);
}
}
//出库记账logDetail
......@@ -1127,15 +1159,15 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
LogDetailReq logDetailReq = new LogDetailReq();
BeanPlusUtil.copyProperties(inv,logDetailReq);
logDetailReq.setOutInState(req.getOrderType());
logDetailReq.setBussinessType(orderMain.getBussinessType());
logDetailReq.setCreateTime(DateTimeUtil.getCurrentDateTime());
if (CollectionUtil.isEmpty(logDetailList)) {
lsReq.setLogList(new ArrayList<>());
logDetailList = lsReq.getLogList();
}
logDetailList.add(logDetailReq);
LogSummaryReq logSummaryReq = logMap.get(inv.getLocationId());
logSummaryReq.setLogList(logDetailList);
logMap.put(inv.getLocationId(),logSummaryReq);
lsReq.setLogList(logDetailList);
logMap.put(inv.getLocationId(),lsReq);
}
}
//出库更新装备状态和出库状态
......
......@@ -203,7 +203,7 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
}
//判断警员编号是否已经存在
List<Policeman> list = list(new LambdaQueryWrapper<Policeman>().eq(Policeman::getPoliceCode, req.getPoliceCode())
.eq(Policeman::getIdentity, req.getIdentity()));
.eq(Policeman::getIdentity, req.getIdentity()).or().eq(Policeman::getName, req.getName()));
if (CollectionUtil.isNotEmpty(list)){
throw new ServiceException(PolicemanExceptionEnum.POLICECODE_IS_EXISTS);
}
......@@ -230,7 +230,7 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
policeman.setState(1);
policeman.setUserId(sysUser.getUserId());
//如果有照片,将警员照片直接复制一下以防万一
policeman.setPhoto(req.getFaceInfo());
policeman.setPhoto(req.getPhoto());
policeman.setCreateTime(DateTimeUtil.getCurrentDateTime());
policeman.setUpdateTime(DateTimeUtil.getCurrentDateTime());
save(policeman);
......@@ -605,7 +605,7 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
throw new ServiceException(PolicemanExceptionEnum.POLICECODE_IS_EXISTS);
}
}
one.setPhoto(req.getFaceInfo());
one.setPhoto(req.getPhoto());
one.setUpdateTime(DateTimeUtil.getCurrentDateTime());
SysUser user= sysUserService.getById(req.getUserId());
user.setPassword(req.getPassword());
......@@ -1545,13 +1545,9 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
.eq(CabinetBoxPolice::getPoliceId,policeman.getId()));
//判断前端传递的装备列表字段是否为空,如果为空则表示该警员不拿走任何装备信息(不做任何操作)
if (ObjectUtil.isNull(req.getDetailList()) || req.getDetailList().trim().isEmpty()){
// if (list1.size()>0){
//// policeEquipmentService.remove(eq);
// policeEquipmentService.removeBatchByIds(list1);
// }
if (ObjectUtil.isNotNull(req.getDetailList()) || !req.getDetailList().trim().isEmpty()){
} else {//将该警员拿走的装备的组织机构设置为空,并且其他装备进行跟警员进行解绑删除
//将该警员拿走的装备的组织机构设置为空,并且其他装备进行跟警员进行解绑删除
List<PoliceEquipment> removeList=new ArrayList<>();
//更新装备(将装备信息进行删除)
List<PoliceEquipment> updateList=new ArrayList<>();
......@@ -1584,26 +1580,7 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
policeEquipmentService.updateBatchById(updateList);
policeEquipmentService.removeBatchByIds(removeList);
// if (searchItem.size()>0)
// {
// //修改库存数量
// List<InventorySummary> inventorySummaryList = inventorySummaryMapper.selectSumByItems(searchItem);
// List<InventorySummary> updateSummaryList=new ArrayList<>();
// for (InventorySummary is:inventorySummaryList) {
// for ( Object[] one: searchItem) {
// if (is.getLocationId().equals(one[1]) && is.getTypeId().equals(one[2])
// && is.getSizeId().equals(one[3]) && is.getUnitPrice().compareTo(new BigDecimal(one[4].toString()))==0){
// is.setOutboundNumber(is.getOutboundNumber()-Integer.parseInt(one[5].toString()));
// is.setNumber(is.getNumber()-Integer.parseInt(one[5].toString()));
// updateSummaryList.add(is);
// break;
// }
// }
// }
// if (updateSummaryList.size()>0){
// inventorySummaryService.updateBatchById(updateSummaryList);
// }
// }
}
//记录日志(如果警员携带装备,则进行记录 )
if (ObjectUtil.isNotNull(reqEquipments)){
......
......@@ -5,6 +5,7 @@ import cn.hutool.core.date.DateTime;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.junmp.junmpProcess.dto.json.UserInfo;
import com.junmp.jyzb.service.PublicService;
......@@ -119,4 +120,16 @@ public class PublicServiceImpl implements PublicService {
return true;
}
@Override
@Transactional(rollbackFor = Exception.class)
public boolean setReadMessage(MessageReq req) {
List<Long> msgIdList = req.getMsgIdList();
List<SysMessage> list = sysMessageService.list(new LambdaQueryWrapper<SysMessage>().in(SysMessage::getMsgId, msgIdList));
List<Long> collect = list.stream().map(SysMessage::getBizId).collect(Collectors.toList());
List<SysMessage> list1 = sysMessageService.list(new LambdaQueryWrapper<SysMessage>().in(SysMessage::getBizId, collect));
return sysMessageService.update(new LambdaUpdateWrapper<SysMessage>()
.set(SysMessage::getReadFlag, 1)
.in(SysMessage::getBizId, list1));
}
}
......@@ -570,7 +570,8 @@
(
sum( CASE WHEN `base_inventory_summary`.`location_type` = 0 THEN `base_inventory_summary`.`stock_number` ELSE 0 END ) +
sum( CASE WHEN `base_inventory_summary`.`location_type` = 0 THEN `base_inventory_summary`.`outbound_number` ELSE 0 END ) +
sum( CASE WHEN `base_inventory_summary`.`location_type` = 0 THEN `base_inventory_summary`.`destruction_number` ELSE 0 END )
sum( CASE WHEN `base_inventory_summary`.`location_type` = 1 THEN `base_inventory_summary`.`stock_number` ELSE 0 END )+
sum( CASE WHEN `base_inventory_summary`.`location_type` = 1 THEN `base_inventory_summary`.`stock_number` ELSE 0 END )
) AS total_number,
sum( CASE WHEN ( `base_inventory_summary`.`location_type` = 0 ) THEN `base_inventory_summary`.`stock_number` ELSE 0 END ) AS `ck_stock_number`,
sum( CASE WHEN ( `base_inventory_summary`.`location_type` = 0 ) THEN `base_inventory_summary`.`outbound_number` ELSE 0 END ) AS `ck_outbound_number`,
......@@ -759,68 +760,61 @@
<select id="selectSumByItemsCount" resultType="java.lang.Integer"
parameterType="com.junmp.jyzb.api.bean.query.InventoryReq">
select count(*) from (
SELECT 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.supplier_id,i.price,i.state,i.bussiness_state,
i.production_date,i.warranty_period,i.maintenance_period, i.term_state,
i.area_id,et.name as type_name,es.name as size_name,po.org_name as org_name,
bs.name as supplier_name,COALESCE(bc.name, bw.name) as location_name,
es.photo as photo,es.instructions as instructions
FROM base_warehouse_inventory wi
LEFT JOIN base_inventory i ON i.epc = wi.epc
LEFT JOIN base_equipment_type et ON et.id = i.type_id
LEFT JOIN base_equipment_size es ON es.id = i.size_id
LEFT JOIN pub_org po ON i.org_id_int = po.org_id
LEFT JOIN base_supplier bs ON bs.id = i.supplier_id
LEFT JOIN base_cabinet_box bcb ON i.location_id = bcb.id AND i.location_type = 1
LEFT JOIN base_cabinet bc ON bcb.cabinet_id = bc.id
LEFT JOIN base_warehouse bw ON i.location_id = bw.id AND i.location_type = 0
WHERE wi.org_id=#{req.orgId} and wi.type_id=#{req.typeId}
<if test="req.locationType !='all' and req.locationType != null">
and wi.location_type=#{req.locationType}
</if>
<if test="req.warehouseId != null and req.warehouseId != ''">
and wi.location_id =#{req.warehouseId}
</if>
<if test="req.termState!= -1">
and i.term_state=#{req.termState}
</if>
<if test="req.locationState!='all' and req.locationState !=null and req.locationState!=''">
and i.location_state=#{req.locationState}
</if>
<if test="req.sizeId !=null and req.sizeId != ''">
and wi.size_id=#{req.sizeId}
</if>
<if test="req.price !=null and req.price != ''">
and i.price=#{req.price}
</if>
<if test="req.warrantyPeriod != null and req.warrantyPeriod != ''">
and i.warranty_period=#{req.warrantyPeriod}
</if>
<if test="req.maintenancePeriod != null and req.maintenancePeriod != ''">
and i.maintenance_period=#{req.maintenancePeriod}
</if>
ORDER BY wi.type_id,i.size_id
SELECT wi.type_id,wi.size_id,wi.shelf_id,wi.shelf_location, wi.epc,wi.org_id,wi.location_state,wi.location_name,wi.type_name,wi.size_name,wi.org_name,
wi.location_type,wi.location_id,i.id,i.supplier_id,i.price,i.state,i.bussiness_state,
i.production_date,i.warranty_period,i.maintenance_period, i.term_state,i.property,
i.area_id,
bs.name as supplier_name,
(select instructions FROM base_equipment_type where id=#{req.typeId}) as instructions,
(select photo FROM base_equipment_type where id=#{req.typeId}) as type_photo,
es.photo as size_photo
FROM base_warehouse_inventory wi
LEFT JOIN base_inventory i ON i.epc = wi.epc
LEFT JOIN base_equipment_size es ON wi.size_id = es.id
LEFT JOIN base_supplier bs ON bs.id = i.supplier_id
WHERE wi.org_id=#{req.orgId} and wi.type_id=#{req.typeId} and i.state !="destory"
<if test="req.locationType !='all' and req.locationType != null">
and wi.location_type=#{req.locationType}
</if>
<if test="req.locationId != null and req.locationId != ''">
and wi.location_id =#{req.locationId}
</if>
<if test="req.termState!= -1">
and i.term_state=#{req.termState}
</if>
<if test="req.locationState!='all' and req.locationState !=null and req.locationState!=''">
and i.location_state=#{req.locationState}
</if>
<if test="req.sizeId !=null and req.sizeId != ''">
and wi.size_id=#{req.sizeId}
</if>
<if test="req.price !=null and req.price != ''">
and i.price=#{req.price}
</if>
<if test="req.warrantyPeriod != null and req.warrantyPeriod != ''">
and i.warranty_period=#{req.warrantyPeriod}
</if>
<if test="req.maintenancePeriod != null and req.maintenancePeriod != ''">
and i.maintenance_period=#{req.maintenancePeriod}
</if>
ORDER BY wi.type_id,i.size_id
) as a
</select>
<select id="GetDetailByTerms" resultType="com.junmp.jyzb.api.bean.dto.InventoryDto">
SELECT 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.supplier_id,i.price,i.state,i.bussiness_state,
i.production_date,i.warranty_period,i.maintenance_period, i.term_state,i.property,
i.area_id,et.name as type_name,es.name as size_name,po.org_name as org_name,
bs.name as supplier_name,COALESCE(bc.name, bw.name) as location_name,
es.photo as photo,es.instructions as instructions,et.photo as type_photo,es.photo as size_photo
SELECT wi.type_id,wi.size_id,wi.shelf_id,wi.shelf_location, wi.epc,wi.org_id,wi.location_state,wi.location_name,wi.type_name,wi.size_name,wi.org_name,
wi.location_type,wi.location_id,i.id,i.supplier_id,i.price,i.state,i.bussiness_state,
i.production_date,i.warranty_period,i.maintenance_period, i.term_state,i.property,
i.area_id,
bs.name as supplier_name,
(select instructions FROM base_equipment_type where id=#{req.typeId}) as instructions,
(select photo FROM base_equipment_type where id=#{req.typeId}) as type_photo,
es.photo as size_photo
FROM base_warehouse_inventory wi
LEFT JOIN base_inventory i ON i.epc = wi.epc
LEFT JOIN base_equipment_type et ON et.id = i.type_id
LEFT JOIN base_equipment_size es ON es.id = i.size_id
LEFT JOIN pub_org po ON i.org_id_int = po.org_id
LEFT JOIN base_equipment_size es ON wi.size_id = es.id
LEFT JOIN base_supplier bs ON bs.id = i.supplier_id
LEFT JOIN base_cabinet_box bcb ON i.location_id = bcb.id AND i.location_type = 1
LEFT JOIN base_cabinet bc ON bcb.cabinet_id = bc.id
LEFT JOIN base_warehouse bw ON i.location_id = bw.id AND i.location_type = 0
WHERE wi.org_id=#{req.orgId} and wi.type_id=#{req.typeId}
WHERE wi.org_id=#{req.orgId} and wi.type_id=#{req.typeId} and i.state !="destory"
......@@ -858,8 +852,8 @@
<if test="req.locationType !='all' and req.locationType != null">
and wi.location_type=#{req.locationType}
</if>
<if test="req.warehouseId != null and req.warehouseId != ''">
and wi.location_id =#{req.warehouseId}
<if test="req.locationId != null and req.locationId != ''">
and wi.location_id =#{req.locationId}
</if>
<if test="req.termState!= -1">
and i.term_state=#{req.termState}
......@@ -879,7 +873,6 @@
<if test="req.maintenancePeriod != null and req.maintenancePeriod != ''">
and i.maintenance_period=#{req.maintenancePeriod}
</if>
ORDER BY wi.type_id,i.size_id
<if test="pageNo != null and pageNo != '' and pageSize != null and pageSize != '' ">
limit #{pageNo},#{pageSize}
......
......@@ -36,13 +36,13 @@ knife4j:
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
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
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
username: root
password: 123456
redis:
#host: 192.168.3.188
host: 192.168.3.121
host: 192.168.3.188
port: 6379
database: 1
password:
......
......@@ -33,7 +33,7 @@ spring:
virtual-host: /
profiles:
#@spring.active@
active: local
active: prod
servlet:
multipart:
max-request-size: 500MB
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论