Commit 42445e73 by 李小惠

修改bug

parent a4aef99f
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.
...@@ -168,6 +168,11 @@ public class WarehouseController { ...@@ -168,6 +168,11 @@ public class WarehouseController {
return ApiRes.success(warehouseService.updateHumidityAndtemperature(req)); return ApiRes.success(warehouseService.updateHumidityAndtemperature(req));
} }
@PostMapping(path = "GetWareHouseInfoByRedis",name = "从redis中获取仓库的信息温度湿度#enable")
@ApiOperation("从redis获取仓库温度和湿度")
public ApiRes<Warehouse> GetWareHouseInfoByRedis(@RequestBody @Validated(WarehouseReq.detail.class)WarehouseReq req){
return ApiRes.success(warehouseService.GetWareHouseInfoByRedis(req));
}
} }
...@@ -9,8 +9,10 @@ import com.alibaba.fastjson.TypeReference; ...@@ -9,8 +9,10 @@ import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.junmp.junmpProcess.dto.UserListDTO;
import com.junmp.junmpProcess.dto.json.ChildNode; import com.junmp.junmpProcess.dto.json.ChildNode;
import com.junmp.junmpProcess.dto.json.UserInfo; import com.junmp.junmpProcess.dto.json.UserInfo;
import com.junmp.junmpProcess.mapper.OrgUserMapper;
import com.junmp.junmpProcess.utils.RabbitMQUtils2; import com.junmp.junmpProcess.utils.RabbitMQUtils2;
//import com.rabbitmq.client.Channel; //import com.rabbitmq.client.Channel;
//import com.rabbitmq.client.Connection; //import com.rabbitmq.client.Connection;
...@@ -34,9 +36,12 @@ import com.junmp.v2.common.util.BeanPlusUtil; ...@@ -34,9 +36,12 @@ import com.junmp.v2.common.util.BeanPlusUtil;
import com.junmp.v2.message.api.MessageApi; import com.junmp.v2.message.api.MessageApi;
import com.junmp.v2.message.api.bean.req.MessageReq; import com.junmp.v2.message.api.bean.req.MessageReq;
import com.junmp.v2.message.api.bean.req.MessageSendReq; import com.junmp.v2.message.api.bean.req.MessageSendReq;
import com.junmp.v2.sys.user.entity.SysUserOrg;
import com.junmp.v2.sys.user.service.SysUserOrgService;
import com.rabbitmq.client.Channel; import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection; import com.rabbitmq.client.Connection;
import com.rabbitmq.client.MessageProperties; import com.rabbitmq.client.MessageProperties;
import liquibase.pro.packaged.S;
import lombok.SneakyThrows; import lombok.SneakyThrows;
import org.flowable.bpmn.model.Process; import org.flowable.bpmn.model.Process;
import org.flowable.common.engine.api.delegate.event.FlowableEngineEntityEvent; import org.flowable.common.engine.api.delegate.event.FlowableEngineEntityEvent;
...@@ -99,6 +104,12 @@ import static com.junmp.junmpProcess.common.CommonConstants.*; ...@@ -99,6 +104,12 @@ import static com.junmp.junmpProcess.common.CommonConstants.*;
private BussinessInventoryService bussinessInventoryService; private BussinessInventoryService bussinessInventoryService;
@Autowired @Autowired
private RabbitMQSendMsg MQ; private RabbitMQSendMsg MQ;
@Resource
private OrgUserMapper orgUserMapper;
@Resource
private SysUserOrgService sysUserOrgService;
@Resource @Resource
private RepositoryService repositoryService; private RepositoryService repositoryService;
protected Logger logger = LoggerFactory.getLogger(this.getClass()); protected Logger logger = LoggerFactory.getLogger(this.getClass());
...@@ -164,6 +175,32 @@ import static com.junmp.junmpProcess.common.CommonConstants.*; ...@@ -164,6 +175,32 @@ import static com.junmp.junmpProcess.common.CommonConstants.*;
if (busForm.getBussinessType().equals("remove")){ if (busForm.getBussinessType().equals("remove")){
busFormService.updateBrokenResult(busForm); busFormService.updateBrokenResult(busForm);
} }
//如果业务单是调拨单,那么该单子需要让双方都能发物单位和收物单位的仓管员和审核员都能看见
// (前提是发起单据的那一方只有发起人或者经办人和审批人员可见,同级人员不可见)
//获取申请人判断是调拨单的哪一方发起的
String agentId = busForm.getAgentId();
Long angentOrgId = sysUserOrgService.getOne(new LambdaQueryWrapper<SysUserOrg>()
.eq(SysUserOrg::getUserId, agentId)).getOrgId();
Long orgId=(busForm.getStartOrgId() == angentOrgId?busForm.getEndOrgId():busForm.getStartOrgId());
//将单子信息指定给另一方的仓管员和审核员可见
//获取组织机构下的所有仓管员和审核员id
String roleList="(1663372320355389441,1528003832557232130)";
List<UserListDTO> userList=orgUserMapper.QueryUserByRoleIdAndOrg(roleList,orgId.toString());
List<String> assigneeList=new ArrayList<>();
if (userList.size()>0)//判断有没有启动的当前单据,并且下一审核人信息不为空,有启动的单据则把审核人信息加入
{
for (UserListDTO userId :userList)
{
assigneeList.add(userId.getUserID());
}
String assigneeString = String.join(",", assigneeList);
if (ObjectUtil.isNull(busForm.getHistoryAssign())){
busForm.setHistoryAssign(assigneeString);
}else {
busForm.setHistoryAssign(busForm.getHistoryAssign()+","+assigneeString);
}
}
busFormService.updateById(busForm); busFormService.updateById(busForm);
} else } else
if (Type.equals("reassignment")){//调岗申请单 if (Type.equals("reassignment")){//调岗申请单
......
...@@ -78,4 +78,5 @@ public interface WarehouseService extends IService<Warehouse> { ...@@ -78,4 +78,5 @@ public interface WarehouseService extends IService<Warehouse> {
void HumidityAndtemperatureExport(WarehouseReq req); void HumidityAndtemperatureExport(WarehouseReq req);
Warehouse GetWareHouseInfoByRedis(WarehouseReq req);
} }
...@@ -3,9 +3,13 @@ package com.junmp.jyzb.service.impl; ...@@ -3,9 +3,13 @@ package com.junmp.jyzb.service.impl;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.junmp.junmpProcess.dto.json.UserInfo;
import com.junmp.jyzb.api.bean.dto.FetchingDataDto.WarehouseInfoDto; import com.junmp.jyzb.api.bean.dto.FetchingDataDto.WarehouseInfoDto;
import com.junmp.jyzb.api.bean.dto.MQDto; import com.junmp.jyzb.api.bean.dto.MQDto;
import com.junmp.jyzb.api.bean.dto.OrderMainDto; import com.junmp.jyzb.api.bean.dto.OrderMainDto;
...@@ -304,7 +308,6 @@ public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper,Warehouse> ...@@ -304,7 +308,6 @@ public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper,Warehouse>
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public boolean updateHumidityAndtemperature(HumidityAndtemperature req) { public boolean updateHumidityAndtemperature(HumidityAndtemperature req) {
Date date = new Date(req.getCreateTime());
//查询数据库仓库id取到仓库名称 //查询数据库仓库id取到仓库名称
Warehouse warehouse = getById(req.getWarehouseId()); Warehouse warehouse = getById(req.getWarehouseId());
...@@ -312,10 +315,29 @@ public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper,Warehouse> ...@@ -312,10 +315,29 @@ 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()); //将仓库信息存入redis中,
// warehouse.setTemperature(req.getTemperature()); warehouse.setHumidity(req.getHumidity());
warehouse.setTemperature(req.getTemperature());
try {
ObjectMapper objectMapper = new ObjectMapper();
String redisExist= redisCache.get("warehouseHumAndTemp:"+warehouse.getId());
if(redisExist!=null)//已有存在数据
{
String jsonData = objectMapper.writeValueAsString(warehouse);
redisCache.put("warehouseHumAndTemp:"+warehouse.getId(), jsonData);
}
else
{
String jsonData = objectMapper.writeValueAsString(warehouse);
redisCache.put("warehouseHumAndTemp:"+warehouse.getId(), jsonData);
}
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
return true; return true;
// return updateById(warehouse);
} }
//获取redis中的温湿度记录 //获取redis中的温湿度记录
...@@ -355,9 +377,14 @@ public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper,Warehouse> ...@@ -355,9 +377,14 @@ public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper,Warehouse>
} }
@Override
public Warehouse GetWareHouseInfoByRedis(WarehouseReq req) {
String s = redisCache.get("warehouseHumAndTemp:" + req.getId());
if (ObjectUtil.isNotEmpty(s)){
return JSONObject.parseObject(s, Warehouse.class);
}
return getById(req.getId());
}
} }
...@@ -183,6 +183,7 @@ public class SysFormServiceImpl extends ServiceImpl<ProcessTemplatesMapper, Proc ...@@ -183,6 +183,7 @@ public class SysFormServiceImpl extends ServiceImpl<ProcessTemplatesMapper, Proc
Map<String, Object> params = br.getParams(); Map<String, Object> params = br.getParams();
LambdaQueryWrapper<ProcessTemplates> wrapper = new LambdaQueryWrapper<ProcessTemplates>(); LambdaQueryWrapper<ProcessTemplates> wrapper = new LambdaQueryWrapper<ProcessTemplates>();
wrapper.and(q -> q.eq(ProcessTemplates::getOrgId, params.get("orgId")) wrapper.and(q -> q.eq(ProcessTemplates::getOrgId, params.get("orgId"))
.like(ObjectUtil.isNotEmpty(params.get("formName")),ProcessTemplates::getFormName,params.get("formName"))
.or() .or()
.isNull(ProcessTemplates::getOrgId)); .isNull(ProcessTemplates::getOrgId));
wrapper.orderByDesc(ProcessTemplates::getUpdated); wrapper.orderByDesc(ProcessTemplates::getUpdated);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论