diff --git a/pom.xml b/pom.xml index 683fb109a..159f3d635 100644 --- a/pom.xml +++ b/pom.xml @@ -816,7 +816,7 @@ org.example - wflow-server1 + wflow-server 1.0-SNAPSHOT system ${basedir}/src/main/resources/lib/wflow-server-1.0-SNAPSHOT.jar diff --git a/src/main/java/com/zhgd/xmgl/call/HikvisionCall.java b/src/main/java/com/zhgd/xmgl/call/HikvisionCall.java index 6e8618dda..23c5c4cf0 100644 --- a/src/main/java/com/zhgd/xmgl/call/HikvisionCall.java +++ b/src/main/java/com/zhgd/xmgl/call/HikvisionCall.java @@ -900,6 +900,11 @@ public class HikvisionCall { if (SecurityUtils.getUser() != null && SecurityUtils.getUser().getUserId() != null) { noticeService.addUserNotice(SecurityUtils.getUser().getUserId(), msg, title, "24"); } + if (carInfo.getUserIds() != null && carInfo.getUserIds().size() > 0) { + for (String userId : carInfo.getUserIds()) { + noticeService.addUserNotice(Long.valueOf(userId), msg, title, "24"); + } + } } private void sendNoticeForOrg(String title, String rs, String orgName) { diff --git a/src/main/java/com/zhgd/xmgl/modules/car/controller/CarInfoController.java b/src/main/java/com/zhgd/xmgl/modules/car/controller/CarInfoController.java index 8fac2b51c..51176b859 100644 --- a/src/main/java/com/zhgd/xmgl/modules/car/controller/CarInfoController.java +++ b/src/main/java/com/zhgd/xmgl/modules/car/controller/CarInfoController.java @@ -4,11 +4,16 @@ import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.DateUtil; import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.zhgd.annotation.OperLog; import com.zhgd.jeecg.common.api.vo.Result; import com.zhgd.jeecg.common.mybatis.EntityMap; +import com.zhgd.xmgl.modules.basicdata.entity.SystemUser; +import com.zhgd.xmgl.modules.basicdata.service.ISystemUserService; import com.zhgd.xmgl.modules.car.entity.CarInfo; import com.zhgd.xmgl.modules.car.service.ICarInfoService; +import com.zhgd.xmgl.modules.worker.service.IWorkerInfoService; +import com.zhgd.xmgl.security.util.SecurityUtils; import com.zhgd.xmgl.util.MessageUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; @@ -44,6 +49,12 @@ public class CarInfoController { @Autowired private ICarInfoService carInfoService; + @Autowired + private ISystemUserService systemUserService; + + @Autowired + private IWorkerInfoService workerInfoService; + /** * 分页列表查询 * @return @@ -84,12 +95,12 @@ public class CarInfoController { @PostMapping(value = "/save") public Result save(@RequestBody Map map) { Object alarmPushWorkerId = map.get("alarmPushWorkerId"); - Object enterpriseId = map.get("enterpriseId"); + String userId = map.get("enterpriseId").toString(); Object driverWorkerName = map.get("driverWorkerName"); List carType = (List) map.get("carType"); List driverWorkerId = (List) map.get("driverWorkerId"); Integer carModuleType = MapUtils.getString(map, "carModuleType").equals("临时车辆") ? 2 : 3; - + List userIds = (List) map.get("userIds"); CarInfo carInfo = new CarInfo(); if(driverWorkerId != null) { carInfo.setDriverWorkerId(driverWorkerId.get(0).toString()); @@ -101,12 +112,9 @@ public class CarInfoController { List alarmPushWorkerIds = (List) alarmPushWorkerId; carInfo.setAlarmPushWorkerId(alarmPushWorkerIds.get(0).toString()); } - if (enterpriseId != null) { - List enterpriseIds = (List) enterpriseId; - String string = enterpriseIds.get(0).toString(); - if (StringUtils.isNotBlank(string)) { - carInfo.setEnterpriseId(Long.valueOf(string)); - } + if (userId != null) { + Long workerId = systemUserService.getOne(Wrappers.lambdaQuery().eq(SystemUser::getUserId, userId)).getWorkerId(); + carInfo.setEnterpriseId(workerInfoService.getById(workerId).getEnterpriseId()); } carInfo.setCarModuleType(carModuleType); Integer entryAndExitPermit = MapUtils.getString(map, "entryAndExitPermit").equals("单次") ? 0 : 1; @@ -174,6 +182,7 @@ public class CarInfoController { carInfo.setOtherProve(JSON.toJSONString(otherProveList)); carInfo.setProjectSn(map.get("projectSn").toString()); carInfo.setIsBlack(MapUtils.getInteger(map, "isBlack")); + carInfo.setUserIds(userIds); carInfoService.addCarInfo(carInfo); return Result.ok(); } diff --git a/src/main/java/com/zhgd/xmgl/modules/car/entity/CarInfo.java b/src/main/java/com/zhgd/xmgl/modules/car/entity/CarInfo.java index 16a9420f3..323cad29c 100644 --- a/src/main/java/com/zhgd/xmgl/modules/car/entity/CarInfo.java +++ b/src/main/java/com/zhgd/xmgl/modules/car/entity/CarInfo.java @@ -14,6 +14,7 @@ import org.springframework.format.annotation.DateTimeFormat; import java.io.Serializable; import java.util.Date; +import java.util.List; /** * @Description: 车辆黑白名单管理 @@ -131,4 +132,8 @@ public class CarInfo implements Serializable { @ApiModelProperty(value = "企业名称") private String enterpriseName; + @TableField(exist = false) + @ApiModelProperty(value = "流程参与人") + private List userIds; + } diff --git a/src/main/java/com/zhgd/xmgl/modules/xz/controller/XzMaterialController.java b/src/main/java/com/zhgd/xmgl/modules/xz/controller/XzMaterialController.java index cc238a5ad..fb33e79c9 100644 --- a/src/main/java/com/zhgd/xmgl/modules/xz/controller/XzMaterialController.java +++ b/src/main/java/com/zhgd/xmgl/modules/xz/controller/XzMaterialController.java @@ -6,10 +6,13 @@ import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.zhgd.annotation.OperLog; +import com.zhgd.xmgl.modules.basicdata.entity.SystemUser; +import com.zhgd.xmgl.modules.basicdata.service.ISystemUserService; import com.zhgd.xmgl.modules.project.entity.ProjectEnterprise; import com.zhgd.xmgl.modules.project.service.IProjectEnterpriseService; import com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo; import com.zhgd.xmgl.modules.worker.service.IEnterpriseInfoService; +import com.zhgd.xmgl.modules.worker.service.IWorkerInfoService; import com.zhgd.xmgl.modules.xz.entity.XzMaterialDetail; import com.zhgd.xmgl.util.PageUtil; import io.swagger.annotations.Api; @@ -67,6 +70,12 @@ public class XzMaterialController { @Autowired private IXzMaterialService xzMaterialService; + @Autowired + private ISystemUserService systemUserService; + + @Autowired + private IWorkerInfoService workerInfoService; + @Autowired private IEnterpriseInfoService enterpriseInfoService; @@ -164,11 +173,14 @@ public class XzMaterialController { @PostMapping(value = "/save") public Result save(@RequestBody JSONObject obj) { log.info("添加材料信息" + JSON.toJSONString(obj)); - List enterpriseIds = (List) obj.get("enterpriseId"); + String userId = obj.get("enterpriseId").toString(); + Integer type = Integer.parseInt(obj.get("type").toString()); XzMaterial xzMaterial = new XzMaterial(); + xzMaterial.setType(type); String [] param = {"name", "model", "specifications", "unit", "num", "remark"}; List list = new ArrayList<>(); XzMaterial exist = xzMaterialService.getOne(Wrappers.lambdaQuery() + .eq(XzMaterial::getType, type) .like(XzMaterial::getName, DateUtil.today()) .orderByDesc(XzMaterial::getCreateTime).last("limit 1")); if (exist == null) { @@ -200,8 +212,9 @@ public class XzMaterialController { } } xzMaterial.setProjectSn(obj.getString("projectSn")); - if (enterpriseIds != null && enterpriseIds.size() > 0) { - xzMaterial.setEnterpriseId(enterpriseIds.get(0)); + if (userId != null ) { + Long workerId = systemUserService.getOne(Wrappers.lambdaQuery().eq(SystemUser::getUserId, userId)).getWorkerId(); + xzMaterial.setEnterpriseId(workerInfoService.getById(workerId).getEnterpriseId().toString()); } xzMaterial.setXzMaterialList(list); xzMaterial.setCreateTime(new Date()); diff --git a/src/main/java/com/zhgd/xmgl/modules/xz/entity/XzMaterial.java b/src/main/java/com/zhgd/xmgl/modules/xz/entity/XzMaterial.java index d5a820c34..b04c6218b 100644 --- a/src/main/java/com/zhgd/xmgl/modules/xz/entity/XzMaterial.java +++ b/src/main/java/com/zhgd/xmgl/modules/xz/entity/XzMaterial.java @@ -45,6 +45,12 @@ public class XzMaterial implements Serializable { @Excel(name = "批次数量", width = 15) @ApiModelProperty(value = "批次数量") private Integer num; + /** + * 进出场标识(1:入场;2:出厂;) + */ + @Excel(name = "进出场标识(1:入场;2:出厂;)", width = 15) + @ApiModelProperty(value = "进出场标识(1:入场;2:出厂;)") + private Integer type; /** * 入场时间 */ diff --git a/src/main/resources/lib/wflow-server-1.0-SNAPSHOT.jar b/src/main/resources/lib/wflow-server-1.0-SNAPSHOT.jar index 4a161612d..7f02efcc9 100644 Binary files a/src/main/resources/lib/wflow-server-1.0-SNAPSHOT.jar and b/src/main/resources/lib/wflow-server-1.0-SNAPSHOT.jar differ