Browse Source

工资条加已读未读状态

LiFei 4 years atrás
parent
commit
8f123e2b57

+ 9 - 0
happy-job-base-system/src/main/webapp/webpage/modules/hpuser/hpPayrollList.js

@@ -167,6 +167,15 @@ $(document).ready(function() {
 		        sortName: 'netPayment'
 		       
 		    },{
+                       field: 'isRead',
+                       title: '已读/未读状态',
+                       sortable: false,
+                       sortName: 'isRead',
+                       formatter:function(value, row , index){
+                           return jp.getDictLabel(${fns:toJson(fns:getDictList('is_read'))}, value, "-");
+                       }
+
+                   },{
                        field: 'createBy.name',
                        title: '导入人',
                        sortable: false,

+ 9 - 0
happy-job-module-hpjob/src/main/java/com/jeeplus/modules/hpuser/entity/HpPayroll.java

@@ -32,6 +32,7 @@ public class HpPayroll extends DataEntity<HpPayroll> {
     private Office office; //所属机构
 	private String month; //用于首页图表上上月
 	private String month1; //用于首页图表当前月
+	private Integer isRead; //是否已读
 	
 	public HpPayroll() {
 		super();
@@ -157,4 +158,12 @@ public class HpPayroll extends DataEntity<HpPayroll> {
 	public void setMonth1(String month1) {
 		this.month1 = month1;
 	}
+
+	public Integer getIsRead() {
+		return isRead;
+	}
+
+	public void setIsRead(Integer isRead) {
+		this.isRead = isRead;
+	}
 }

+ 7 - 3
happy-job-module-hpjob/src/main/java/com/jeeplus/modules/hpuser/mapper/xml/HpPayrollMapper.xml

@@ -17,6 +17,7 @@
 		a.create_date AS "createDate",
 		a.create_by AS "createBy.id",
 		a.office_id as "office.id",
+		a.is_read as "isRead",
 		su.name as "createBy.name"
 	</sql>
 	
@@ -106,7 +107,8 @@
 			payroll_detail,
 			create_date,
 			create_by,
-			office_id
+			office_id,
+			is_read
 		) VALUES (
 			#{name},
 			#{idCardNumber},
@@ -120,7 +122,8 @@
 			#{payrollDetail},
 			#{createDate},
 			#{createBy.id},
-			#{office.id}
+			#{office.id},
+			#{isRead}
 		)
 	</insert>
 	
@@ -136,7 +139,8 @@
 			total_chargeback = #{totalChargeback},
 			net_payment = #{netPayment},
 			payroll_detail = #{payrollDetail},
-			office_id = #{office.id}
+			office_id = #{office.id},
+			is_read = #{isRead}
 		WHERE id = #{id}
 	</update>
 	

+ 7 - 0
happy-job-module-hpjob/src/main/java/com/jeeplus/modules/hpuser/service/HpPayrollService.java

@@ -47,6 +47,8 @@ public class HpPayrollService extends CrudService<HpPayrollMapper, HpPayroll> {
     private HpUserService hpUserService;
     @Autowired
     private HpMemberService hpMemberService;
+    @Autowired
+    private HpPayrollService hpPayrollService;
 
     public HpPayroll get(String id) {
         return super.get(id);
@@ -497,6 +499,11 @@ public class HpPayrollService extends CrudService<HpPayrollMapper, HpPayroll> {
             if (TokenUtil.validateToken(userId, userToken)) {
                 String hpPayrollId = requestMap.get("hpPayroll_id");  //薪资id
                 HpPayroll hpPayroll=get(hpPayrollId);
+                //阅读之后设置已读
+                if(hpPayroll.getIsRead()!=1){
+                    hpPayroll.setIsRead(1);
+                    hpPayrollService.save(hpPayroll);
+                }
                 returnMap.put("hpPayroll", hpPayroll);
             } else {
                 returnMap.put("success", "1004");