初始化项目结构、demo样例、mybatis使用样例
This commit is contained in:
commit
4a081d6ad9
|
|
@ -0,0 +1,7 @@
|
|||
package com.api.salary.web;
|
||||
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
@Path("/bs/hrmsalary/demo")
|
||||
public class DemoController extends com.engine.salary.web.DemoController{
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
package com.api.salary.web;
|
||||
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
@Path("/bs/hrmsalary/taxAgent")
|
||||
public class TaxAgentController extends com.engine.salary.web.TaxAgentController{
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
package com.api.salary.web;
|
||||
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
@Path("/bs/hrmsalary/taxrate")
|
||||
public class TaxRateController extends com.engine.salary.web.TaxRateController{
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package com.engine.salary.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Target({ElementType.FIELD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface TableTitle {
|
||||
String title();
|
||||
String dataIndex();
|
||||
String key();
|
||||
}
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
package com.engine.salary.cmd.TaxAgent;
|
||||
|
||||
import com.api.browser.bean.SearchConditionGroup;
|
||||
import com.api.browser.bean.SearchConditionItem;
|
||||
import com.api.browser.util.ConditionFactory;
|
||||
import com.api.browser.util.ConditionType;
|
||||
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.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.general.PageIdConst;
|
||||
import weaver.hrm.User;
|
||||
import weaver.systeminfo.SystemEnv;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class TaxAgentGetFromCmd extends AbstractCommonCommand<Map<String, Object>> {
|
||||
|
||||
public TaxAgentGetFromCmd(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>();
|
||||
|
||||
if (null == user) {
|
||||
apidatas.put("hasRight", false);
|
||||
return apidatas;
|
||||
}
|
||||
apidatas.put("hasRight", true);
|
||||
|
||||
ConditionFactory conditionFactory = new ConditionFactory(user);
|
||||
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<SearchConditionGroup>();
|
||||
List<SearchConditionItem> inputItems = new ArrayList<SearchConditionItem>();
|
||||
|
||||
//名称
|
||||
SearchConditionItem nameInput = conditionFactory.createCondition(ConditionType.INPUT, 502327, "name");
|
||||
nameInput.setColSpan(1);//定义一行显示条件数,默认值为2,当值为1时标识该条件单独占一行
|
||||
nameInput.setFieldcol(12); //条件输入框所占宽度,默认值18
|
||||
nameInput.setViewAttr(3); // 编辑权限 1:只读,2:可编辑, 3:必填 默认2
|
||||
nameInput.setLength(10); // 设置输入长度
|
||||
nameInput.setLabel("名称"); //设置文本值 这个将覆盖多语言标签的值
|
||||
nameInput.setRules("required"); //设置字段填入规则
|
||||
inputItems.add(nameInput);
|
||||
|
||||
//描述
|
||||
SearchConditionItem descriptionInput = conditionFactory.createCondition(ConditionType.INPUT, 502327, "description");
|
||||
descriptionInput.setColSpan(1);//定义一行显示条件数,默认值为2,当值为1时标识该条件单独占一行
|
||||
descriptionInput.setFieldcol(12); //条件输入框所占宽度,默认值18
|
||||
descriptionInput.setViewAttr(3); // 编辑权限 1:只读,2:可编辑, 3:必填 默认2
|
||||
descriptionInput.setLength(10); // 设置输入长度
|
||||
descriptionInput.setLabel("描述"); //设置文本值 这个将覆盖多语言标签的值
|
||||
inputItems.add(nameInput);
|
||||
|
||||
|
||||
addGroups.add(new SearchConditionGroup("", true, inputItems));
|
||||
|
||||
apidatas.put("condition", addGroups );
|
||||
|
||||
return apidatas;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,101 @@
|
|||
package com.engine.salary.cmd.TaxAgent;
|
||||
|
||||
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.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.general.PageIdConst;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class TaxAgentListCmd extends AbstractCommonCommand<Map<String, Object>> {
|
||||
|
||||
public TaxAgentListCmd(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>(16);
|
||||
|
||||
WeaResultMsg result = new WeaResultMsg(false);
|
||||
String pageID = "a4f85287-e3f9-4275-ab18-7d06e54y6rj8";
|
||||
String pageUid = pageID + "_" + user.getUID();
|
||||
String pageSize = PageIdConst.getPageSize(pageID, user.getUID());
|
||||
|
||||
|
||||
String fileds = "id, name, description, create_time, update_time, creator, delete_type, tenant_key";
|
||||
String fromSql = "FROM hrsa_tax_agent";
|
||||
String sqlWhere = makeSqlWhere(params);
|
||||
WeaTable table = new WeaTable();
|
||||
table.setPageUID(pageUid);
|
||||
table.setPageID(pageID);
|
||||
table.setPagesize(pageSize);
|
||||
table.setBackfields(fileds);
|
||||
table.setSqlform(fromSql);
|
||||
table.setSqlwhere(sqlWhere);
|
||||
table.setSqlorderby("id desc");
|
||||
table.setSqlprimarykey("id");
|
||||
table.setSqlisdistinct("false");
|
||||
|
||||
table.getColumns().add(new WeaTableColumn("id").setDisplay(WeaBoolAttr.FALSE));
|
||||
table.getColumns().add(new WeaTableColumn("40%", "个税扣缴义务人名称", "description", ""));
|
||||
table.getColumns().add(new WeaTableColumn("40%", "备注", "description", ""));
|
||||
|
||||
//设置check是否可用
|
||||
table.setCheckboxList(null);
|
||||
table.setCheckboxpopedom(null);
|
||||
result.putAll(table.makeDataResult());
|
||||
result.success();
|
||||
apidatas = result.getResultMap();
|
||||
return apidatas;
|
||||
}
|
||||
|
||||
/**
|
||||
* sql条件
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
private String makeSqlWhere(Map<String, Object> params) {
|
||||
|
||||
RecordSet rs = new RecordSet();
|
||||
StringBuilder sqlWhere = new StringBuilder("where 1 = 1");
|
||||
Collection<String> ids = (Collection<String>) params.get("ids");
|
||||
if (CollectionUtils.isNotEmpty(ids)) {
|
||||
sqlWhere.append(" AND id in (").append(String.join(",", ids)).append(")");
|
||||
}
|
||||
//模糊查询
|
||||
String name = (String) params.get("name");
|
||||
if (StringUtils.isNotBlank(name)) {
|
||||
if ("mysql".equalsIgnoreCase(rs.getDBType())) {
|
||||
sqlWhere.append(" AND name like CONCAT('%',").append(name).append(",'%') ");
|
||||
} else if ("sqlserver".equalsIgnoreCase(rs.getDBType())) {
|
||||
sqlWhere.append(" AND name like CONCAT('%',").append(name).append(",'%') ");
|
||||
} else if ("oracle".equalsIgnoreCase(rs.getDBType())) {
|
||||
sqlWhere.append(" AND name like '%'||").append(name).append("||'%' ");
|
||||
} else {
|
||||
sqlWhere.append(" AND name like '%'").append(name).append("'%' ");
|
||||
}
|
||||
}
|
||||
|
||||
return sqlWhere.toString();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
package com.engine.salary.cmd.TaxAgent;
|
||||
|
||||
import com.engine.common.biz.AbstractCommonCommand;
|
||||
import com.engine.common.entity.BizLogContext;
|
||||
import com.engine.core.interceptor.CommandContext;
|
||||
import com.engine.salary.entity.salaryarchive.bo.TaxAgentBO;
|
||||
import com.engine.salary.entity.salaryarchive.po.TaxAgentPO;
|
||||
import com.engine.salary.entity.taxrate.TaxAgent;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.TaxAgentMapper;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import weaver.conn.mybatis.MyBatisFactory;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class TaxAgentSaveCmd extends AbstractCommonCommand<Map<String, Object>> {
|
||||
|
||||
public TaxAgentSaveCmd(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>(16);
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
TaxAgentMapper mapper = sqlSession.getMapper(TaxAgentMapper.class);
|
||||
|
||||
List<TaxAgent> list = mapper.listByName(Util.null2String(this.params.get("name")));
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
throw new SalaryRunTimeException("名称不允许重复");
|
||||
}
|
||||
|
||||
TaxAgent taxAgent = TaxAgentBO.convertToPO(params, (long) user.getUID());
|
||||
mapper.insert(taxAgent);
|
||||
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
return apidatas;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
package com.engine.salary.cmd.TaxAgent;
|
||||
|
||||
import com.engine.common.biz.AbstractCommonCommand;
|
||||
import com.engine.common.entity.BizLogContext;
|
||||
import com.engine.core.interceptor.CommandContext;
|
||||
import com.engine.salary.entity.salaryarchive.po.TaxAgentPO;
|
||||
import com.engine.salary.entity.taxrate.TaxAgent;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.TaxAgentMapper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import weaver.conn.mybatis.MyBatisFactory;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
public class TaxAgentUpdateCmd extends AbstractCommonCommand<Map<String, Object>> {
|
||||
|
||||
public TaxAgentUpdateCmd(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>(16);
|
||||
String name = Util.null2String(params.get("name"));
|
||||
if (StringUtils.isBlank(name)) {
|
||||
throw new SalaryRunTimeException("名称必填");
|
||||
}
|
||||
if (params.get("id") == null) {
|
||||
throw new SalaryRunTimeException("参数错误");
|
||||
}
|
||||
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
TaxAgentMapper taxAgentMapper = sqlSession.getMapper(TaxAgentMapper.class);
|
||||
|
||||
TaxAgent taxAgent = taxAgentMapper.getById((Long) params.get("id"));
|
||||
if (taxAgent == null) {
|
||||
throw new SalaryRunTimeException("个税扣缴义务人不存在");
|
||||
}
|
||||
List<TaxAgent> individualTaxWithholdingAgents = taxAgentMapper.listByName(name);
|
||||
boolean nameExist = individualTaxWithholdingAgents.stream().anyMatch(e -> !Objects.equals(e.getId(), (Long)params.get("id")));
|
||||
if (nameExist) {
|
||||
throw new SalaryRunTimeException("名称不允许重复");
|
||||
}
|
||||
|
||||
TaxAgent taxAgentNew = new TaxAgent();
|
||||
BeanUtils.copyProperties(taxAgent, taxAgentNew);
|
||||
taxAgentNew.setName(name);
|
||||
taxAgentNew.setDescription(Util.null2String(params.get("description")));
|
||||
taxAgentNew.setUpdateTime(LocalDateTime.now());
|
||||
|
||||
taxAgentMapper.updateIgnoreNull(taxAgentNew);
|
||||
|
||||
// taxAgentMapper.updateById(taxAgentNew);
|
||||
// // 记录日志
|
||||
// SalaryLoggerUtil.recordUpdateSingleLog(taxAgentLoggerTemplate,
|
||||
// taxAgent.getId(),
|
||||
// taxAgentNew.getName(),
|
||||
// SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 93767, "编辑个税扣缴义务人"),
|
||||
// SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 93767, "编辑个税扣缴义务人"),
|
||||
// taxAgent,
|
||||
// taxAgentNew);
|
||||
|
||||
|
||||
return apidatas;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
package com.engine.salary.cmd.demo;
|
||||
|
||||
import com.engine.common.biz.AbstractCommonCommand;
|
||||
import com.engine.common.entity.BizLogContext;
|
||||
import com.engine.core.interceptor.CommandContext;
|
||||
import com.engine.salary.entity.DemoPo;
|
||||
import com.engine.salary.mapper.DemoMapper;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.page.PageUtil;
|
||||
import org.apache.commons.compress.utils.Lists;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import weaver.conn.mybatis.MyBatisFactory;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class DemoPageCmd extends AbstractCommonCommand<Map<String, Object>> {
|
||||
|
||||
public DemoPageCmd(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>(16);
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
DemoMapper mapper = sqlSession.getMapper(DemoMapper.class);
|
||||
PageUtil.start(params);
|
||||
List<DemoPo> page = mapper.page();
|
||||
PageInfo<DemoPo> pageInfo = new PageInfo<>(page,DemoPo.class);
|
||||
apidatas.put("pageInfo", pageInfo);
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
return apidatas;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package com.engine.salary.entity;
|
||||
|
||||
import com.engine.salary.annotation.TableTitle;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DemoPo {
|
||||
@TableTitle(title = "序号", key = "id", dataIndex = "id")
|
||||
Integer id;
|
||||
@TableTitle(title = "名称", key = "name", dataIndex = "name")
|
||||
String name;
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
package com.engine.salary.entity.taxrate;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 个税扣缴义务人表
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class TaxAgent {
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private Long creator;
|
||||
/**
|
||||
* 是否已删除。0:未删除、1:已删除
|
||||
*/
|
||||
private Integer deleteType;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private String tenantKey;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
package com.engine.salary.exception;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
public class SalaryRunTimeException extends RuntimeException {
|
||||
public SalaryRunTimeException(String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.engine.salary.mapper;
|
||||
|
||||
|
||||
import com.engine.salary.entity.DemoPo;
|
||||
import com.engine.salary.entity.salaryarchive.po.TaxAgentPO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 个税扣缴义务人
|
||||
* @Author: wangxiangzhong
|
||||
* @Date: 2021/10/29 16:55
|
||||
*/
|
||||
@Mapper
|
||||
public interface DemoMapper {
|
||||
|
||||
@Select("SELECT * FROM hrsa_tax_rate_base")
|
||||
List<DemoPo> page();
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
package com.engine.salary.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.engine.salary.entity.taxrate.TaxAgent;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
public interface TaxAgentMapper {
|
||||
|
||||
/**
|
||||
* 查询所有记录
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<TaxAgent> listAll();
|
||||
|
||||
|
||||
/**
|
||||
* 根据主键查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 返回记录,没有返回null
|
||||
*/
|
||||
TaxAgent getById(Long id);
|
||||
|
||||
/**
|
||||
* 新增,插入所有字段
|
||||
*
|
||||
* @param taxAgent 新增的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int insert(TaxAgent taxAgent);
|
||||
|
||||
/**
|
||||
* 新增,忽略null字段
|
||||
*
|
||||
* @param taxAgent 新增的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int insertIgnoreNull(TaxAgent taxAgent);
|
||||
|
||||
/**
|
||||
* 修改,修改所有字段
|
||||
*
|
||||
* @param taxAgent 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int update(TaxAgent taxAgent);
|
||||
|
||||
/**
|
||||
* 修改,忽略null字段
|
||||
*
|
||||
* @param taxAgent 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int updateIgnoreNull(TaxAgent taxAgent);
|
||||
|
||||
/**
|
||||
* 删除记录
|
||||
*
|
||||
* @param taxAgent 待删除的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int delete(TaxAgent taxAgent);
|
||||
|
||||
@Select("SELECT * FROM hrsa_tax_agent WHERE deleteType = 0 and name = #{name}")
|
||||
List<TaxAgent> listByName(String name);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,185 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.engine.salary.mapper.TaxAgentMapper">
|
||||
<resultMap id="BaseResultMap" type="com.engine.salary.entity.taxrate.TaxAgent">
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="creator" property="creator"/>
|
||||
<result column="delete_type" property="deleteType"/>
|
||||
<result column="description" property="description"/>
|
||||
<result column="id" property="id"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="tenant_key" property="tenantKey"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 表字段 -->
|
||||
<sql id="baseColumns">
|
||||
t.create_time
|
||||
, t.creator
|
||||
, t.delete_type
|
||||
, t.description
|
||||
, t.id
|
||||
, t.name
|
||||
, t.tenant_key
|
||||
, t.update_time
|
||||
</sql>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="listAll" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_tax_agent t
|
||||
WHERE delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 根据主键获取单条记录 -->
|
||||
<select id="getById" resultMap="BaseResultMap" parameterType="Long">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_tax_agent t
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 插入全部字段 -->
|
||||
<insert id="insert" parameterType="com.engine.salary.entity.taxrate.TaxAgent"
|
||||
keyProperty="id" keyColumn="id" useGeneratedKeys="true"
|
||||
>
|
||||
INSERT INTO hrsa_tax_agent
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
create_time,
|
||||
creator,
|
||||
delete_type,
|
||||
description,
|
||||
id,
|
||||
name,
|
||||
tenant_key,
|
||||
update_time,
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
#{createTime},
|
||||
#{creator},
|
||||
#{deleteType},
|
||||
#{description},
|
||||
#{id},
|
||||
#{name},
|
||||
#{tenantKey},
|
||||
#{updateTime},
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!-- 插入不为NULL的字段 -->
|
||||
<insert id="insertIgnoreNull" parameterType="com.engine.salary.entity.taxrate.TaxAgent"
|
||||
keyProperty="id" keyColumn="id" useGeneratedKeys="true"
|
||||
>
|
||||
INSERT INTO hrsa_tax_agent
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator,
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
delete_type,
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description,
|
||||
</if>
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
tenant_key,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
<if test="createTime != null">
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
#{creator},
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
#{deleteType},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
#{description},
|
||||
</if>
|
||||
<if test="id != null">
|
||||
#{id},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
#{name},
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
#{tenantKey},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!-- 更新,更新全部字段 -->
|
||||
<update id="update" parameterType="com.engine.salary.entity.taxrate.TaxAgent">
|
||||
UPDATE hrsa_tax_agent
|
||||
<set>
|
||||
create_time=#{createTime},
|
||||
creator=#{creator},
|
||||
delete_type=#{deleteType},
|
||||
description=#{description},
|
||||
name=#{name},
|
||||
tenant_key=#{tenantKey},
|
||||
update_time=#{updateTime},
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 更新不为NULL的字段 -->
|
||||
<update id="updateIgnoreNull" parameterType="com.engine.salary.entity.taxrate.TaxAgent">
|
||||
UPDATE hrsa_tax_agent
|
||||
<set>
|
||||
<if test="createTime != null">
|
||||
create_time=#{createTime},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator=#{creator},
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
delete_type=#{deleteType},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description=#{description},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name=#{name},
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
tenant_key=#{tenantKey},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time=#{updateTime},
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 根据主键删除记录 -->
|
||||
<delete id="delete" parameterType="com.engine.salary.entity.taxrate.TaxAgent">
|
||||
UPDATE hrsa_tax_agent
|
||||
SET delete_type=1
|
||||
WHERE id = #{id}
|
||||
AND delete_type = 0AND delete_type = 0
|
||||
</delete>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package com.engine.salary.service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface DemoService {
|
||||
|
||||
Map<String, Object> list(Map<String, Object> params);
|
||||
|
||||
Map<String, Object> getForm(Map<String, Object> params);
|
||||
|
||||
Map<String, Object> save(Map<String, Object> params);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.engine.salary.service;
|
||||
|
||||
import com.cloudstore.eccom.pc.table.WeaTable;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface TaxAgentService {
|
||||
|
||||
Map<String, Object> list(Map<String, Object> params);
|
||||
|
||||
Map<String, Object> getForm(Map<String, Object> params);
|
||||
|
||||
Map<String, Object> save(Map<String, Object> params);
|
||||
|
||||
Map<String, Object> update(Map<String, Object> params);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.cmd.TaxAgent.TaxAgentGetFromCmd;
|
||||
import com.engine.salary.cmd.TaxAgent.TaxAgentSaveCmd;
|
||||
import com.engine.salary.cmd.demo.DemoPageCmd;
|
||||
import com.engine.salary.service.DemoService;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class DemoServiceImpl extends Service implements DemoService {
|
||||
|
||||
@Override
|
||||
public Map<String, Object> list(Map<String, Object> params) {
|
||||
return commandExecutor.execute(new DemoPageCmd(params,user));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getForm(Map<String, Object> params) {
|
||||
return commandExecutor.execute(new TaxAgentGetFromCmd(params,user));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> save(Map<String, Object> params) {
|
||||
return commandExecutor.execute(new TaxAgentSaveCmd(params,user));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import com.cloudstore.eccom.pc.table.WeaTable;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.portrait.cmd.individual.GetIndividualItemDataCmd;
|
||||
import com.engine.salary.cmd.TaxAgent.TaxAgentGetFromCmd;
|
||||
import com.engine.salary.cmd.TaxAgent.TaxAgentListCmd;
|
||||
import com.engine.salary.cmd.TaxAgent.TaxAgentSaveCmd;
|
||||
import com.engine.salary.cmd.TaxAgent.TaxAgentUpdateCmd;
|
||||
import com.engine.salary.service.TaxAgentService;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class TaxAgentServiceImpl extends Service implements TaxAgentService {
|
||||
|
||||
@Override
|
||||
public Map<String, Object> list(Map<String, Object> params) {
|
||||
return commandExecutor.execute(new TaxAgentListCmd(params,user));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getForm(Map<String, Object> params) {
|
||||
return commandExecutor.execute(new TaxAgentGetFromCmd(params,user));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> save(Map<String, Object> params) {
|
||||
return commandExecutor.execute(new TaxAgentSaveCmd(params,user));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> update(Map<String, Object> params) {
|
||||
return commandExecutor.execute(new TaxAgentUpdateCmd(params,user));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
package com.engine.salary.util;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import weaver.general.BaseBean;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
|
||||
|
||||
public class ResponseResult extends HashMap<String, Object> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 统一返回方法
|
||||
*/
|
||||
public static String run(Function<Map<String, Object>,Map<String, Object>> f,Map<String, Object> m) {
|
||||
try {
|
||||
return Ok(f.apply(m));
|
||||
} catch (SalaryRunTimeException e) {
|
||||
return Error(e.getMessage());
|
||||
} catch (Exception e) {
|
||||
BaseBean b = new BaseBean();
|
||||
b.writeLog(e);
|
||||
return Error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功返回
|
||||
*/
|
||||
private static String Ok(Map<String, Object> map) {
|
||||
Map<String, Object> apidatas = new HashMap<>();
|
||||
apidatas.put("status", true);
|
||||
apidatas.put("data",map);
|
||||
return JSONObject.toJSONString(apidatas, SerializerFeature.DisableCircularReferenceDetect);
|
||||
}
|
||||
|
||||
/**
|
||||
* 失败返回
|
||||
*/
|
||||
private static String Error(String message) {
|
||||
Map<String, Object> apidatas = new HashMap<>();
|
||||
apidatas.put("status", false);
|
||||
apidatas.put("errormsg", message);
|
||||
return JSONObject.toJSONString(apidatas, SerializerFeature.DisableCircularReferenceDetect);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
package com.engine.salary.util;
|
||||
|
||||
import com.github.pagehelper.Page;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description: 分页相关的工具类
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: Created in 11/22/21 2:03 PM
|
||||
* @version:v1.0
|
||||
*/
|
||||
public class SalaryPageUtil {
|
||||
|
||||
private SalaryPageUtil() {
|
||||
throw new IllegalStateException("Utility class");
|
||||
}
|
||||
|
||||
public static <T> Page<T> buildPage(Integer pageNo, Integer pageSize) {
|
||||
pageNo = pageNo == null || pageNo <= 0 ? 1 : pageNo;
|
||||
pageSize = pageSize == null || pageSize <= 0 ? 10 : pageSize;
|
||||
return new Page(pageNo, pageSize, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页
|
||||
*
|
||||
* @param pageNo 页码(从1开始)
|
||||
* @param pageSize 每页条数
|
||||
* @param source 待分页的数据
|
||||
* @param <T> 范型制定类
|
||||
* @return
|
||||
*/
|
||||
public static <T> List<T> subList(int pageNo, int pageSize, List<T> source) {
|
||||
if (CollectionUtils.isEmpty(source)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
int endIndex = pageNo * pageSize;
|
||||
int startIndex = (pageNo - 1) * pageSize;
|
||||
startIndex = startIndex < 0 ? 0 : startIndex;
|
||||
return source.subList(startIndex > source.size() ? source.size() : startIndex,
|
||||
endIndex > source.size() ? source.size() : endIndex);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.engine.salary.util.page;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class Column {
|
||||
String title;
|
||||
String dataIndex;
|
||||
String key;
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
package com.engine.salary.util.page;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DataSource {
|
||||
String key;
|
||||
String title;
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
package com.engine.salary.util.page;
|
||||
|
||||
import com.engine.salary.annotation.TableTitle;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
public class PageInfo<T> extends com.github.pagehelper.PageInfo<T> {
|
||||
Class<T> clazz;
|
||||
List<Column> columns = new ArrayList<>();
|
||||
List<DataSource> dataSource = new ArrayList<>();
|
||||
|
||||
public PageInfo(List<T> list) {
|
||||
super(list);
|
||||
}
|
||||
|
||||
public PageInfo(List<T> list, Class<T> clazz) {
|
||||
super(list);
|
||||
this.clazz = clazz;
|
||||
}
|
||||
|
||||
|
||||
public List<Column> getColumns() {
|
||||
Field[] fields = clazz.getDeclaredFields();
|
||||
for (Field f : fields) {
|
||||
boolean isanno = f.isAnnotationPresent(TableTitle.class);
|
||||
if (isanno) {
|
||||
TableTitle annotation = f.getAnnotation(TableTitle.class);
|
||||
String title = annotation.title();
|
||||
String dataIndex = annotation.dataIndex();
|
||||
String key = annotation.key();
|
||||
Column column = Column.builder().title(title).dataIndex(dataIndex).key(key).build();
|
||||
columns.add(column);
|
||||
}
|
||||
}
|
||||
return columns;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
package com.engine.salary.util.page;
|
||||
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import weaver.general.Util;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
public class PageUtil {
|
||||
|
||||
public static void start(Map<String, Object> params) {
|
||||
int pageNum = Util.getIntValue(Util.null2String(params.get("pageNum")));
|
||||
int pageSize = Util.getIntValue(Util.null2String(params.get("pageSize")));
|
||||
pageNum = pageNum <= 0 ? 1 : pageNum;
|
||||
pageSize = pageSize <= 0 ? 10 : pageSize;
|
||||
PageHelper.startPage(pageNum, pageSize);
|
||||
}
|
||||
|
||||
public static <T> Page<T> buildPage(Integer pageNo, Integer pageSize) {
|
||||
pageNo = pageNo == null || pageNo <= 0 ? 1 : pageNo;
|
||||
pageSize = pageSize == null || pageSize <= 0 ? 10 : pageSize;
|
||||
return new Page(pageNo, pageSize, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页
|
||||
*
|
||||
* @param pageNo 页码(从1开始)
|
||||
* @param pageSize 每页条数
|
||||
* @param source 待分页的数据
|
||||
* @param <T> 范型制定类
|
||||
* @return
|
||||
*/
|
||||
public static <T> List<T> subList(int pageNo, int pageSize, List<T> source) {
|
||||
if (CollectionUtils.isEmpty(source)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
int endIndex = pageNo * pageSize;
|
||||
int startIndex = (pageNo - 1) * pageSize;
|
||||
startIndex = startIndex < 0 ? 0 : startIndex;
|
||||
return source.subList(startIndex > source.size() ? source.size() : startIndex,
|
||||
endIndex > source.size() ? source.size() : endIndex);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
package com.engine.salary.web;
|
||||
|
||||
import com.engine.common.util.ParamUtil;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.salary.service.DemoService;
|
||||
import com.engine.salary.service.TaxAgentService;
|
||||
import com.engine.salary.service.impl.DemoServiceImpl;
|
||||
import com.engine.salary.service.impl.TaxAgentServiceImpl;
|
||||
import com.engine.salary.util.ResponseResult;
|
||||
import weaver.general.BaseBean;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
|
||||
public class DemoController {
|
||||
|
||||
private BaseBean logger = new BaseBean();
|
||||
|
||||
private DemoService getService(User user) {
|
||||
return (DemoService) ServiceUtil.getService(DemoServiceImpl.class, user);
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/list")
|
||||
@Produces(MediaType.TEXT_PLAIN)
|
||||
public String list(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ResponseResult.run(getService(user)::list, ParamUtil.request2Map(request));
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/getForm")
|
||||
@Produces(MediaType.TEXT_PLAIN)
|
||||
public String getForm(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ResponseResult.run(getService(user)::getForm, ParamUtil.request2Map(request));
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/save")
|
||||
@Produces(MediaType.TEXT_PLAIN)
|
||||
public String getFrom(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ResponseResult.run(getService(user)::save, ParamUtil.request2Map(request));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
package com.engine.salary.web;
|
||||
|
||||
import com.engine.common.util.ParamUtil;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.salary.service.TaxAgentService;
|
||||
import com.engine.salary.service.impl.TaxAgentServiceImpl;
|
||||
import com.engine.salary.util.ResponseResult;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.beanutils.BeanUtils;
|
||||
import weaver.general.BaseBean;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
|
||||
public class TaxAgentController {
|
||||
|
||||
private BaseBean logger = new BaseBean();
|
||||
|
||||
private TaxAgentService getService(User user) {
|
||||
return (TaxAgentService) ServiceUtil.getService(TaxAgentServiceImpl.class, user);
|
||||
}
|
||||
|
||||
//个税扣缴义务人列表
|
||||
@GET
|
||||
@Path("/list")
|
||||
@Produces(MediaType.TEXT_PLAIN)
|
||||
public String list(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ResponseResult.run(getService(user)::list, ParamUtil.request2Map(request));
|
||||
}
|
||||
|
||||
//获取个税扣缴义务人表单
|
||||
@GET
|
||||
@Path("/getForm")
|
||||
@Produces(MediaType.TEXT_PLAIN)
|
||||
public String getForm(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ResponseResult.run(getService(user)::getForm, ParamUtil.request2Map(request));
|
||||
}
|
||||
|
||||
//新建个税扣缴义务人
|
||||
@POST
|
||||
@Path("/save")
|
||||
@Produces(MediaType.TEXT_PLAIN)
|
||||
public String getFrom(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ResponseResult.run(getService(user)::save, ParamUtil.request2Map(request));
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑个税扣缴义务人
|
||||
*/
|
||||
@POST
|
||||
@Path("/update")
|
||||
@Produces(MediaType.TEXT_PLAIN)
|
||||
public String update(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ResponseResult.run(getService(user)::update, ParamUtil.request2Map(request));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
package com.engine.salary.web;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.salary.service.TaxAgentService;
|
||||
import com.engine.salary.service.impl.TaxAgentServiceImpl;
|
||||
import weaver.general.BaseBean;
|
||||
import weaver.hrm.User;
|
||||
|
||||
public class TaxRateController {
|
||||
|
||||
private BaseBean logger = new BaseBean();
|
||||
|
||||
// private TaxAgentService getService(User user) {
|
||||
// return (TaxRateService) ServiceUtil.getService(TaxAgentServiceImpl.class, user);
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue