大屏接口

dev
litao 3 years ago
parent dff91fe82f
commit 7ffb2286a6
  1. 2
      lab-service-api/lab-lims-api/src/main/java/org/springblade/lims/entry/RepairApplication.java
  2. 4
      lab-service-api/lab-user-api/src/main/java/org/springblade/system/user/entity/User.java
  3. 28
      lab-service/lab-capital/src/main/java/org/springblade/lims/goods/controller/ApplyController.java
  4. 17
      lab-service/lab-capital/src/main/java/org/springblade/lims/goods/controller/ContractController.java
  5. 22
      lab-service/lab-capital/src/main/java/org/springblade/lims/goods/controller/GoodsController.java
  6. 21
      lab-service/lab-lims/src/main/java/org/springblade/lims/controller/ContractController.java
  7. 7
      lab-service/lab-lims/src/main/java/org/springblade/lims/controller/EntrustController.java
  8. 7
      lab-service/lab-lims/src/main/java/org/springblade/lims/controller/ExamineController.java
  9. 1
      lab-service/lab-lims/src/main/java/org/springblade/lims/controller/InstrumentController.java
  10. 284
      lab-service/lab-lims/src/main/java/org/springblade/lims/controller/LargeScreenController.java
  11. 44
      lab-service/lab-lims/src/main/java/org/springblade/lims/controller/RepairApplicationController.java
  12. 13
      lab-service/lab-lims/src/main/java/org/springblade/lims/controller/RetentionSimpleDestroyLogController.java
  13. 15
      lab-service/lab-lims/src/main/java/org/springblade/lims/mapper/LargeScreenMapper.java
  14. 12
      lab-service/lab-lims/src/main/java/org/springblade/lims/service/ILargeScreenService.java
  15. 4
      lab-service/lab-lims/src/main/java/org/springblade/lims/service/impl/EntrustServiceImpl.java
  16. 16
      lab-service/lab-lims/src/main/java/org/springblade/lims/service/impl/ExamineResultServiceImpl.java
  17. 24
      lab-service/lab-lims/src/main/java/org/springblade/lims/service/impl/LargeScreenServiceImpl.java
  18. 4
      lab-service/lab-lims/src/main/java/org/springblade/lims/service/impl/SimpleServiceImpl.java
  19. 9
      lab-service/lab-lims/src/main/java/org/springblade/lims/service/impl/TaskBlueprintServiceImpl.java
  20. 31
      lab-service/lab-user/src/main/java/org/springblade/system/user/controller/UserController.java

@ -20,6 +20,8 @@ public class RepairApplication extends BaseEntity implements Serializable {
@Id
private Long id;
// 仪器/设备id
private Long instrumentId;
// 仪器/设备编号
private String code;
// 仪器/设备名称

@ -64,6 +64,10 @@ public class User extends TenantEntity {
* 性别
*/
private Integer sex;
/**
* 学历
*/
private Integer education;
/**
* 角色id
*/

@ -27,6 +27,8 @@ import org.springblade.lims.goods.service.IApplyDetailService;
import org.springblade.lims.goods.service.IApplyService;
import org.springblade.lims.goods.service.IGoodsService;
import org.springblade.lims.goods.vo.ApplyVO;
import org.springblade.resource.enums.SysTypeEnum;
import org.springblade.resource.feign.IMessageClient;
import org.springblade.system.user.entity.User;
import org.springblade.system.user.feign.IUserClient;
import org.springframework.transaction.annotation.Transactional;
@ -57,6 +59,8 @@ public class ApplyController extends BladeController {
private final IApplyDetailService applyDetailService;
private final IMessageClient messageClient;
/**
* 1.分页 申领列表
*/
@ -146,6 +150,17 @@ public class ApplyController extends BladeController {
apply.setStatus(0);
}
applyService.save(apply);
// 消息通知
List<User> userList = userClient.listDeptUserByCurrentUser(AuthUtil.getDeptId()).getData();
if (userList != null) {
for (User user : userList) {
if ("1542095624162525185".equals(user.getRoleId())) {
messageClient.event(SysTypeEnum.INFORM.getValue(), "申领审核",
"你有新的申领单待审核,请及时处理", 1, 5, user.getId().toString());
}
}
}
//添加申领明细表
List<ApplyDetail> detailList = applyVO.getDetailList();
if (detailList != null && detailList.size() > 0) {
@ -185,10 +200,15 @@ public class ApplyController extends BladeController {
List<ApplyDetail> detailList = applyDetailService.list(wrapper);
// 通过
if (apply.getStatus() == 1) {
// 消息通知
messageClient.event(SysTypeEnum.INFORM.getValue(), "申领出库",
"你有新的申领单待出库,请及时处理", 1, 5, "1533753689484058625");
}
//驳回
if (apply.getStatus() == -1) {
// 消息通知
messageClient.event(SysTypeEnum.INFORM.getValue(), "申领驳回",
"你有申领单被驳回,请重新下单", 1, 5, apply.getApplyUserId().toString());
if (detailList != null && detailList.size() > 0) {
for (ApplyDetail applyDetail : detailList) {
// 加回库存
@ -233,6 +253,9 @@ public class ApplyController extends BladeController {
}
// apply.setStatus(needReturn ? 2 : 3);
applyService.updateById(apply);
// 消息通知
messageClient.event(SysTypeEnum.INFORM.getValue(), "领取确认",
"你有新的申领单待确认,请及时处理", 1, 5, apply.getApplyUserId().toString());
}
}
@ -245,6 +268,9 @@ public class ApplyController extends BladeController {
apply.setIsUpdate(1);
apply.setStatus(2);
applyService.updateById(apply);
// 消息通知
messageClient.event(SysTypeEnum.INFORM.getValue(), "异常变更",
"你申领的物品数量有变动,请及时核对", 1, 5, apply.getApplyUserId().toString());
List<ApplyDetail> detailList = applyVO.getDetailList();
if (detailList != null && detailList.size() > 0) {
for (ApplyDetail applyDetail : detailList) {

@ -25,6 +25,10 @@ import org.springblade.lims.goods.entity.*;
import org.springblade.lims.goods.service.*;
import org.springblade.lims.goods.vo.ContractExcel;
import org.springblade.lims.goods.vo.ContractVO;
import org.springblade.resource.enums.SysTypeEnum;
import org.springblade.resource.feign.IMessageClient;
import org.springblade.system.user.entity.User;
import org.springblade.system.user.feign.IUserClient;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@ -52,6 +56,10 @@ public class ContractController extends BladeController {
private final IProductStoreDetialService productStoreDetialService;
private final IUserClient userClient;
private final IMessageClient messageClient;
/**
* 1.分页 列表查询
*/
@ -313,6 +321,15 @@ public class ContractController extends BladeController {
productStoreDetial.setStatus(0);
productStoreDetialService.save(productStoreDetial);
// 消息通知
List<User> userList = userClient.listRolebyId("实验室组长").getData();
if (userList != null) {
for (User user : userList) {
messageClient.event(SysTypeEnum.INFORM.getValue(), "质检入库",
"你有新的物品待质检,请及时处理", 1, 5, user.getId().toString());
}
}
// 添加合同批次数据
if (contractDetail.getNum() != 0) {
Batch batch = new Batch();

@ -32,9 +32,12 @@ import org.springblade.lims.goods.entity.Goods;
import org.springblade.lims.goods.entity.Report;
import org.springblade.lims.goods.service.IGoodsService;
import org.springblade.lims.goods.service.IReportService;
import org.springblade.resource.enums.SysTypeEnum;
import org.springblade.resource.feign.IMessageClient;
import org.springblade.system.cache.DictBizCache;
import org.springblade.system.enums.DictBizEnum;
import org.springblade.system.user.entity.User;
import org.springblade.system.user.feign.IUserClient;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
@ -64,6 +67,8 @@ public class GoodsController extends BladeController {
private final IMessageClient messageClient;
private final IUserClient userClient;
//物品列表 分页
@GetMapping("/list")
public IPage<Goods> list(Goods goods, Query query) {
@ -133,7 +138,14 @@ public class GoodsController extends BladeController {
goods.setBigClass(productClass.getName());
}
goods.setNum(0);
// 消息通知
List<User> userList = userClient.listRolebyId("实验室组长").getData();
if (userList != null) {
for (User user : userList) {
messageClient.event(SysTypeEnum.INFORM.getValue(), "质检入库",
"你有新的物品待质检,请及时处理", 1, 5, user.getId().toString());
}
}
return goodsService.save(goods);
}
@ -284,6 +296,14 @@ public class GoodsController extends BladeController {
// productStoreDetial.setCompany(contractVO.getSupplierName());
productStoreDetial.setStatus(0);
productStoreDetialService.save(productStoreDetial);
// 消息通知
List<User> userList = userClient.listRolebyId("实验室组长").getData();
if (userList != null) {
for (User user : userList) {
messageClient.event(SysTypeEnum.INFORM.getValue(), "质检入库",
"你有新的物品待质检,请及时处理", 1, 5, user.getId().toString());
}
}
}
}
}

@ -10,12 +10,15 @@ import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.lims.entry.Contract;
import org.springblade.lims.service.IContractService;
import org.springblade.resource.enums.SysTypeEnum;
import org.springblade.resource.feign.IMessageClient;
import org.springblade.system.feign.ISysClient;
import org.springblade.system.user.entity.User;
import org.springblade.system.user.feign.IUserClient;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.List;
/**
* @author swj
@ -33,6 +36,8 @@ public class ContractController extends BladeController {
private final ISysClient sysClient;
private final IMessageClient messageClient;
/**
* 分页 合同列表
*/
@ -62,11 +67,24 @@ public class ContractController extends BladeController {
String[] split = contract.getAppointAssessorId().split(",");
StringBuilder appointAssessorName = new StringBuilder();
for (String s : split) {
// 消息通知
messageClient.event(SysTypeEnum.INFORM.getValue(), "确认签字",
"你有新的合同评审待签字,请及时处理", 1, 5, s);
String name = userClient.userInfoById(Long.parseLong(s)).getData().getName();
appointAssessorName.append(name).append(",");
}
contract.setAppointAssessorName(appointAssessorName.toString());
}
if (contract.getReviewConclusionTechnicalDirectorId() != null) {
// 消息通知
messageClient.event(SysTypeEnum.INFORM.getValue(), "确认签字",
"你有新的合同评审待签字,请及时处理", 1, 5, contract.getReviewConclusionTechnicalDirectorId().toString());
}
if (contract.getCenterDirectorId() != null) {
// 消息通知1
messageClient.event(SysTypeEnum.INFORM.getValue(), "确认签字",
"你有新的合同评审待签字,请及时处理", 1, 5, contract.getCenterDirectorId().toString());
}
contract.setStatus(0);
return R.status(contractService.save(contract));
}
@ -114,6 +132,9 @@ public class ContractController extends BladeController {
&& byId.getCenterDirectorId() != null
&& byId.getAssessorId() != null
&& byId.getAssessorId().split(",").length == byId.getAppointAssessorId().split(",").length) {
// 消息通知1
messageClient.event(SysTypeEnum.INFORM.getValue(), "新增委托",
"您的合同已评审完成,请及时处理", 1, 5, "1542330472226856962");
byId.setStatus(1);
}
contractService.updateById(byId);

@ -1243,8 +1243,13 @@ public class EntrustController extends BladeController {
} else {
entrust1.setEntrustStatus("4");
// 发送提示消息
List<User> userList = userClient.listDeptUserByCurrentUser("1542115329594114049").getData();
if (userList != null) {
for (User user : userList) {
messageClient.event(SysTypeEnum.INFORM.getValue(), "生成报告",
"你有新的委托单报告待生成,请及时查看", 1, 5, "1542330472226856962");
"你有新的委托单报告待生成,请及时查看", 1, 5, user.getId().toString());
}
}
}
service.updateById(entrust1);
}

@ -336,7 +336,7 @@ public class ExamineController extends BladeController {
}
/**
* 领取提交
* 分配/领取提交
*/
@PostMapping("/receiveSubmit")
public void receiveSubmit(@RequestBody Examine examine) throws Exception {
@ -390,7 +390,10 @@ public class ExamineController extends BladeController {
}
taskService.updateById(eTask);
// 发送提示消息
User user = userClient.userInfoById(AuthUtil.getUserId()).getData();
if (!"1432876315142520834".equals(user.getRoleId())) {
messageClient.event(SysTypeEnum.INFORM.getValue(), "填写实验",
"你有新的检验数据待提交,请及时查看", 1, 5, AuthUtil.getUserId().toString());
"你有新的检验数据待提交,请及时查看", 1, 5, examine.getExamineBy());
}
}
}

@ -101,6 +101,7 @@ public class InstrumentController extends BladeController {
String name = userClient.userInfoById(entry.getSaveById()).getData().getName();
entry.setSaveByName(name);
}
entry.setStatus(0);
return service.save(entry);
}

@ -0,0 +1,284 @@
package org.springblade.lims.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import org.joda.time.DateTime;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tool.api.R;
import org.springblade.lims.entry.Entrust;
import org.springblade.lims.entry.Instrument;
import org.springblade.lims.entry.InstrumentUseLog;
import org.springblade.lims.entry.RepairApplication;
import org.springblade.lims.service.IEntrtrustService;
import org.springblade.lims.service.IInstrumentService;
import org.springblade.lims.service.IInstrumentUseLogService;
import org.springblade.lims.service.IRepairApplicationService;
import org.springframework.web.bind.annotation.*;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author swj
* @since 2022年6月1日19:49:10
*/
@RestController
@AllArgsConstructor
@RequestMapping("/largeScreen")
@Api(value = "", tags = "")
public class LargeScreenController extends BladeController {
private final IEntrtrustService entrtrustService;
private final IRepairApplicationService repairApplicationService;
private final IInstrumentService instrumentService;
private final IInstrumentUseLogService instrumentUseLogService;
/**
* 本年度委托单完成情况
*/
@GetMapping("/entrustYear")
public R<Map<String, Object>> entrustYear() throws ParseException {
//获取今年第一天
DateTime date = new DateTime();
int year = date.getYear();
String str = year + "-01-01 00:00:00";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date parse = sdf.parse(str);
// 本年度委托单完成数量
LambdaQueryWrapper<Entrust> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(Entrust::getStatus, 6);
wrapper.ge(Entrust::getCreateTime, parse);
int count = entrtrustService.count(wrapper);
// 年度计划数量
double plan = 0.00;
double actual = 0.00;
actual += count;
// 完成率
double rate = actual / plan * 100;
// 委托
wrapper.clear();
wrapper.eq(Entrust::getStatus, 6);
wrapper.ge(Entrust::getCreateTime, parse);
wrapper.eq(Entrust::getInvestigativeType, "1");
int wt = entrtrustService.count(wrapper);
double wt1 = 0.00;
wt1 += wt;
double rate1 = wt1 / wt * 100;
// 监督
wrapper.clear();
wrapper.eq(Entrust::getStatus, 6);
wrapper.ge(Entrust::getCreateTime, parse);
wrapper.eq(Entrust::getInvestigativeType, "2");
int jd = entrtrustService.count(wrapper);
double jd1 = 0.00;
jd1 += jd;
double rate2 = jd1 / jd * 100;
// 仲裁
wrapper.clear();
wrapper.eq(Entrust::getStatus, 6);
wrapper.ge(Entrust::getCreateTime, parse);
wrapper.eq(Entrust::getInvestigativeType, "3");
int zc = entrtrustService.count(wrapper);
double zc1 = 0.00;
zc1 += zc;
double rate3 = zc1 / zc * 100;
// 门诊
wrapper.clear();
wrapper.eq(Entrust::getStatus, 6);
wrapper.ge(Entrust::getCreateTime, parse);
wrapper.eq(Entrust::getInvestigativeType, "4");
int mz = entrtrustService.count(wrapper);
double mz1 = 0.00;
mz1 += mz;
double rate4 = mz1 / mz * 100;
Map<String, Object> map = new HashMap<>();
map.put("entrustCount", count);
map.put("wt", rate1);
map.put("jd", rate2);
map.put("zc", rate3);
map.put("mz", rate4);
return R.data(map);
}
/**
* 今日委托单完成情况
*/
@GetMapping("/entrustDay")
public R<Map<String, Object>> entrustDay() throws ParseException {
Map<String, Object> map = new HashMap<>();
//获取今年第一天
DateTime date = new DateTime();
int year = date.getYear();
int month = date.getMonthOfYear();
int day = date.getDayOfMonth();
String str1 = year + month + day + "00:00:00";
String str2 = year + month + day + "23:59:59";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date parse1 = sdf.parse(str1);
Date parse2 = sdf.parse(str2);
// 今日委托单数量
LambdaQueryWrapper<Entrust> wrapper = new LambdaQueryWrapper<>();
// wrapper.ge(Entrust::getCreateTime, parse1).lt(Entrust::getCreateTime, parse2);
wrapper.between(Entrust::getCreateTime, parse1, parse2);
int count = entrtrustService.count(wrapper);
wrapper.clear();
// 今日进行中
wrapper.between(Entrust::getCreateTime, parse1, parse2);
wrapper.ne(Entrust::getStatus, 6);
int count1 = entrtrustService.count(wrapper);
// 今日完成
wrapper.between(Entrust::getCreateTime, parse1, parse2);
wrapper.eq(Entrust::getStatus, 6);
int count2 = entrtrustService.count(wrapper);
map.put("count", count);
map.put("jxz", count1);
map.put("wc", count2);
return R.data(map);
}
/**
* 各实验室检测数量统计
*/
@GetMapping("/examine")
public void examine() {
}
/**
* 仪器设备维修数统计
*/
@GetMapping("/repair")
public R<Map<String, Object>> repair() throws ParseException {
Map<String, Object> map = new HashMap<>();
//获取今年第一天
DateTime date = new DateTime();
int year = date.getYear();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date parse1 = sdf.parse(year + "-01-01 00:00:00");
Date parse2 = sdf.parse(year + "-02-01 00:00:00");
Date parse3 = sdf.parse(year + "-03-01 00:00:00");
Date parse4 = sdf.parse(year + "-04-01 00:00:00");
Date parse5 = sdf.parse(year + "-05-01 00:00:00");
Date parse6 = sdf.parse(year + "-06-01 00:00:00");
Date parse7 = sdf.parse(year + "-07-01 00:00:00");
Date parse8 = sdf.parse(year + "-08-01 00:00:00");
Date parse9 = sdf.parse(year + "-09-01 00:00:00");
Date parse10 = sdf.parse(year + "-10-01 00:00:00");
Date parse11 = sdf.parse(year + "-11-01 00:00:00");
Date parse12 = sdf.parse(year + "-12-01 00:00:00");
LambdaQueryWrapper<RepairApplication> wrapper = new LambdaQueryWrapper<>();
// 1月报修数量
wrapper.ge(RepairApplication::getCreateTime, parse1).lt(RepairApplication::getCreateTime, parse2);
int count1 = repairApplicationService.count(wrapper);
wrapper.clear();
// 2月报修数量
wrapper.ge(RepairApplication::getCreateTime, parse2).lt(RepairApplication::getCreateTime, parse3);
int count2 = repairApplicationService.count(wrapper);
wrapper.clear();
// 3月报修数量
wrapper.ge(RepairApplication::getCreateTime, parse3).lt(RepairApplication::getCreateTime, parse4);
int count3 = repairApplicationService.count(wrapper);
wrapper.clear();
// 4月报修数量
wrapper.ge(RepairApplication::getCreateTime, parse4).lt(RepairApplication::getCreateTime, parse5);
int count4 = repairApplicationService.count(wrapper);
wrapper.clear();
// 5月报修数量
wrapper.ge(RepairApplication::getCreateTime, parse5).lt(RepairApplication::getCreateTime, parse6);
int count5 = repairApplicationService.count(wrapper);
wrapper.clear();
// 6月报修数量
wrapper.ge(RepairApplication::getCreateTime, parse6).lt(RepairApplication::getCreateTime, parse7);
int count6 = repairApplicationService.count(wrapper);
wrapper.clear();
// 7月报修数量
wrapper.ge(RepairApplication::getCreateTime, parse7).lt(RepairApplication::getCreateTime, parse8);
int count7 = repairApplicationService.count(wrapper);
wrapper.clear();
// 8月报修数量
wrapper.ge(RepairApplication::getCreateTime, parse8).lt(RepairApplication::getCreateTime, parse9);
int count8 = repairApplicationService.count(wrapper);
wrapper.clear();
// 9月报修数量
wrapper.ge(RepairApplication::getCreateTime, parse9).lt(RepairApplication::getCreateTime, parse10);
int count9 = repairApplicationService.count(wrapper);
wrapper.clear();
// 10月报修数量
wrapper.ge(RepairApplication::getCreateTime, parse10).lt(RepairApplication::getCreateTime, parse11);
int count10 = repairApplicationService.count(wrapper);
wrapper.clear();
// 11月报修数量
wrapper.ge(RepairApplication::getCreateTime, parse11).lt(RepairApplication::getCreateTime, parse12);
int count11 = repairApplicationService.count(wrapper);
wrapper.clear();
// 12月报修数量
wrapper.ge(RepairApplication::getCreateTime, parse12);
int count12 = repairApplicationService.count(wrapper);
map.put("count1", count1);
map.put("count2", count2);
map.put("count3", count3);
map.put("count4", count4);
map.put("count5", count5);
map.put("count6", count6);
map.put("count7", count7);
map.put("count8", count8);
map.put("count9", count9);
map.put("count10", count10);
map.put("count11", count11);
map.put("count12", count12);
return R.data(map);
}
/**
* 仪器使用次数统计
*/
@GetMapping("/instrument")
public R<Map<String, Object>> instrument() {
Map<String, Object> map = new HashMap<>();
// 仪器设备运行中数量
LambdaQueryWrapper<Instrument> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(Instrument::getIsDeleted, 0);
wrapper.eq(Instrument::getStatus, 1);
int count1 = instrumentService.count(wrapper);
// 仪器设备关机数量
wrapper.clear();
wrapper.eq(Instrument::getIsDeleted, 0);
wrapper.eq(Instrument::getStatus, 0);
int count2 = instrumentService.count(wrapper);
// 仪器设备维修中数量
wrapper.clear();
wrapper.eq(Instrument::getIsDeleted, 0);
wrapper.eq(Instrument::getStatus, 2);
int count3 = instrumentService.count(wrapper);
map.put("functionCount", count1);
map.put("closeCount", count2);
map.put("repairCount", count3);
// 仪器设备使用记录
LambdaQueryWrapper<InstrumentUseLog> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.orderByDesc(InstrumentUseLog::getCreateTime);
List<InstrumentUseLog> useLogs = instrumentUseLogService.list(queryWrapper);
map.put("useLogs", useLogs);
return R.data(map);
}
/**
* 定时往前端选择性推送
*/
@GetMapping("/message")
public void message() {
}
}

@ -9,11 +9,18 @@ import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.lims.entry.Instrument;
import org.springblade.lims.entry.RepairApplication;
import org.springblade.lims.service.IInstrumentService;
import org.springblade.lims.service.IRepairApplicationService;
import org.springblade.resource.enums.SysTypeEnum;
import org.springblade.resource.feign.IMessageClient;
import org.springblade.system.user.entity.User;
import org.springblade.system.user.feign.IUserClient;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.List;
/**
* @author swj
@ -27,6 +34,12 @@ public class RepairApplicationController extends BladeController {
private final IRepairApplicationService repairApplicationService;
private final IMessageClient messageClient;
private final IUserClient userClient;
private final IInstrumentService instrumentService;
/**
* 分页 列表
*/
@ -51,6 +64,21 @@ public class RepairApplicationController extends BladeController {
*/
@PostMapping("/save")
public R save(@RequestBody RepairApplication repairApplication) {
// 修改设备状态为维修中
Instrument instrument = new Instrument();
instrument.setId(repairApplication.getInstrumentId());
instrument.setStatus(2);
instrumentService.updateById(instrument);
// 发送提示消息
List<User> userList = userClient.listDeptUserByCurrentUser(AuthUtil.getDeptId()).getData();
if (userList != null) {
for (User user : userList) {
if ("1542095624162525185".equals(user.getRoleId())) {
messageClient.event(SysTypeEnum.INFORM.getValue(), "报修确认",
"您有新的报修申请单待确认,请及时处理", 1, 5, user.getId().toString());
}
}
}
// 待确认
repairApplication.setStatus(0);
return R.status(repairApplicationService.save(repairApplication));
@ -63,28 +91,42 @@ public class RepairApplicationController extends BladeController {
public R update(@RequestBody RepairApplication repairApplication) {
// 确认
if (repairApplication.getStatus() == 1) {
// 发送提示消息
messageClient.event(SysTypeEnum.INFORM.getValue(), "报修审核",
"您有新的报修申请单待审核,请及时处理", 1, 5, "1555122570980995073");
repairApplication.setApplyDeptUser(AuthUtil.getUserId());
repairApplication.setApplyDeptUserName(AuthUtil.getUserName());
repairApplication.setApplyDate(new Date());
}
// 审核
if (repairApplication.getStatus() == 2) {
// 发送提示消息
messageClient.event(SysTypeEnum.INFORM.getValue(), "报修审批",
"您有新的报修申请单待审批,请及时处理", 1, 5, "1552118581265973249");
repairApplication.setReviewDate(new Date());
repairApplication.setBusinessOfficeId(AuthUtil.getUserId());
repairApplication.setBusinessOfficeName(AuthUtil.getUserName());
}
// 审批
if (repairApplication.getStatus() == 3) {
// 发送提示消息
RepairApplication byId = repairApplicationService.getById(repairApplication.getId());
messageClient.event(SysTypeEnum.INFORM.getValue(), "报修验收",
"您的报修申请单待验收,请及时处理", 1, 5, byId.getApplyUser().toString());
repairApplication.setApprovalDate(new Date());
repairApplication.setCenterDirectorId(AuthUtil.getUserId());
repairApplication.setCenterDirectorName(AuthUtil.getUserName());
}
// 验收
if (repairApplication.getStatus() == 4) {
repairApplication.setAcceptedBy(AuthUtil.getUserId());
repairApplication.setAcceptedName(AuthUtil.getUserName());
repairApplication.setAcceptedDate(new Date());
// 修改设备状态为关机
Instrument instrument = new Instrument();
instrument.setId(repairApplication.getInstrumentId());
instrument.setStatus(0);
instrumentService.updateById(instrument);
}
return R.status(repairApplicationService.updateById(repairApplication));
}

@ -20,6 +20,8 @@ import org.springblade.lims.entry.SimpleSet;
import org.springblade.lims.service.IRetentionSimpleDestroyLogService;
import org.springblade.lims.service.ISimpleService;
import org.springblade.lims.service.ISimpleSetService;
import org.springblade.resource.enums.SysTypeEnum;
import org.springblade.resource.feign.IMessageClient;
import org.springblade.system.user.feign.IUserClient;
import org.springframework.web.bind.annotation.*;
@ -42,6 +44,8 @@ public class RetentionSimpleDestroyLogController extends BladeController {
private final ISimpleSetService simpleSetService;
private final IMessageClient messageClient;
/**
* 分页
*/
@ -54,6 +58,7 @@ public class RetentionSimpleDestroyLogController extends BladeController {
wrapper.like(RetentionSimpleDestroyLog::getSimpleName, retentionSample.getSimpleName()).or();
wrapper.like(RetentionSimpleDestroyLog::getSetCode, retentionSample.getSimpleName());
}
wrapper.orderByDesc(RetentionSimpleDestroyLog::getCreateTime);
IPage<RetentionSimpleDestroyLog> page = service.page(Condition.getPage(query), wrapper);
return R.data(page);
}
@ -64,6 +69,11 @@ public class RetentionSimpleDestroyLogController extends BladeController {
@PostMapping("/update")
@ApiOperation(value = "更改", notes = "更改")
public R update(@RequestBody RetentionSimpleDestroyLog retentionSample) {
if (retentionSample.getStatus() == 1) {
// 发送提示消息
messageClient.event(SysTypeEnum.INFORM.getValue(), "销毁处理",
"你有样品销毁申请待处理,请及时查看", 1, 5, "1542096837247541250");
}
return R.data(service.updateById(retentionSample));
}
@ -86,6 +96,9 @@ public class RetentionSimpleDestroyLogController extends BladeController {
}
retentionSample.setManagerSuggertTime(new Date());
retentionSample.setStatus(0);
// 发送提示消息
messageClient.event(SysTypeEnum.INFORM.getValue(), "销毁审批",
"你有样品销毁申请待审批,请及时处理", 1, 5, "");
return R.data(service.save(retentionSample));
}

@ -0,0 +1,15 @@
package org.springblade.lims.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springblade.lims.entry.ExamineWay;
/**
*
*
* @author swj
* @since 2022年6月2日15:47:39
*/
public interface LargeScreenMapper extends BaseMapper {
}

@ -0,0 +1,12 @@
package org.springblade.lims.service;
import org.springblade.core.mp.base.BaseService;
import org.springblade.lims.entry.ExamineWay;
/**
* @author swj
* @since 2022年6月1日19:50:34
*/
public interface ILargeScreenService extends BaseService {
}

@ -221,8 +221,8 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
examineService.updateBatchById(updateList);
}
// 发送提示消息
messageClient.event(SysTypeEnum.INFORM.getValue(), "接样",
"你有新的样品待接样,请及时查看", 1, 5, "1542330472226856962");
// messageClient.event(SysTypeEnum.INFORM.getValue(), "接样",
// "你有新的样品待接样,请及时查看", 1, 5, "1542330472226856962");
}
else {
entrust.setEntrustStatus("2.1");

@ -85,6 +85,17 @@ public class ExamineResultServiceImpl extends BaseServiceImpl<ExamineResultMappe
// 如果是第一次提交实验结果
if (examineResult.getIsUpdate() == null || examineResult.getIsUpdate() != 1) {
// 发送提示消息
List<User> userList = userClient.listDeptUserByCurrentUser(AuthUtil.getDeptId()).getData();
if (userList != null) {
for (User user : userList) {
if (!user.getId().equals(AuthUtil.getUserId())) {
// 发送提示消息
messageClient.event(SysTypeEnum.INFORM.getValue(), "校核",
"你有新的检验待校核,请及时查看", 1, 5, user.getId().toString());
}
}
}
// 更新检测结果数据
LambdaQueryWrapper<ExamineResult> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(ExamineResult::getExamineId, examineResult.getExamineId());
@ -153,7 +164,8 @@ public class ExamineResultServiceImpl extends BaseServiceImpl<ExamineResultMappe
log.setIsFinished(0);
simpleDoExamineLogService.save(log);
}
} else {
}
else {
this.updateById(examineResult);
}
}
@ -195,7 +207,7 @@ public class ExamineResultServiceImpl extends BaseServiceImpl<ExamineResultMappe
if (!user.getId().equals(AuthUtil.getUserId())) {
// 发送提示消息
messageClient.event(SysTypeEnum.INFORM.getValue(), "校核",
"你有新的检验待校核,请及时查看", 1, 5, AuthUtil.getUserId().toString());
"你有新的检验待校核,请及时查看", 1, 5, user.getId().toString());
}
}
}

@ -0,0 +1,24 @@
package org.springblade.lims.service.impl;
import lombok.AllArgsConstructor;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.lims.entry.ExamineItem;
import org.springblade.lims.mapper.ExamineItemMapper;
import org.springblade.lims.mapper.LargeScreenMapper;
import org.springblade.lims.service.IExamineItemService;
import org.springblade.lims.service.ILargeScreenService;
import org.springframework.stereotype.Service;
/**
*
* @author swj
* @since 2022年6月2日15:53:01
*/
@Service
@AllArgsConstructor
public class LargeScreenServiceImpl extends BaseServiceImpl implements ILargeScreenService {
}

@ -160,8 +160,8 @@ public class SimpleServiceImpl extends BaseServiceImpl<SimpleMapper, Simple> imp
this.saveBatch(resultList);
// 发送提示消息
messageClient.event(SysTypeEnum.INFORM.getValue(), "计划书",
"你有新的计划待分配,请及时查看", 1, 5, "1542330472226856962");
// messageClient.event(SysTypeEnum.INFORM.getValue(), "计划书",
// "你有新的计划待分配,请及时查看", 1, 5, "1542330472226856962");
return R.data(simpleAo.getIsContinue());
}
}

@ -65,8 +65,13 @@ public class TaskBlueprintServiceImpl extends BaseServiceImpl<TaskBlueprintMappe
List<User> userList = userClient.listDeptUserByCurrentUser(eTask.getDeptId().toString()).getData();
if (userList != null) {
for (User user : userList) {
messageClient.event(SysTypeEnum.INFORM.getValue(), "任务书",
"你有新的检验待领取,请及时查看", 1, 5, user.getId().toString());
if ("1432876315142520834".equals(user.getRoleId())) {
messageClient.event(SysTypeEnum.INFORM.getValue(), "新的检验",
"你有新的检验待领取,请及时处理", 1, 5, user.getId().toString());
} else {
messageClient.event(SysTypeEnum.INFORM.getValue(), "新的检验",
"你有新的检验待分配,请及时处理", 1, 5, user.getId().toString());
}
}
}
List<Examine> examines = eTask.getExamines();

@ -58,7 +58,6 @@ import static org.springblade.core.cache.constant.CacheConstant.USER_CACHE;
public class UserController {
private final IUserService userService;
private final IUserClient userClient;
private final ISysClient sysClient;
@ -397,4 +396,34 @@ public class UserController {
file.transferTo(file1);
return path + fileName;
}
/**
* 人员统计
*/
@GetMapping("/user/statistics")
public R<Map<String, Object>> user() {
Map<String, Object> map = new HashMap<>();
// 实际人员数量
LambdaQueryWrapper<User> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(User::getIsDeleted, 0);
int count = userService.count(wrapper);
// 额定人数
double rated = 40.00;
double actual = 0.00;
actual += count;
// 满编率
double rate = actual / rated * 100;
// 硕士及以上人数
wrapper.clear();
wrapper.eq(User::getEducation, "");
int count1 = userService.count(wrapper);
// 硕士以下人数
int count2 = count - count1;
map.put("rated", 40);
map.put("actual", count);
map.put("rate", rate);
map.put("masterUp", count1);
map.put("masterLo", count2);
return R.data(map);
}
}

Loading…
Cancel
Save