yue 5 lat temu
rodzic
commit
65d184a54f

+ 68 - 1
src/main/java/com/jeeplus/modules/sg/information/service/InformationService.java

@@ -142,6 +142,7 @@ public class InformationService extends CrudService<InformationMapper, Informati
 
 	public List<Material> allNoBack(List<Information> page) {
 		List<Material> materialList = informationMapper.allNoBack(page);
+
 		return materialList;
 	}
 
@@ -152,10 +153,76 @@ public class InformationService extends CrudService<InformationMapper, Informati
 
 	public List<Information> exportInfor(List<Information> list) {
 		List<Information> informationList = informationMapper.exportInfor(list);
+		Calendar cal = Calendar.getInstance();
+		long between_days = 0;
+		for (Information in : informationList) {
+			if (in.getApprovalDate() != null) {
+				cal.setTime(in.getApprovalDate());
+				long appDay = cal.getTimeInMillis();
+				if (in.getFirstFinishDate() != null && in.getSecondFinishDate() != null) {
+					if (in.getSecondFinishDate() != null) {
+						cal.setTime(in.getSecondFinishDate());
+						long secondDate = cal.getTimeInMillis();
+						between_days=(secondDate-appDay)/(1000*3600*24);
+						in.setFinishDate(String.valueOf(between_days)+"天");
+						if (between_days>14) {
+							in.setOverdue("是");
+						} else{
+							in.setOverdue("否");
+						}
+					}
+					else {
+						cal.setTime(in.getFirstFinishDate());
+						long firstDate = cal.getTimeInMillis();
+						between_days=(firstDate-appDay)/(1000*3600*24);
+						in.setFinishDate(String.valueOf(between_days)+"天");
+					}
+				} else {
+					cal.setTime(new Date());
+					long nowDate = cal.getTimeInMillis();
+					between_days=(nowDate-appDay)/(1000*3600*24);
+					in.setFinishDate(String.valueOf(between_days)+"天");
+				}
+			}
+		}
 		return informationList;
 	}
 
 	public List<Information> export(List<Information> list) {
-		return informationMapper.export(list);
+		List<Information> export = informationMapper.export(list);
+		Calendar cal = Calendar.getInstance();
+		long between_days = 0;
+		for (Information in : export) {
+			if (in.getApprovalDate() != null) {
+				cal.setTime(in.getApprovalDate());
+				long appDay = cal.getTimeInMillis();
+				if (in.getFirstFinishDate() != null && in.getSecondFinishDate() != null) {
+					if (in.getSecondFinishDate() != null) {
+						cal.setTime(in.getSecondFinishDate());
+						long secondDate = cal.getTimeInMillis();
+						between_days=(secondDate-appDay)/(1000*3600*24);
+						in.setFinishDate(String.valueOf(between_days)+"天");
+						if (between_days>14) {
+							in.setOverdue("是");
+						} else{
+							in.setOverdue("否");
+						}
+					}
+					else {
+						cal.setTime(in.getFirstFinishDate());
+						long firstDate = cal.getTimeInMillis();
+						between_days=(firstDate-appDay)/(1000*3600*24);
+						in.setFinishDate(String.valueOf(between_days)+"天");
+					}
+				} else {
+					cal.setTime(new Date());
+					long nowDate = cal.getTimeInMillis();
+					between_days=(nowDate-appDay)/(1000*3600*24);
+					in.setFinishDate(String.valueOf(between_days)+"天");
+				}
+			}
+		}
+
+		return export;
 	}
 }

+ 7 - 3
src/main/java/com/jeeplus/modules/sg/information/utils/ImportInformation.java

@@ -80,7 +80,6 @@ public  class ImportInformation {
                     isBackNo = 1;
                 }
 
-
                 material.setInforId(inforId.toString());
                 material.setProjectId(projectId.toString());
                 material.setMaterialName(materialName.toString());
@@ -292,14 +291,19 @@ public  class ImportInformation {
                     error.add(projectId.toString());
                     continue;
                 }
-
+                String infoW = "";
                 if (status.equals("") || status == null) {
                     continue;
                 } else {
                     material.setProjectId(projectId.toString());
                     material.setInforId(inforId.toString());
                     material.setStatus(status.toString());
-                    material.setInfo(info.toString());
+                    if (info == null || info.equals("")) {
+                         infoW = "";
+                    } else {
+                         infoW = info.toString();
+                    }
+                    material.setInfo(infoW);
                     material.setIsBackNo(0);
                     materialList.add(material);
                 }

+ 7 - 4
src/main/java/com/jeeplus/modules/sg/material/mapper/xml/MaterialMapper.xml

@@ -249,18 +249,21 @@
     </update>
 
     <update id="updateStatus" parameterType="com.jeeplus.modules.sg.material.entity.Material">
-        <foreach collection="list" item="item" index="index">
+        <foreach collection="list" item="item" index="index" separator=";">
         update material_information
             <trim prefix="set" suffixOverrides=",">
-                isBackNo=0,
-                isBack='是',
+                <if test="item.isBackNo!=null">
+                     isBackNo=0,
+                </if>
+                <if test="item.isBack!=null">
+                    isBack='是',
+                </if>
                 <if test="item.status!=null and item.status != ''">
                     status=#{item.status},
                 </if>
                 <if test="item.info!=null and item.info != ''">
                     info=#{item.info},
                 </if>
-
             </trim>
             where project_id=#{item.projectId} and infor_id=#{item.inforId}
         </foreach>

+ 1 - 1
src/main/webapp/webpage/modules/sg/information/informationList.js

@@ -36,7 +36,7 @@ $(document).ready(function() {
                //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
                cache: false,
                //是否显示分页(*)
-               pagination: false,
+               pagination: true,
                 //排序方式
                sortOrder: "asc",
                //初始化加载第一页,默认第一页