Browse Source

V3.4.3 工资条增加供应商字段

Qifeng-Wu 5 years atrás
parent
commit
e12229dec4

+ 6 - 0
happy-job-base-system/src/main/webapp/webpage/modules/hpuser/hpPayrollForm.jsp

@@ -66,6 +66,12 @@
 					</div>
 				</div>
 				<div class="form-group">
+					<label class="col-sm-2 control-label">供应商:</label>
+					<div class="col-sm-10">
+						<form:input path="supplier" htmlEscape="false"    class="form-control "/>
+					</div>
+				</div>
+				<div class="form-group">
 					<label class="col-sm-2 control-label">工资月份:</label>
 					<div class="col-sm-10">
 						<div class='input-group form_datetime' id='payrollDate'>

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

@@ -105,12 +105,22 @@ $(document).ready(function() {
 		         }
 		       
 		    },{
-                       field: 'companyName',
-                       title: '公司名称',
-                       sortable: false,
-                       sortName: 'companyName'
+                   field: 'companyName',
+                   title: '公司名称',
+                   sortable: false,
+                   sortName: 'companyName'
 
+               }
+               ,{
+                   field: 'supplier',
+                   title: '供应商',
+                   sortable: false,
+                   sortName: 'supplier',
+                   formatter:function(value, row , index){
+                       return value?value:"";
                    }
+
+               }
 			,{
 		        field: 'idCardNumber',
 		        title: '身份证号',

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

@@ -3,8 +3,8 @@
  */
 package com.jeeplus.modules.hpuser.entity;
 
-import java.math.BigDecimal;
-import java.util.Date;
+import org.hibernate.validator.constraints.Length;
+
 import com.fasterxml.jackson.annotation.JsonFormat;
 
 import com.jeeplus.core.persistence.DataEntity;
@@ -23,6 +23,7 @@ public class HpPayroll extends DataEntity<HpPayroll> {
 	private String idCardNumber;		// 身份证号
 	private String workNumber;		// 工号
 	private String companyName;		// 公司名称
+	private String supplier;		// 供应商
 	private String payrollDate;		// 工资月份
 	private Double grossPayment;		// 应发工资
 	private Double totalChargeback;		// 扣款合计
@@ -72,13 +73,22 @@ public class HpPayroll extends DataEntity<HpPayroll> {
 	public String getCompanyName() {
 		return companyName;
 	}
+	
+	@ExcelField(title="供应商", align=2, sort=5)
+	public String getSupplier() {
+		return supplier;
+	}
+
+	public void setSupplier(String supplier) {
+		this.supplier = supplier;
+	}
 
 	public void setCompanyName(String companyName) {
 		this.companyName = companyName;
 	}
 	
 	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-	@ExcelField(title="工资月份", align=2, sort=5)
+	@ExcelField(title="工资月份", align=2, sort=6)
 	public String getPayrollDate() {
 		return payrollDate;
 	}
@@ -87,7 +97,7 @@ public class HpPayroll extends DataEntity<HpPayroll> {
 		this.payrollDate = payrollDate;
 	}
 	
-	@ExcelField(title="应发工资", align=2, sort=6)
+	@ExcelField(title="应发工资", align=2, sort=7)
 	public Double getGrossPayment() {
 		return grossPayment;
 	}
@@ -96,7 +106,7 @@ public class HpPayroll extends DataEntity<HpPayroll> {
 		this.grossPayment = grossPayment;
 	}
 	
-	@ExcelField(title="扣款合计", align=2, sort=7)
+	@ExcelField(title="扣款合计", align=2, sort=8)
 	public Double getTotalChargeback() {
 		return totalChargeback;
 	}
@@ -105,7 +115,7 @@ public class HpPayroll extends DataEntity<HpPayroll> {
 		this.totalChargeback = totalChargeback;
 	}
 	
-	@ExcelField(title="实发工资", align=2, sort=8)
+	@ExcelField(title="实发工资", align=2, sort=9)
 	public Double getNetPayment() {
 		return netPayment;
 	}
@@ -114,7 +124,7 @@ public class HpPayroll extends DataEntity<HpPayroll> {
 		this.netPayment = netPayment;
 	}
 	
-	@ExcelField(title="额外信息", align=2, sort=9)
+	@ExcelField(title="额外信息", align=2, sort=10)
 	public String getPayrollDetail() {
 		return payrollDetail;
 	}

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

@@ -8,6 +8,7 @@
 		a.id_card_number AS "idCardNumber",
 		ifnull(a.work_number,'') AS "workNumber",
 		ifnull(a.company_name,'') AS "companyName",
+		ifnull(a.supplier,'') AS "supplier",
 		a.payroll_date AS "payrollDate",
 		a.gross_payment AS "grossPayment",
 		ifnull(a.total_chargeback,0) AS "totalChargeback",
@@ -97,6 +98,7 @@
 			id_card_number,
 			work_number,
 			company_name,
+			supplier,
 			payroll_date,
 			gross_payment,
 			total_chargeback,
@@ -110,6 +112,7 @@
 			#{idCardNumber},
 			#{workNumber},
 			#{companyName},
+			#{supplier},
 			#{payrollDate},
 			#{grossPayment},
 			#{totalChargeback},
@@ -127,6 +130,7 @@
 			id_card_number = #{idCardNumber},
 			work_number = #{workNumber},
 			company_name = #{companyName},
+			supplier = #{supplier},
 			payroll_date = #{payrollDate},
 			gross_payment = #{grossPayment},
 			total_chargeback = #{totalChargeback},

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

@@ -95,7 +95,16 @@ public class HpPayrollService extends CrudService<HpPayrollMapper, HpPayroll> {
                     list.add(errorMessage);
                     return list;
                 }
-                if ( StringUtils.isBlank(result[i][4].trim())) {
+                if (!StringUtils.isBlank(result[i][4].trim()) && result[i][4].trim().length()>20) {
+                    failureNum++;
+                    errorIndex=i+1;
+                    errorMessage="供应商不得超过20字";
+                    list.add(failureNum);
+                    list.add(errorIndex);
+                    list.add(errorMessage);
+                    return list;
+                }
+                if ( StringUtils.isBlank(result[i][5].trim())) {
                     failureNum++;
                     errorIndex=i+1;
                     errorMessage="工资月份为必填项";
@@ -104,7 +113,7 @@ public class HpPayrollService extends CrudService<HpPayrollMapper, HpPayroll> {
                     list.add(errorMessage);
                     return list;
                 }
-                if (StringUtils.isBlank(result[i][5].trim())) {
+                if (StringUtils.isBlank(result[i][6].trim())) {
                     failureNum++;
                     errorIndex=i+1;
                     errorMessage="应发合计为必填项";
@@ -113,7 +122,7 @@ public class HpPayrollService extends CrudService<HpPayrollMapper, HpPayroll> {
                     list.add(errorMessage);
                     return list;
                 }
-                if (StringUtils.isBlank(result[i][7].trim())) {
+                if (StringUtils.isBlank(result[i][8].trim())) {
                     failureNum++;
                     errorIndex=i+1;
                     errorMessage="实发工资为必填项";
@@ -125,8 +134,9 @@ public class HpPayrollService extends CrudService<HpPayrollMapper, HpPayroll> {
                 hpPayroll.setName(result[i][0]);
                 hpPayroll.setIdCardNumber(result[i][1].trim());
                 hpPayroll.setCompanyName(result[i][3]);
+                hpPayroll.setSupplier(result[i][4]);
                 hpPayroll.setWorkNumber(result[i][2]);
-                String date1=result[i][4].trim();
+                String date1=result[i][5].trim();
                 //校验日期
                 if(date1.length()!=7){
                     failureNum++;
@@ -216,9 +226,9 @@ public class HpPayrollService extends CrudService<HpPayrollMapper, HpPayroll> {
 //                }
 
                 Pattern pattern1 = Pattern.compile("^(([1-9]{1}\\d*)|([0]{1}))(\\.(\\d){0,2})?$");
-                if (result[i][5].trim()!="" && result[i][5].trim()!=null) {
-                    if(pattern1.matcher( result[i][5].trim()).matches()){
-                        hpPayroll.setGrossPayment(Double.parseDouble(result[i][5].trim()));
+                if (result[i][6].trim()!="" && result[i][6].trim()!=null) {
+                    if(pattern1.matcher( result[i][6].trim()).matches()){
+                        hpPayroll.setGrossPayment(Double.parseDouble(result[i][6].trim()));
                     }else{
                         failureNum++;
                         errorIndex=i+1;
@@ -229,9 +239,9 @@ public class HpPayrollService extends CrudService<HpPayrollMapper, HpPayroll> {
                         return list;
                     }
                 }
-                if (result[i][6].trim()!="" && result[i][6].trim()!=null) {
-                    if(pattern1.matcher( result[i][6].trim()).matches()){
-                        hpPayroll.setTotalChargeback(Double.parseDouble(result[i][6].trim()));
+                if (result[i][7].trim()!="" && result[i][7].trim()!=null) {
+                    if(pattern1.matcher( result[i][7].trim()).matches()){
+                        hpPayroll.setTotalChargeback(Double.parseDouble(result[i][7].trim()));
                     }else{
                         failureNum++;
                         errorIndex=i+1;
@@ -242,9 +252,9 @@ public class HpPayrollService extends CrudService<HpPayrollMapper, HpPayroll> {
                         return list;
                     }
                 }
-                if (result[i][7].trim()!="" && result[i][7].trim()!=null) {
-                    if(pattern1.matcher( result[i][7].trim()).matches()){
-                        hpPayroll.setNetPayment(Double.parseDouble(result[i][7].trim()));
+                if (result[i][8].trim()!="" && result[i][8].trim()!=null) {
+                    if(pattern1.matcher( result[i][8].trim()).matches()){
+                        hpPayroll.setNetPayment(Double.parseDouble(result[i][8].trim()));
                     }else{
                         failureNum++;
                         errorIndex=i+1;
@@ -258,7 +268,7 @@ public class HpPayrollService extends CrudService<HpPayrollMapper, HpPayroll> {
                 try {
                     JSONArray json = new JSONArray();
                     for (int k = 0; k < result[i].length; k++) {
-                        if (k > 7) {
+                        if (k > 8) {
                             if (StringUtils.isBlank(result[0][k])) {
                                 break;
                             }
@@ -273,7 +283,7 @@ public class HpPayrollService extends CrudService<HpPayrollMapper, HpPayroll> {
                 } catch (Exception e) {
                     failureNum++;
                     errorIndex=i+1;
-                    errorMessage="第列之后错误";
+                    errorMessage="第列之后错误";
                     list.add(failureNum);
                     list.add(errorIndex);
                     list.add(errorMessage);