2 Komitmen 6a391aafb3 ... f738625fd1

Pembuat SHA1 Pesan Tanggal
  SJ f738625fd1 feat:会议安排申请 开始结束时间精确到分,增加通知参与人功能 11 bulan lalu
  SJ d0dde58a95 fix:物料申请,库存验证修改提示 11 bulan lalu

+ 1 - 1
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/activiti/listener/ListenerMaterialApply.java

@@ -60,7 +60,7 @@ public class ListenerMaterialApply implements TaskListener, ExecutionListener {
                 BigDecimal amount = new BigDecimal(detail.get("amount").toString());
                 BigDecimal subtract = amount.add(occupyDetails.getOrDefault(materialName, BigDecimal.ZERO)).subtract(inventoryDetails.getOrDefault(materialName, BigDecimal.ZERO));
                 if (subtract.compareTo(BigDecimal.ZERO) > 0) {
-                    msg += materialName + " 现有库存:" + inventoryDetails.getOrDefault(materialName, BigDecimal.ZERO) + " 单据占用:" + occupyDetails.getOrDefault(materialName, BigDecimal.ZERO) + " 缺失:" + subtract +"   ";
+                    msg += materialName + " 现有库存:" + inventoryDetails.getOrDefault(materialName, BigDecimal.ZERO) + " 单据占用:" + occupyDetails.getOrDefault(materialName, BigDecimal.ZERO) + " 需要补足:" + subtract +"   ";
                 }
             };
             if (StringUtils.isNotBlank(msg)) {

+ 47 - 3
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/controller/ConferenceApplyController.java

@@ -1,16 +1,21 @@
 package org.jeecg.modules.oa.controller;
 
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.stream.Collectors;
 import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 import java.net.URLDecoder;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+
+import cn.hutool.core.date.DateUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.constant.CommonConstant;
+import org.jeecg.common.system.api.ISysBaseAPI;
 import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.util.oConvertUtils;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -49,6 +54,8 @@ import org.jeecg.common.aspect.annotation.AutoLog;
 public class ConferenceApplyController extends JeecgController<ConferenceApply, IConferenceApplyService> {
 	@Autowired
 	private IConferenceApplyService conferenceApplyService;
+	 @Autowired
+	 private ISysBaseAPI sysBaseAPI;
 
 	/**
 	 * 分页列表查询
@@ -82,6 +89,7 @@ public class ConferenceApplyController extends JeecgController<ConferenceApply,
 	@ApiOperation(value="会务安排申请-添加", notes="会务安排申请-添加")
 	@PostMapping(value = "/add")
 	public Result<?> add(@RequestBody ConferenceApply conferenceApply) {
+		conferenceApply.setNotified("否");
 		conferenceApplyService.save(conferenceApply);
 		return Result.ok("添加成功!");
 	}
@@ -124,6 +132,11 @@ public class ConferenceApplyController extends JeecgController<ConferenceApply,
 	@ApiOperation(value="会务安排申请-批量删除", notes="会务安排申请-批量删除")
 	@DeleteMapping(value = "/deleteBatch")
 	public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		Collection<ConferenceApply> conferenceApplies = this.conferenceApplyService.listByIds(Arrays.asList(ids.split(",")));
+		long count = conferenceApplies.stream().filter(i -> "是".equals(i.getNotified())).count();
+		if(count>0){
+			return Result.error("已通知会议,不能删除!");
+		}
 		this.conferenceApplyService.removeByIds(Arrays.asList(ids.split(",")));
 		return Result.ok("批量删除成功!");
 	}
@@ -168,4 +181,35 @@ public class ConferenceApplyController extends JeecgController<ConferenceApply,
         return super.importExcel(request, response, ConferenceApply.class);
     }
 
+
+	 /**
+	  *   通过id通知与会人员
+	  *
+	  * @param id
+	  * @return
+	  */
+	 @AutoLog(value = "会务安排申请-通过id通知与会人员")
+	 @ApiOperation(value="会务安排申请-通过id通知与会人员", notes="会务安排申请-通过id通知与会人员")
+	 @GetMapping(value = "/notify")
+	 public Result<?> notify(@RequestParam(name="id",required=true) String id) {
+		 LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+		 ConferenceApply conferenceApply = this.conferenceApplyService.getById(id);
+		 String attendPerson = conferenceApply.getAttendPersonIds();
+		 if (StringUtils.isBlank(attendPerson)) {
+			 return Result.error("请先选择与会人员");
+		 }
+		 List<String> userList = Arrays.asList(attendPerson.split(","));
+		 String msgContent = "";
+		 msgContent += "<h2>会议主题:" + conferenceApply.getConferenceTitle() + "</h2><br>";
+		 msgContent += "<h3>会议时间:"+ DateUtil.format(conferenceApply.getStartTime(),"yyyy-MM-dd HH:mm") +" ~ "+DateUtil.format(conferenceApply.getEndTime(),"yyyy-MM-dd HH:mm")+"</h3>";
+		 msgContent += "<h3>会议地点:"+conferenceApply.getConferenceAddress()+"</h3>";
+		 msgContent += "<h3>会议内容:<br>"+conferenceApply.getConferenceContent()+"</h3>";
+
+		 for (String o:userList){
+			 sysBaseAPI.sendSysAnnouncement(loginUser,loginUser.getUsername(),o,"会议通知",msgContent, CommonConstant.MSG_CATEGORY_2,new HashMap<>());
+		 }
+		 conferenceApply.setNotified("是");
+		 this.conferenceApplyService.saveOrUpdate(conferenceApply);
+		 return Result.ok("通知成功!");
+	 }
 }

+ 14 - 6
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/entity/ConferenceApply.java

@@ -84,15 +84,15 @@ public class ConferenceApply implements Serializable {
     @ApiModelProperty(value = "会议日期")
     private Date conferenceDate;
 	/**开始时间*/
-	@Excel(name = "开始时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+	@Excel(name = "开始时间", width = 20, format = "yyyy-MM-dd HH:mm")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
     @ApiModelProperty(value = "开始时间")
     private Date startTime;
 	/**结束时间*/
-	@Excel(name = "结束时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+	@Excel(name = "结束时间", width = 20, format = "yyyy-MM-dd HH:mm")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
     @ApiModelProperty(value = "结束时间")
     private Date endTime;
 	/**会议地点*/
@@ -103,6 +103,10 @@ public class ConferenceApply implements Serializable {
 	@Excel(name = "出席人员", width = 15)
     @ApiModelProperty(value = "出席人员")
     private String attendPerson;
+    /**出席人员*/
+    @Excel(name = "出席人员ID", width = 15)
+    @ApiModelProperty(value = "出席人员ID")
+    private String attendPersonIds;
 	/**出席部门*/
 	@Excel(name = "出席部门", width = 15)
     @ApiModelProperty(value = "出席部门")
@@ -123,4 +127,8 @@ public class ConferenceApply implements Serializable {
     @Excel(name = "会议类别", width = 15)
     @ApiModelProperty(value = "会议类别")
     private String conferenceType;
+    /**会议类别*/
+    @Excel(name = "已通知", width = 15)
+    @ApiModelProperty(value = "已通知")
+    private String notified;
 }