diff --git a/src/com/engine/salary/cmd/TaxDeclaration/TaxDeclarationDeleteCmd.java b/src/com/engine/salary/cmd/TaxDeclaration/TaxDeclarationDeleteCmd.java new file mode 100644 index 000000000..36b10d47a --- /dev/null +++ b/src/com/engine/salary/cmd/TaxDeclaration/TaxDeclarationDeleteCmd.java @@ -0,0 +1,48 @@ +package com.engine.salary.cmd.TaxDeclaration; + +import com.engine.common.biz.AbstractCommonCommand; +import com.engine.common.entity.BizLogContext; +import com.engine.core.interceptor.CommandContext; +import com.engine.salary.biz.TaxRateBiz; +import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.util.DataUtil; +import org.apache.commons.collections4.CollectionUtils; +import weaver.hrm.User; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public class TaxDeclarationDeleteCmd extends AbstractCommonCommand> { + + public TaxDeclarationDeleteCmd(Map params, User user) { + this.user = user; + this.params = params; + } + + @Override + public BizLogContext getLogContext() { + return null; + } + + @Override + public Map execute(CommandContext commandContext) { + Map apidatas = new HashMap(16); + + + List idStrs = DataUtil.castList(params.get("ids"), String.class); + if (CollectionUtils.isEmpty(idStrs)) { + throw new SalaryRunTimeException("参数错误"); + } + List ids = idStrs.stream().map(Long::valueOf).collect(Collectors.toList()); + TaxRateBiz taxRateBiz = new TaxRateBiz(); + + taxRateBiz.deleteByIds(ids); + + return apidatas; + } + + + +} diff --git a/src/com/engine/salary/cmd/TaxDeclaration/TaxDeclarationListCmd.java b/src/com/engine/salary/cmd/TaxDeclaration/TaxDeclarationListCmd.java new file mode 100644 index 000000000..f8bc26ded --- /dev/null +++ b/src/com/engine/salary/cmd/TaxDeclaration/TaxDeclarationListCmd.java @@ -0,0 +1,83 @@ +package com.engine.salary.cmd.TaxDeclaration; + +import com.cloudstore.eccom.constant.WeaBoolAttr; +import com.cloudstore.eccom.pc.table.WeaTable; +import com.cloudstore.eccom.pc.table.WeaTableColumn; +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 org.apache.commons.lang3.StringUtils; +import weaver.general.PageIdConst; +import weaver.general.Util; +import weaver.hrm.User; + +import java.util.HashMap; +import java.util.Map; + +public class TaxDeclarationListCmd extends AbstractCommonCommand> { + + public TaxDeclarationListCmd(Map params, User user) { + this.user = user; + this.params = params; + } + + @Override + public BizLogContext getLogContext() { + return null; + } + + @Override + public Map execute(CommandContext commandContext) { + + Map apidatas = new HashMap(16); + + WeaResultMsg result = new WeaResultMsg(false); + String pageID = "a4f85287-e3f9-4275-9527-7d06e54y6rj8"; + String pageUid = pageID + "_" + user.getUID(); + String pageSize = PageIdConst.getPageSize(pageID, user.getUID()); + + + String fileds = " create_time,creator,delete_type, description, id, name, system_type, tenant_key, update_time"; + String sql = " from hrsa_sys_tax_rate_base s " + + " where s.delete_type = 0"; + //模糊查询 + String name = Util.null2String(params.get("name")); + if (StringUtils.isNotBlank(name)) { + sql += " and s.name like '%" + name + "%' "; + } + sql += " union all " + + " select create_time,creator,delete_type, description, id, name, system_type, tenant_key, update_time " + + " from hrsa_tax_rate_base b " + + " where b.delete_type = 0 "; + //模糊查询 + if (StringUtils.isNotBlank(name)) { + sql += " and b.name like '%" + name + "%' "; + } + + WeaTable table = new WeaTable(); + table.setPageUID(pageUid); + table.setPageID(pageID); + table.setPagesize(pageSize); + table.setBackfields(fileds); + table.setSqlform(sql); +// table.setSqlwhere(); + table.setSqlorderby("id desc"); + table.setSqlprimarykey("id"); + table.setSqlisdistinct("false"); + + table.getColumns().add(new WeaTableColumn("id").setDisplay(WeaBoolAttr.FALSE)); + table.getColumns().add(new WeaTableColumn("20%", "名称", "name", "")); + table.getColumns().add(new WeaTableColumn("20%", "名称", "systemType", "")); + table.getColumns().add(new WeaTableColumn("20%", "名称", "createTime", "")); + table.getColumns().add(new WeaTableColumn("20%", "名称", "description", "")); + + //设置check是否可用 + table.setCheckboxList(null); + table.setCheckboxpopedom(null); + result.putAll(table.makeDataResult()); + result.success(); + apidatas = result.getResultMap(); + return apidatas; + } +} diff --git a/src/com/engine/salary/cmd/TaxDeclaration/TaxDeclarationSaveCmd.java b/src/com/engine/salary/cmd/TaxDeclaration/TaxDeclarationSaveCmd.java new file mode 100644 index 000000000..ac62a96c5 --- /dev/null +++ b/src/com/engine/salary/cmd/TaxDeclaration/TaxDeclarationSaveCmd.java @@ -0,0 +1,33 @@ +package com.engine.salary.cmd.TaxDeclaration; + +import com.engine.common.biz.AbstractCommonCommand; +import com.engine.common.entity.BizLogContext; +import com.engine.core.interceptor.CommandContext; +import com.engine.salary.biz.TaxRateBiz; +import com.engine.salary.entity.taxrate.param.TaxRateSaveParam; +import weaver.hrm.User; + +import java.util.HashMap; +import java.util.Map; + +public class TaxDeclarationSaveCmd extends AbstractCommonCommand> { + + public TaxDeclarationSaveCmd(Map params, User user) { + this.user = user; + this.params = params; + } + + @Override + public BizLogContext getLogContext() { + return null; + } + + @Override + public Map execute(CommandContext commandContext) { + Map apidatas = new HashMap(16); + TaxRateBiz taxRateBiz = new TaxRateBiz(); + TaxRateSaveParam taxRateSaveParam = (TaxRateSaveParam) params.get("taxRateSaveParam"); + taxRateBiz.save(taxRateSaveParam, (long) user.getUID()); + return apidatas; + } +} diff --git a/src/com/engine/salary/cmd/TaxDeclaration/TaxDeclarationUpdateCmd.java b/src/com/engine/salary/cmd/TaxDeclaration/TaxDeclarationUpdateCmd.java new file mode 100644 index 000000000..3c015948c --- /dev/null +++ b/src/com/engine/salary/cmd/TaxDeclaration/TaxDeclarationUpdateCmd.java @@ -0,0 +1,33 @@ +package com.engine.salary.cmd.TaxDeclaration; + +import com.engine.common.biz.AbstractCommonCommand; +import com.engine.common.entity.BizLogContext; +import com.engine.core.interceptor.CommandContext; +import com.engine.salary.biz.TaxRateBiz; +import com.engine.salary.entity.taxrate.param.TaxRateSaveParam; +import weaver.hrm.User; + +import java.util.HashMap; +import java.util.Map; + +public class TaxDeclarationUpdateCmd extends AbstractCommonCommand> { + + public TaxDeclarationUpdateCmd(Map params, User user) { + this.user = user; + this.params = params; + } + + @Override + public BizLogContext getLogContext() { + return null; + } + + @Override + public Map execute(CommandContext commandContext) { + Map apidatas = new HashMap(16); + TaxRateBiz taxRateBiz = new TaxRateBiz(); + TaxRateSaveParam taxRateSaveParam = (TaxRateSaveParam) params.get("taxRateSaveParam"); + taxRateBiz.update(taxRateSaveParam, (long) user.getUID()); + return apidatas; + } +} diff --git a/src/com/engine/salary/entity/taxdeclaration/TaxDeclaration.java b/src/com/engine/salary/entity/taxdeclaration/TaxDeclaration.java new file mode 100644 index 000000000..086f0e45b --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/TaxDeclaration.java @@ -0,0 +1,59 @@ +package com.engine.salary.entity.taxdeclaration; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 个税申报表 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class TaxDeclaration { + /** + * 创建时间 + */ + private Date createTime; + /** + * 创建人 + */ + private Long creator; + /** + * 是否已删除。0:未删除、1:已删除 + */ + private Integer deleteType; + /** + * 备注 + */ + private String description; + /** + * 主键id + */ + private Long id; + /** + * 薪资所属月 + */ + private Date salaryMonth; + /** + * 个税扣缴义务人id + */ + private Long taxAgentId; + /** + * 税款所属期 + */ + private Date taxCycle; + /** + * 租户ID + */ + private String tenantKey; + /** + * 更新时间 + */ + private Date updateTime; + +} \ No newline at end of file diff --git a/src/com/engine/salary/entity/taxdeclaration/TaxDeclarationDetail.java b/src/com/engine/salary/entity/taxdeclaration/TaxDeclarationDetail.java new file mode 100644 index 000000000..371c5c524 --- /dev/null +++ b/src/com/engine/salary/entity/taxdeclaration/TaxDeclarationDetail.java @@ -0,0 +1,59 @@ +package com.engine.salary.entity.taxdeclaration; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 个税申报表详情 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class TaxDeclarationDetail { + /** + * 创建时间 + */ + private Date createTime; + /** + * 创建人 + */ + private Long creator; + /** + * 是否已删除。0:未删除、1:已删除 + */ + private Integer deleteType; + /** + * 人员id + */ + private Long employeeId; + /** + * 字段code + */ + private String fieldCode; + /** + * 字段的值 + */ + private String fieldValue; + /** + * 主键id + */ + private Long id; + /** + * 个税申报记录的id + */ + private Long taxDeclarationId; + /** + * 租户ID + */ + private String tenantKey; + /** + * 更新时间 + */ + private Date updateTime; + +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationDetailMapper.java b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationDetailMapper.java new file mode 100644 index 000000000..39242506c --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationDetailMapper.java @@ -0,0 +1,67 @@ +package com.engine.salary.mapper.taxdeclaration; + +import com.engine.salary.entity.taxdeclaration.TaxDeclarationDetail; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +@Mapper +public interface TaxDeclarationDetailMapper { + + /** + * 查询所有记录 + * + * @return 返回集合,没有返回空List + */ + List listAll(); + + + /** + * 根据主键查询 + * + * @param id 主键 + * @return 返回记录,没有返回null + */ + TaxDeclarationDetail getById(Long id); + + /** + * 新增,插入所有字段 + * + * @param taxDeclarationDetail 新增的记录 + * @return 返回影响行数 + */ + int insert(TaxDeclarationDetail taxDeclarationDetail); + + /** + * 新增,忽略null字段 + * + * @param taxDeclarationDetail 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(TaxDeclarationDetail taxDeclarationDetail); + + /** + * 修改,修改所有字段 + * + * @param taxDeclarationDetail 修改的记录 + * @return 返回影响行数 + */ + int update(TaxDeclarationDetail taxDeclarationDetail); + + /** + * 修改,忽略null字段 + * + * @param taxDeclarationDetail 修改的记录 + * @return 返回影响行数 + */ + int updateIgnoreNull(TaxDeclarationDetail taxDeclarationDetail); + + /** + * 删除记录 + * + * @param taxDeclarationDetail 待删除的记录 + * @return 返回影响行数 + */ + int delete(TaxDeclarationDetail taxDeclarationDetail); + +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationDetailMapper.xml b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationDetailMapper.xml new file mode 100644 index 000000000..e777cf3d9 --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationDetailMapper.xml @@ -0,0 +1,215 @@ + + + + + + + + + + + + + + + + + + + t + . + create_time + , t.creator + , t.delete_type + , t.employee_id + , t.field_code + , t.field_value + , t.id + , t.tax_declaration_id + , t.tenant_key + , t.update_time + + + + + + + + + + + INSERT INTO hrsa_tax_declaration_detail + + create_time, + creator, + delete_type, + employee_id, + field_code, + field_value, + id, + tax_declaration_id, + tenant_key, + update_time, + + + #{createTime}, + #{creator}, + #{deleteType}, + #{employeeId}, + #{fieldCode}, + #{fieldValue}, + #{id}, + #{taxDeclarationId}, + #{tenantKey}, + #{updateTime}, + + + + + + INSERT INTO hrsa_tax_declaration_detail + + + + create_time, + + + creator, + + + delete_type, + + + employee_id, + + + field_code, + + + field_value, + + + id, + + + tax_declaration_id, + + + tenant_key, + + + update_time, + + + + + #{createTime}, + + + #{creator}, + + + #{deleteType}, + + + #{employeeId}, + + + #{fieldCode}, + + + #{fieldValue}, + + + #{id}, + + + #{taxDeclarationId}, + + + #{tenantKey}, + + + #{updateTime}, + + + + + + + UPDATE hrsa_tax_declaration_detail + + create_time=#{createTime}, + creator=#{creator}, + delete_type=#{deleteType}, + employee_id=#{employeeId}, + field_code=#{fieldCode}, + field_value=#{fieldValue}, + tax_declaration_id=#{taxDeclarationId}, + tenant_key=#{tenantKey}, + update_time=#{updateTime}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_declaration_detail + + + create_time=#{createTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + employee_id=#{employeeId}, + + + field_code=#{fieldCode}, + + + field_value=#{fieldValue}, + + + tax_declaration_id=#{taxDeclarationId}, + + + tenant_key=#{tenantKey}, + + + update_time=#{updateTime}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_declaration_detail + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationMapper.java b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationMapper.java new file mode 100644 index 000000000..ba3011bcc --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationMapper.java @@ -0,0 +1,67 @@ +package com.engine.salary.mapper.taxdeclaration; + +import com.engine.salary.entity.taxdeclaration.TaxDeclaration; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +@Mapper +public interface TaxDeclarationMapper { + + /** + * 查询所有记录 + * + * @return 返回集合,没有返回空List + */ + List listAll(); + + + /** + * 根据主键查询 + * + * @param id 主键 + * @return 返回记录,没有返回null + */ + TaxDeclaration getById(Long id); + + /** + * 新增,插入所有字段 + * + * @param taxDeclaration 新增的记录 + * @return 返回影响行数 + */ + int insert(TaxDeclaration taxDeclaration); + + /** + * 新增,忽略null字段 + * + * @param taxDeclaration 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(TaxDeclaration taxDeclaration); + + /** + * 修改,修改所有字段 + * + * @param taxDeclaration 修改的记录 + * @return 返回影响行数 + */ + int update(TaxDeclaration taxDeclaration); + + /** + * 修改,忽略null字段 + * + * @param taxDeclaration 修改的记录 + * @return 返回影响行数 + */ + int updateIgnoreNull(TaxDeclaration taxDeclaration); + + /** + * 删除记录 + * + * @param taxDeclaration 待删除的记录 + * @return 返回影响行数 + */ + int delete(TaxDeclaration taxDeclaration); + +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationMapper.xml b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationMapper.xml new file mode 100644 index 000000000..03080c4cf --- /dev/null +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationMapper.xml @@ -0,0 +1,215 @@ + + + + + + + + + + + + + + + + + + + t + . + create_time + , t.creator + , t.delete_type + , t.description + , t.id + , t.salary_month + , t.tax_agent_id + , t.tax_cycle + , t.tenant_key + , t.update_time + + + + + + + + + + + INSERT INTO hrsa_tax_declaration + + create_time, + creator, + delete_type, + description, + id, + salary_month, + tax_agent_id, + tax_cycle, + tenant_key, + update_time, + + + #{createTime}, + #{creator}, + #{deleteType}, + #{description}, + #{id}, + #{salaryMonth}, + #{taxAgentId}, + #{taxCycle}, + #{tenantKey}, + #{updateTime}, + + + + + + INSERT INTO hrsa_tax_declaration + + + + create_time, + + + creator, + + + delete_type, + + + description, + + + id, + + + salary_month, + + + tax_agent_id, + + + tax_cycle, + + + tenant_key, + + + update_time, + + + + + #{createTime}, + + + #{creator}, + + + #{deleteType}, + + + #{description}, + + + #{id}, + + + #{salaryMonth}, + + + #{taxAgentId}, + + + #{taxCycle}, + + + #{tenantKey}, + + + #{updateTime}, + + + + + + + UPDATE hrsa_tax_declaration + + create_time=#{createTime}, + creator=#{creator}, + delete_type=#{deleteType}, + description=#{description}, + salary_month=#{salaryMonth}, + tax_agent_id=#{taxAgentId}, + tax_cycle=#{taxCycle}, + tenant_key=#{tenantKey}, + update_time=#{updateTime}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_declaration + + + create_time=#{createTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + description=#{description}, + + + salary_month=#{salaryMonth}, + + + tax_agent_id=#{taxAgentId}, + + + tax_cycle=#{taxCycle}, + + + tenant_key=#{tenantKey}, + + + update_time=#{updateTime}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_tax_declaration + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + \ No newline at end of file diff --git a/src/com/engine/salary/service/TaxDeclarationService.java b/src/com/engine/salary/service/TaxDeclarationService.java index c3951ffde..32dbe8831 100644 --- a/src/com/engine/salary/service/TaxDeclarationService.java +++ b/src/com/engine/salary/service/TaxDeclarationService.java @@ -9,10 +9,10 @@ public interface TaxDeclarationService { */ Map listPage(Map params); - Map delete(Map params); - Map save(Map params); Map update(Map params); + Map delete(Map params); + } diff --git a/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java index 13a4d24a2..cec06fb8f 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java @@ -1,6 +1,10 @@ package com.engine.salary.service.impl; import com.engine.core.impl.Service; +import com.engine.salary.cmd.TaxDeclaration.TaxDeclarationDeleteCmd; +import com.engine.salary.cmd.TaxDeclaration.TaxDeclarationListCmd; +import com.engine.salary.cmd.TaxDeclaration.TaxDeclarationSaveCmd; +import com.engine.salary.cmd.TaxDeclaration.TaxDeclarationUpdateCmd; import com.engine.salary.service.TaxDeclarationService; import java.util.Map; @@ -9,22 +13,20 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration @Override public Map listPage(Map params) { - - return null; - } - - @Override - public Map delete(Map params) { - return null; + return commandExecutor.execute(new TaxDeclarationListCmd(params, user)); } @Override public Map save(Map params) { - return null; + return commandExecutor.execute(new TaxDeclarationSaveCmd(params, user)); } @Override public Map update(Map params) { - return null; + return commandExecutor.execute(new TaxDeclarationUpdateCmd(params, user)); + } + @Override + public Map delete(Map params) { + return commandExecutor.execute(new TaxDeclarationDeleteCmd(params, user)); } }