查询参数
This commit is contained in:
parent
daee5b4c35
commit
c8b05f5ef1
|
|
@ -30,6 +30,7 @@ public class AddUpDeductionBiz extends BaseBean {
|
|||
* @return
|
||||
*/
|
||||
public List<AddUpDeductionListDTO> list(AddUpDeductionQueryParam param) {
|
||||
//fixme 入职日期用的创建日期
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
AddUpDeductionMapper mapper = sqlSession.getMapper(AddUpDeductionMapper.class);
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ public class AddUpDeductionGetSearchConditionCmd extends AbstractCommonCommand<M
|
|||
conditionItems.add(username);
|
||||
|
||||
|
||||
SearchConditionItem departmentName = conditionFactory.createCondition(ConditionType.BROWSER,502227,"browser","departmentName");
|
||||
SearchConditionItem departmentName = conditionFactory.createCondition(ConditionType.BROWSER,502227,"departmentName","124");
|
||||
departmentName.setColSpan(2);
|
||||
departmentName.setFieldcol(12);
|
||||
departmentName.setLabelcol(6);
|
||||
|
|
|
|||
|
|
@ -1,22 +1,20 @@
|
|||
package com.engine.salary.cmd.datacollection;
|
||||
|
||||
import com.cloudstore.eccom.constant.WeaBoolAttr;
|
||||
import com.cloudstore.eccom.pc.table.WeaTable;
|
||||
import com.cloudstore.eccom.pc.table.WeaTableColumn;
|
||||
import com.cloudstore.eccom.pc.table.WeaTableOperate;
|
||||
import com.cloudstore.eccom.pc.table.WeaTableOperates;
|
||||
import com.cloudstore.eccom.result.WeaResultMsg;
|
||||
import com.engine.common.biz.AbstractCommonCommand;
|
||||
import com.engine.common.entity.BizLogContext;
|
||||
import com.engine.core.interceptor.CommandContext;
|
||||
import com.engine.salary.component.SalaryWeaTable;
|
||||
import com.engine.salary.entity.datacollection.param.AddUpDeductionQueryParam;
|
||||
import com.engine.salary.entity.datacollection.vo.AddUpDeductionVO;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.general.PageIdConst;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class AddUpDeductionListCmd extends AbstractCommonCommand<Map<String, Object>> {
|
||||
|
|
@ -55,19 +53,7 @@ public class AddUpDeductionListCmd extends AbstractCommonCommand<Map<String, Obj
|
|||
" LEFT JOIN hrmresource e ON t1.employee_id = e.id" +
|
||||
" LEFT JOIN hrmdepartment d ON e.departmentid = d.id";
|
||||
|
||||
|
||||
Map<String, Object> apidatas = new HashMap<String, Object>(16);
|
||||
|
||||
WeaResultMsg result = new WeaResultMsg(false);
|
||||
String pageID = "a4f85287-e3f9-4275-adn9-7d06e54y6rj8";
|
||||
String pageUid = pageID + "_" + user.getUID();
|
||||
String pageSize = PageIdConst.getPageSize(pageID, user.getUID());
|
||||
|
||||
|
||||
WeaTable table = new WeaTable();
|
||||
table.setPageUID(pageUid);
|
||||
table.setPageID(pageID);
|
||||
table.setPagesize(pageSize);
|
||||
SalaryWeaTable<AddUpDeductionVO> table = new SalaryWeaTable<>(user, AddUpDeductionVO.class);
|
||||
table.setBackfields(fileds);
|
||||
table.setSqlform(fromSql);
|
||||
table.setSqlwhere(makeSqlWhere());
|
||||
|
|
@ -75,30 +61,10 @@ public class AddUpDeductionListCmd extends AbstractCommonCommand<Map<String, Obj
|
|||
table.setSqlprimarykey("t1.id");
|
||||
table.setSqlisdistinct("false");
|
||||
|
||||
table.getColumns().add(new WeaTableColumn("id").setDisplay(WeaBoolAttr.FALSE));
|
||||
table.getColumns().add(new WeaTableColumn("10%", "姓名", "username", ""));
|
||||
table.getColumns().add(new WeaTableColumn("10%", "个税扣缴义务人", "taxAgentName", ""));
|
||||
table.getColumns().add(new WeaTableColumn("10%", "部门", "departmentName", ""));
|
||||
table.getColumns().add(new WeaTableColumn("10%", "手机号", "mobile", ""));
|
||||
table.getColumns().add(new WeaTableColumn("10%", "工号", "jobNum", ""));
|
||||
table.getColumns().add(new WeaTableColumn("10%", "证件号码", "idNo", ""));
|
||||
table.getColumns().add(new WeaTableColumn("10%", "入职日期", "hiredate", ""));
|
||||
table.getColumns().add(new WeaTableColumn("20%", "操作", "operate", ""));
|
||||
|
||||
List<WeaTableOperate> operateList = new ArrayList<>();
|
||||
WeaTableOperate delete = new WeaTableOperate("删除", "", "0");
|
||||
operateList.add(delete);
|
||||
WeaTableOperates weaTableOperates = new WeaTableOperates();
|
||||
weaTableOperates.setOperate(operateList);
|
||||
table.setOperates(weaTableOperates);
|
||||
|
||||
//设置check是否可用
|
||||
table.setCheckboxList(null);
|
||||
table.setCheckboxpopedom(null);
|
||||
WeaResultMsg result = new WeaResultMsg(false);
|
||||
result.putAll(table.makeDataResult());
|
||||
result.success();
|
||||
apidatas = result.getResultMap();
|
||||
return apidatas;
|
||||
return result.getResultMap();
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -161,7 +127,7 @@ public class AddUpDeductionListCmd extends AbstractCommonCommand<Map<String, Obj
|
|||
sqlWhere += " AND e.workcode like '%" + jobNum + "%'";
|
||||
}
|
||||
//入职日期
|
||||
List<LocalDate> hiredate = queryParam.getHiredate();
|
||||
List<Date> hiredate = queryParam.getHiredate();
|
||||
if (CollectionUtils.isNotEmpty(hiredate) && hiredate.size() == 2) {
|
||||
sqlWhere += " AND (e.created BETWEEN "+hiredate.get(0)+" AND "+hiredate.get(1)+")";
|
||||
}
|
||||
|
|
@ -173,6 +139,4 @@ public class AddUpDeductionListCmd extends AbstractCommonCommand<Map<String, Obj
|
|||
|
||||
return sqlWhere;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,105 @@
|
|||
package com.engine.salary.cmd.datacollection;
|
||||
|
||||
import com.api.browser.bean.SearchConditionGroup;
|
||||
import com.api.browser.bean.SearchConditionItem;
|
||||
import com.api.browser.bean.SearchConditionOption;
|
||||
import com.api.browser.util.ConditionFactory;
|
||||
import com.api.browser.util.ConditionType;
|
||||
import com.engine.common.biz.AbstractCommonCommand;
|
||||
import com.engine.common.entity.BizLogContext;
|
||||
import com.engine.core.interceptor.CommandContext;
|
||||
import weaver.hrm.User;
|
||||
import weaver.systeminfo.SystemEnv;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class AddUpSituationGetSearchConditionCmd extends AbstractCommonCommand<Map<String, Object>> {
|
||||
|
||||
public AddUpSituationGetSearchConditionCmd(Map<String, Object> params, User user) {
|
||||
this.user = user;
|
||||
this.params = params;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BizLogContext getLogContext() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> execute(CommandContext commandContext) {
|
||||
Map<String, Object> apidatas = new HashMap<String, Object>();
|
||||
ConditionFactory conditionFactory = new ConditionFactory(user);
|
||||
|
||||
//条件组
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<SearchConditionGroup>();
|
||||
|
||||
List<SearchConditionItem> conditionItems = new ArrayList<SearchConditionItem>();
|
||||
|
||||
//文本输入框
|
||||
SearchConditionItem username = conditionFactory.createCondition(ConditionType.INPUT,25034, "username");
|
||||
username.setColSpan(2);//定义一行显示条件数,默认值为2,当值为1时标识该条件单独占一行
|
||||
username.setFieldcol(16); //条件输入框所占宽度,默认值18
|
||||
username.setLabelcol(8);
|
||||
username.setViewAttr(2); // 编辑权限 1:只读,2:可编辑, 3:必填 默认2
|
||||
username.setLabel("姓名"); //设置文本值 这个将覆盖多语言标签的值
|
||||
conditionItems.add(username);
|
||||
|
||||
|
||||
SearchConditionItem departmentName = conditionFactory.createCondition(ConditionType.BROWSER,502227,"departmentName","124");
|
||||
departmentName.setColSpan(2);
|
||||
departmentName.setFieldcol(12);
|
||||
departmentName.setLabelcol(6);
|
||||
departmentName.setViewAttr(2);
|
||||
departmentName.setIsQuickSearch(false);
|
||||
departmentName.setLabel("部门");
|
||||
conditionItems.add(departmentName);
|
||||
|
||||
|
||||
SearchConditionItem jobNum = conditionFactory.createCondition(ConditionType.INPUT,25034, "jobNum");
|
||||
jobNum.setColSpan(2);
|
||||
jobNum.setFieldcol(16);
|
||||
jobNum.setLabelcol(8);
|
||||
jobNum.setViewAttr(2);
|
||||
jobNum.setLabel("工号");
|
||||
conditionItems.add(jobNum);
|
||||
|
||||
|
||||
|
||||
SearchConditionItem idNo = conditionFactory.createCondition(ConditionType.INPUT,25034, "idNo");
|
||||
idNo.setColSpan(2);
|
||||
idNo.setFieldcol(16);
|
||||
idNo.setLabelcol(8);
|
||||
idNo.setViewAttr(2);
|
||||
idNo.setLabel("证件号码");
|
||||
conditionItems.add(idNo);
|
||||
|
||||
//日期范围选项
|
||||
List<SearchConditionOption> dateOptions = new ArrayList<SearchConditionOption>();
|
||||
dateOptions.add(new SearchConditionOption("6", SystemEnv.getHtmlLabelName(32530, user.getLanguage()),true));//指定日期范围(必须为6)
|
||||
SearchConditionItem hiredate = conditionFactory.createCondition(ConditionType.RANGEPICKER, 18648, new String[]{"hiredate","hiredate"});
|
||||
hiredate.setFieldcol(16);
|
||||
hiredate.setLabelcol(8);
|
||||
hiredate.setViewAttr(2);
|
||||
hiredate.setLabel("入职日期");
|
||||
hiredate.setOptions(dateOptions);
|
||||
conditionItems.add(hiredate);
|
||||
|
||||
|
||||
SearchConditionItem mobile = conditionFactory.createCondition(ConditionType.INPUT,25034, "mobile");
|
||||
mobile.setColSpan(2);
|
||||
mobile.setFieldcol(16);
|
||||
mobile.setLabelcol(8);
|
||||
mobile.setViewAttr(2);
|
||||
mobile.setLabel("手机号");
|
||||
conditionItems.add(mobile);
|
||||
|
||||
addGroups.add(new SearchConditionGroup("常用条件",true,conditionItems));
|
||||
|
||||
apidatas.put("condition",addGroups);
|
||||
return apidatas;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,177 @@
|
|||
package com.engine.salary.cmd.datacollection;
|
||||
|
||||
import com.cloudstore.eccom.constant.WeaBoolAttr;
|
||||
import com.cloudstore.eccom.pc.table.WeaTable;
|
||||
import com.cloudstore.eccom.pc.table.WeaTableColumn;
|
||||
import com.cloudstore.eccom.pc.table.WeaTableOperate;
|
||||
import com.cloudstore.eccom.pc.table.WeaTableOperates;
|
||||
import com.cloudstore.eccom.result.WeaResultMsg;
|
||||
import com.engine.common.biz.AbstractCommonCommand;
|
||||
import com.engine.common.entity.BizLogContext;
|
||||
import com.engine.core.interceptor.CommandContext;
|
||||
import com.engine.salary.entity.datacollection.param.AddUpDeductionQueryParam;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.general.PageIdConst;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class AddUpSituationListCmd extends AbstractCommonCommand<Map<String, Object>> {
|
||||
|
||||
public AddUpSituationListCmd(Map<String, Object> params, User user) {
|
||||
this.user = user;
|
||||
this.params = params;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BizLogContext getLogContext() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> execute(CommandContext commandContext) {
|
||||
|
||||
String fileds = " t1.id," +
|
||||
" t1.declare_month," +
|
||||
" t1.employee_id," +
|
||||
" e.lastname as username," +
|
||||
" d.departmentname AS departmentName," +
|
||||
" e.mobile," +
|
||||
" e.workcode as job_num," +
|
||||
" e.created as hiredate," +
|
||||
" t2.name AS tax_agent_name," +
|
||||
" t1.add_up_child_education," +
|
||||
" t1.add_up_continuing_education," +
|
||||
" t1.add_up_housing_loan_interest," +
|
||||
" t1.add_up_housing_rent," +
|
||||
" t1.add_up_support_elderly";
|
||||
|
||||
String fromSql = " FROM" +
|
||||
" hrsa_add_up_deduction t1" +
|
||||
" LEFT JOIN hrsa_tax_agent t2 ON t1.tax_agent_id = t2.id" +
|
||||
" LEFT JOIN hrmresource e ON t1.employee_id = e.id" +
|
||||
" LEFT JOIN hrmdepartment d ON e.departmentid = d.id";
|
||||
|
||||
|
||||
Map<String, Object> apidatas = new HashMap<String, Object>(16);
|
||||
|
||||
WeaResultMsg result = new WeaResultMsg(false);
|
||||
String pageID = "a4f85287-e3f9-4275-adn9-7d06e54y6rj8";
|
||||
String pageUid = pageID + "_" + user.getUID();
|
||||
String pageSize = PageIdConst.getPageSize(pageID, user.getUID());
|
||||
|
||||
|
||||
WeaTable table = new WeaTable();
|
||||
table.setPageUID(pageUid);
|
||||
table.setPageID(pageID);
|
||||
table.setPagesize(pageSize);
|
||||
table.setBackfields(fileds);
|
||||
table.setSqlform(fromSql);
|
||||
table.setSqlwhere(makeSqlWhere());
|
||||
table.setSqlorderby("t1.id DESC");
|
||||
table.setSqlprimarykey("t1.id");
|
||||
table.setSqlisdistinct("false");
|
||||
|
||||
table.getColumns().add(new WeaTableColumn("id").setDisplay(WeaBoolAttr.FALSE));
|
||||
table.getColumns().add(new WeaTableColumn("10%", "姓名", "username", ""));
|
||||
table.getColumns().add(new WeaTableColumn("10%", "个税扣缴义务人", "taxAgentName", ""));
|
||||
table.getColumns().add(new WeaTableColumn("10%", "部门", "departmentName", ""));
|
||||
table.getColumns().add(new WeaTableColumn("10%", "手机号", "mobile", ""));
|
||||
table.getColumns().add(new WeaTableColumn("10%", "工号", "jobNum", ""));
|
||||
table.getColumns().add(new WeaTableColumn("10%", "证件号码", "idNo", ""));
|
||||
table.getColumns().add(new WeaTableColumn("10%", "入职日期", "hiredate", ""));
|
||||
table.getColumns().add(new WeaTableColumn("20%", "操作", "operate", ""));
|
||||
|
||||
List<WeaTableOperate> operateList = new ArrayList<>();
|
||||
WeaTableOperate delete = new WeaTableOperate("删除", "", "0");
|
||||
operateList.add(delete);
|
||||
WeaTableOperates weaTableOperates = new WeaTableOperates();
|
||||
weaTableOperates.setOperate(operateList);
|
||||
table.setOperates(weaTableOperates);
|
||||
|
||||
//设置check是否可用
|
||||
table.setCheckboxList(null);
|
||||
table.setCheckboxpopedom(null);
|
||||
result.putAll(table.makeDataResult());
|
||||
result.success();
|
||||
apidatas = result.getResultMap();
|
||||
return apidatas;
|
||||
}
|
||||
|
||||
|
||||
private String makeSqlWhere() {
|
||||
|
||||
AddUpDeductionQueryParam queryParam = (AddUpDeductionQueryParam) params.get("queryParam");
|
||||
//申报月份
|
||||
List<String> declareMonth = queryParam.getDeclareMonth();
|
||||
if (CollectionUtils.isNotEmpty(declareMonth)) {
|
||||
queryParam.setDeclareMonth(declareMonth.stream().map(e -> e + "-01 00:00:00").collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
String sqlWhere = "t1.delete_type = 0 AND t2.delete_type = 0";
|
||||
Collection<Long> ids = queryParam.getIds();
|
||||
if (CollectionUtils.isNotEmpty(ids)) {
|
||||
String idsStr = ids.stream().map(String::valueOf).collect(Collectors.joining(","));
|
||||
sqlWhere += " AND t1.id IN (" + idsStr + ")";
|
||||
}
|
||||
Long employeeId = queryParam.getEmployeeId();
|
||||
if (employeeId != null) {
|
||||
sqlWhere += " AND t1.employee_id =" + employeeId;
|
||||
}
|
||||
String keyword = queryParam.getKeyword();
|
||||
if (StringUtils.isNotBlank(keyword)) {
|
||||
sqlWhere += " AND (" +
|
||||
" e.lastname like '%" + keyword + "%'" +
|
||||
" OR d.departmentname like '%" + keyword + "%'" +
|
||||
" OR e.workcode like ''%"+keyword+"%'" +
|
||||
" )";
|
||||
}
|
||||
// 申报月份
|
||||
List<String> declareMonths = queryParam.getDeclareMonth();
|
||||
if (CollectionUtils.isNotEmpty(declareMonths)) {
|
||||
if (declareMonths.size() == 1) {
|
||||
sqlWhere += " AND t1.declare_month = " + declareMonths.get(0);
|
||||
}
|
||||
if (declareMonths.size() == 2) {
|
||||
sqlWhere += " AND (t1.declare_month BETWEEN " + declareMonths.get(0) + " AND " + declareMonths.get(1) + ")";
|
||||
}
|
||||
}
|
||||
//姓名
|
||||
String username = queryParam.getUsername();
|
||||
if (StringUtils.isNotBlank(username)) {
|
||||
sqlWhere += " AND e.lastname like '%" + username + "%'";
|
||||
}
|
||||
//个税扣缴义务人
|
||||
Long taxAgentId = queryParam.getTaxAgentId();
|
||||
if (taxAgentId != null) {
|
||||
sqlWhere += " AND t1.tax_agent_id = " + taxAgentId;
|
||||
}
|
||||
//部门
|
||||
List<Long> departmentIds = queryParam.getDepartmentIds();
|
||||
if (CollectionUtils.isNotEmpty(departmentIds)) {
|
||||
String departmentStrIds = departmentIds.stream().map(String::valueOf).collect(Collectors.joining(","));
|
||||
sqlWhere += " AND d.id IN (" + departmentStrIds + ")";
|
||||
}
|
||||
//工号
|
||||
String jobNum = queryParam.getJobNum();
|
||||
if (StringUtils.isNotBlank(jobNum)) {
|
||||
sqlWhere += " AND e.workcode like '%" + jobNum + "%'";
|
||||
}
|
||||
//入职日期
|
||||
List<Date> hiredate = queryParam.getHiredate();
|
||||
if (CollectionUtils.isNotEmpty(hiredate) && hiredate.size() == 2) {
|
||||
sqlWhere += " AND (e.created BETWEEN "+hiredate.get(0)+" AND "+hiredate.get(1)+")";
|
||||
}
|
||||
//手机号
|
||||
String mobile = queryParam.getMobile();
|
||||
if (StringUtils.isNotBlank(mobile)) {
|
||||
sqlWhere += " AND e.mobile like '%" + mobile + "%'";
|
||||
}
|
||||
|
||||
return sqlWhere;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -5,8 +5,8 @@ import lombok.Builder;
|
|||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -56,7 +56,7 @@ public class AddUpDeductionQueryParam {
|
|||
private String idNo;
|
||||
|
||||
//入职日期
|
||||
private List<LocalDate> hiredate;
|
||||
private List<Date> hiredate;
|
||||
|
||||
//手机号
|
||||
private String mobile;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,62 @@
|
|||
package com.engine.salary.entity.datacollection.param;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 数据采集-累计情况查询参数
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class AddUpSituationQueryParam{
|
||||
|
||||
//主键id
|
||||
private Collection<Long> ids;
|
||||
|
||||
//关键字(姓名、部门、工号)
|
||||
private String keyword;
|
||||
|
||||
//主键id
|
||||
private Long id;
|
||||
|
||||
//纳税年度
|
||||
private Integer year;
|
||||
|
||||
//税款所属期
|
||||
private List<String> taxYearMonth;
|
||||
|
||||
//姓名
|
||||
private String username;
|
||||
|
||||
//员工id
|
||||
private Long employeeId;
|
||||
|
||||
//个税扣缴义务人的主键id
|
||||
private Long taxAgentId;
|
||||
|
||||
//部门id
|
||||
private List<Long> departmentIds;
|
||||
|
||||
//工号
|
||||
private String jobNum;
|
||||
|
||||
//证件号
|
||||
private String idNo;
|
||||
|
||||
//入职日期
|
||||
private List<Date> hiredate;
|
||||
|
||||
//手机号
|
||||
private String mobile;
|
||||
|
||||
//累计情况id(获取明细)
|
||||
private Long accumulatedSituationId;
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
package com.engine.salary.entity.datacollection.vo;
|
||||
|
||||
import com.engine.salary.annotation.SalaryTable;
|
||||
import com.engine.salary.annotation.SalaryTableColumn;
|
||||
import com.engine.salary.annotation.SalaryTableOperate;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 数据采集-累计专项附加扣除表
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@SalaryTable(pageId = "a4f85287-e3f9-4275-adn9-7d06e54y6rj8", operates = {
|
||||
@SalaryTableOperate(text = "删除")
|
||||
})
|
||||
public class AddUpDeductionVO {
|
||||
|
||||
@SalaryTableColumn(column = "id", display = false)
|
||||
private Long id;
|
||||
@SalaryTableColumn(text = "姓名", width = "10%", column = "username")
|
||||
private String username;
|
||||
@SalaryTableColumn(text = "个税扣缴义务人", width = "10%", column = "taxAgentName")
|
||||
private String taxAgentName;
|
||||
@SalaryTableColumn(text = "部门", width = "10%", column = "departmentName")
|
||||
private String departmentName;
|
||||
@SalaryTableColumn(text = "手机号", width = "10%", column = "mobile")
|
||||
private String mobile;
|
||||
@SalaryTableColumn(text = "工号", width = "10%", column = "jobNum")
|
||||
private String jobNum;
|
||||
@SalaryTableColumn(text = "证件号码", width = "10%", column = "idNo")
|
||||
private String idNo;
|
||||
@SalaryTableColumn(text = "入职日期", width = "10%", column = "hiredate")
|
||||
private String hiredate;
|
||||
@SalaryTableColumn(text = "操作", width = "20%", column = "operate")
|
||||
private String operate;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,7 +1,11 @@
|
|||
package com.engine.salary.mapper.datacollection;
|
||||
|
||||
import com.engine.salary.entity.datacollection.AddUpDeduction;
|
||||
import com.engine.salary.entity.datacollection.AddUpSituation;
|
||||
import com.engine.salary.entity.datacollection.dto.AddUpDeductionListDTO;
|
||||
import com.engine.salary.entity.datacollection.param.AddUpDeductionQueryParam;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -63,5 +67,32 @@ public interface AddUpSituationMapper {
|
|||
* @return 返回影响行数
|
||||
*/
|
||||
int delete(AddUpSituation addUpSituation);
|
||||
|
||||
|
||||
/**
|
||||
* 查询数据采集-累计专项附加扣除列表
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<AddUpDeductionListDTO> list(@Param("param") AddUpDeductionQueryParam param);
|
||||
|
||||
/**
|
||||
* 根据条件查询
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<AddUpDeduction> listSome(@Param("param") AddUpDeduction param);
|
||||
|
||||
/**
|
||||
* 批量插入
|
||||
* @param pos
|
||||
*/
|
||||
void insertData(@Param("collection") List<AddUpDeduction> pos);
|
||||
|
||||
/**
|
||||
* 批量修改
|
||||
* @param updateList
|
||||
*/
|
||||
void updateData(@Param("collection") List<AddUpDeduction> updateList);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.engine.salary.service;
|
||||
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface AddUpSituationService {
|
||||
|
||||
Map<String, Object> list(Map<String, Object> params);
|
||||
|
||||
HSSFWorkbook export(Map<String, Object> params);
|
||||
|
||||
Map<String, Object> getSearchCondition(Map<String, Object> params);
|
||||
|
||||
Map<String, Object> importAddUpSituation(Map<String, Object> params);
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.cmd.datacollection.AddUpDeductionExportCmd;
|
||||
import com.engine.salary.cmd.datacollection.AddUpDeductionImportCmd;
|
||||
import com.engine.salary.cmd.datacollection.AddUpDeductionListCmd;
|
||||
import com.engine.salary.cmd.datacollection.AddUpSituationGetSearchConditionCmd;
|
||||
import com.engine.salary.service.AddUpSituationService;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class AddUpSituationServiceImpl extends Service implements AddUpSituationService {
|
||||
|
||||
@Override
|
||||
public Map<String, Object> list(Map<String, Object> params) {
|
||||
return commandExecutor.execute(new AddUpDeductionListCmd(params, user));
|
||||
}
|
||||
|
||||
@Override
|
||||
public HSSFWorkbook export(Map<String, Object> params) {
|
||||
return commandExecutor.execute(new AddUpDeductionExportCmd(params, user));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getSearchCondition(Map<String, Object> params) {
|
||||
return commandExecutor.execute(new AddUpSituationGetSearchConditionCmd(params, user));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> importAddUpSituation(Map<String, Object> params) {
|
||||
return commandExecutor.execute(new AddUpDeductionImportCmd(params, user));
|
||||
}
|
||||
}
|
||||
|
|
@ -8,7 +8,9 @@ import com.engine.salary.service.AddUpDeductionService;
|
|||
import com.engine.salary.service.impl.AddUpDeductionServiceImpl;
|
||||
import com.engine.salary.util.ResponseResult;
|
||||
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import weaver.general.GCONST;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
|
|
@ -26,7 +28,13 @@ import javax.ws.rs.core.StreamingOutput;
|
|||
import java.io.File;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class AddUpDeductionController {
|
||||
|
||||
|
|
@ -97,14 +105,16 @@ public class AddUpDeductionController {
|
|||
public Response export(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
|
||||
AddUpDeductionQueryParam param = buildParam(request);
|
||||
|
||||
Map<String, Object> map = ParamUtil.request2Map(request);
|
||||
map.put("addUpDeductionQueryParam", new AddUpDeductionQueryParam());
|
||||
map.put("addUpDeductionQueryParam", param);
|
||||
|
||||
HSSFWorkbook workbook = getService(user).export(map);
|
||||
|
||||
String fileName = null;
|
||||
try {
|
||||
fileName = URLEncoder.encode("累计专项附加扣除导入模板.xlsx", "UTF-8");
|
||||
fileName = URLEncoder.encode("累计专项附加扣除.xlsx", "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
@ -120,6 +130,74 @@ public class AddUpDeductionController {
|
|||
.header("Cache-Control", "no-cache").build();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private AddUpDeductionQueryParam buildParam(HttpServletRequest request) {
|
||||
AddUpDeductionQueryParam param = new AddUpDeductionQueryParam();
|
||||
String ids = request.getParameter("ids");
|
||||
if(StringUtils.isNotBlank(ids)){
|
||||
param.setIds( Arrays.stream(ids.split(",")).map(Long::valueOf).collect(Collectors.toList()));
|
||||
}
|
||||
String keyword = request.getParameter("keyword");
|
||||
if(StringUtils.isNotBlank(keyword)){
|
||||
param.setKeyword(keyword);
|
||||
}
|
||||
String id = request.getParameter("id");
|
||||
if(StringUtils.isNotBlank(id)){
|
||||
param.setId(Long.valueOf(id));
|
||||
}
|
||||
String declareMonth = request.getParameter("declareMonth");
|
||||
if(StringUtils.isNotBlank(declareMonth)){
|
||||
param.setDeclareMonth(Arrays.asList(declareMonth.split(",")));
|
||||
}
|
||||
|
||||
String username = request.getParameter("username");
|
||||
if(StringUtils.isNotBlank(username)){
|
||||
param.setUsername(username);
|
||||
}
|
||||
String employeeId = request.getParameter("employeeId");
|
||||
if(StringUtils.isNotBlank(employeeId)){
|
||||
param.setEmployeeId(Long.valueOf(employeeId));
|
||||
}
|
||||
String taxAgentId = request.getParameter("taxAgentId");
|
||||
if(StringUtils.isNotBlank(taxAgentId)){
|
||||
param.setTaxAgentId(Long.valueOf(taxAgentId));
|
||||
}
|
||||
String departmentIds = request.getParameter("departmentIds");
|
||||
if(StringUtils.isNotBlank(departmentIds)){
|
||||
param.setDepartmentIds(Arrays.stream(departmentIds.split(",")).map(Long::valueOf).collect(Collectors.toList()));
|
||||
}
|
||||
String jobNum = request.getParameter("jobNum");
|
||||
if(StringUtils.isNotBlank(jobNum)){
|
||||
param.setJobNum(jobNum);
|
||||
}
|
||||
String idNo = request.getParameter("idNo");
|
||||
if(StringUtils.isNotBlank(idNo)){
|
||||
param.setIdNo(idNo);
|
||||
}
|
||||
String hiredate = request.getParameter("hiredate");
|
||||
if(StringUtils.isNotBlank(hiredate)){
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
||||
List<Date> dates = Arrays.stream(hiredate.split(",")).map(d -> {
|
||||
try {
|
||||
return format.parse(d);
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}).collect(Collectors.toList());
|
||||
param.setHiredate(dates);
|
||||
}
|
||||
String mobile = request.getParameter("mobile");
|
||||
if(StringUtils.isNotBlank(mobile)){
|
||||
param.setMobile(mobile);
|
||||
}
|
||||
String accumulatedSpecialAdditionalDeductionId = request.getParameter("accumulatedSpecialAdditionalDeductionId");
|
||||
if(StringUtils.isNotBlank(accumulatedSpecialAdditionalDeductionId)){
|
||||
param.setAccumulatedSpecialAdditionalDeductionId(Long.valueOf(accumulatedSpecialAdditionalDeductionId));
|
||||
}
|
||||
return param;
|
||||
}
|
||||
|
||||
//新建个税扣缴义务人
|
||||
@POST
|
||||
@Path("/importAddUpDeduction")
|
||||
|
|
|
|||
|
|
@ -5,15 +5,18 @@ import com.alibaba.fastjson.serializer.SerializerFeature;
|
|||
import com.cloudstore.eccom.result.WeaResultMsg;
|
||||
import com.engine.common.util.ParamUtil;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.salary.component.SalaryWeaTable;
|
||||
import com.engine.salary.entity.datacollection.AddUpSituation;
|
||||
import com.engine.salary.entity.datacollection.param.AddUpDeductionImportParam;
|
||||
import com.engine.salary.entity.datacollection.param.AddUpDeductionQueryParam;
|
||||
import com.engine.salary.service.AddUpDeductionService;
|
||||
import com.engine.salary.service.impl.AddUpDeductionServiceImpl;
|
||||
import com.engine.salary.entity.datacollection.param.AddUpSituationQueryParam;
|
||||
import com.engine.salary.service.AddUpSituationService;
|
||||
import com.engine.salary.service.impl.AddUpSituationServiceImpl;
|
||||
import com.engine.salary.util.ResponseResult;
|
||||
import com.engine.salary.component.SalaryWeaTable;
|
||||
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import weaver.general.GCONST;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
|
|
@ -31,12 +34,18 @@ import javax.ws.rs.core.StreamingOutput;
|
|||
import java.io.File;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class AddUpSituationController {
|
||||
|
||||
private AddUpDeductionService getService(User user) {
|
||||
return (AddUpDeductionService) ServiceUtil.getService(AddUpDeductionServiceImpl.class, user);
|
||||
private AddUpSituationService getService(User user) {
|
||||
return (AddUpSituationService) ServiceUtil.getService(AddUpSituationServiceImpl.class, user);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -131,15 +140,88 @@ public class AddUpSituationController {
|
|||
.header("Cache-Control", "no-cache").build();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private AddUpSituationQueryParam buildParam(HttpServletRequest request) {
|
||||
AddUpSituationQueryParam param = new AddUpSituationQueryParam();
|
||||
String ids = request.getParameter("ids");
|
||||
if(StringUtils.isNotBlank(ids)){
|
||||
param.setIds( Arrays.stream(ids.split(",")).map(Long::valueOf).collect(Collectors.toList()));
|
||||
}
|
||||
String keyword = request.getParameter("keyword");
|
||||
if(StringUtils.isNotBlank(keyword)){
|
||||
param.setKeyword(keyword);
|
||||
}
|
||||
String id = request.getParameter("id");
|
||||
if(StringUtils.isNotBlank(id)){
|
||||
param.setId(Long.valueOf(id));
|
||||
}
|
||||
String year = request.getParameter("year");
|
||||
if(StringUtils.isNotBlank(year)){
|
||||
param.setYear(Integer.valueOf(year));
|
||||
}
|
||||
|
||||
String taxYearMonth = request.getParameter("taxYearMonth");
|
||||
if(StringUtils.isNotBlank(taxYearMonth)){
|
||||
param.setTaxYearMonth(Arrays.asList(taxYearMonth.split(",")));
|
||||
}
|
||||
|
||||
String username = request.getParameter("username");
|
||||
if(StringUtils.isNotBlank(username)){
|
||||
param.setUsername(username);
|
||||
}
|
||||
String employeeId = request.getParameter("employeeId");
|
||||
if(StringUtils.isNotBlank(employeeId)){
|
||||
param.setEmployeeId(Long.valueOf(employeeId));
|
||||
}
|
||||
String taxAgentId = request.getParameter("taxAgentId");
|
||||
if(StringUtils.isNotBlank(taxAgentId)){
|
||||
param.setTaxAgentId(Long.valueOf(taxAgentId));
|
||||
}
|
||||
String departmentIds = request.getParameter("departmentIds");
|
||||
if(StringUtils.isNotBlank(departmentIds)){
|
||||
param.setDepartmentIds(Arrays.stream(departmentIds.split(",")).map(Long::valueOf).collect(Collectors.toList()));
|
||||
}
|
||||
String jobNum = request.getParameter("jobNum");
|
||||
if(StringUtils.isNotBlank(jobNum)){
|
||||
param.setJobNum(jobNum);
|
||||
}
|
||||
String idNo = request.getParameter("idNo");
|
||||
if(StringUtils.isNotBlank(idNo)){
|
||||
param.setIdNo(idNo);
|
||||
}
|
||||
String hiredate = request.getParameter("hiredate");
|
||||
if(StringUtils.isNotBlank(hiredate)){
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
||||
List<Date> dates = Arrays.stream(hiredate.split(",")).map(d -> {
|
||||
try {
|
||||
return format.parse(d);
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}).collect(Collectors.toList());
|
||||
param.setHiredate(dates);
|
||||
}
|
||||
String mobile = request.getParameter("mobile");
|
||||
if(StringUtils.isNotBlank(mobile)){
|
||||
param.setMobile(mobile);
|
||||
}
|
||||
String accumulatedSituationId = request.getParameter("accumulatedSituationId");
|
||||
if(StringUtils.isNotBlank(accumulatedSituationId)){
|
||||
param.setAccumulatedSituationId(Long.valueOf(accumulatedSituationId));
|
||||
}
|
||||
return param;
|
||||
}
|
||||
|
||||
//新建个税扣缴义务人
|
||||
@POST
|
||||
@Path("/importAddUpDeduction")
|
||||
@Path("/importAddUpSituation")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String importAddUpDeduction(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody AddUpDeductionImportParam importParam) {
|
||||
public String importAddUpSituation(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody AddUpDeductionImportParam importParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> map = ParamUtil.request2Map(request);
|
||||
map.put("importParam", importParam);
|
||||
return ResponseResult.run(getService(user)::importAddUpDeduction, map);
|
||||
return ResponseResult.run(getService(user)::importAddUpSituation, map);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue