parent
8eb769ee05
commit
d238502b2c
|
|
@ -18,7 +18,6 @@ import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
|
|||
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobEmpFieldDTO;
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobItemAggregateDTO;
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobItemDTO;
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobItemGroupDTO;
|
||||
|
|
@ -449,20 +448,24 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
|
|||
}
|
||||
// 模板表头(默认必带"个税扣缴义务人"、"姓名")
|
||||
List<Object> headerList = Lists.newArrayList(SalaryI18nUtil.getI18nLabel(85429, "姓名"), SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人"));
|
||||
//定位人员带“部门”,“手机号”,“工号”
|
||||
headerList.add("部门");
|
||||
headerList.add("手机号");
|
||||
headerList.add("工号");
|
||||
// 查询薪资账套下的薪资项目
|
||||
SalarySobItemAggregateDTO salarySobItemAggregateDTO = getSalarySobItemService(user).getAggregateBySalarySobId(salaryAcctRecordPO.getSalarySobId());
|
||||
|
||||
// 员工信息
|
||||
for (SalarySobEmpFieldDTO item : salarySobItemAggregateDTO.getEmpFields()) {
|
||||
if (!"姓名".equals(item.getFieldName()) && !"个税扣缴义务人".equals(item.getFieldName())) {
|
||||
if ("手机".equals(item.getFieldName())) {
|
||||
headerList.add("手机号");
|
||||
} else {
|
||||
headerList.add(item.getFieldName());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
// // 员工信息
|
||||
// for (SalarySobEmpFieldDTO item : salarySobItemAggregateDTO.getEmpFields()) {
|
||||
// if (!"姓名".equals(item.getFieldName()) && !"个税扣缴义务人".equals(item.getFieldName())) {
|
||||
// if ("手机".equals(item.getFieldName())) {
|
||||
// headerList.add("手机号");
|
||||
// } else {
|
||||
// headerList.add(item.getFieldName());
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// 薪资项目分类下的新资项目
|
||||
for (SalarySobItemGroupDTO itemGroup : salarySobItemAggregateDTO.getItemGroups()) {
|
||||
for (SalarySobItemDTO item : itemGroup.getItems()) {
|
||||
|
|
@ -652,7 +655,8 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
|
|||
}
|
||||
}
|
||||
}else if (StringUtils.equals(SalaryI18nUtil.getI18nLabel(86184, "部门"), dataKey.toString())
|
||||
|| StringUtils.equals(SalaryI18nUtil.getI18nLabel(86186, "手机号"), dataKey.toString())) {
|
||||
|| StringUtils.equals(SalaryI18nUtil.getI18nLabel(86186, "手机号"), dataKey.toString())
|
||||
|| StringUtils.equals(SalaryI18nUtil.getI18nLabel(86186, "工号"), dataKey.toString())) {
|
||||
|
||||
} else if (StringUtils.equals(SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人"), dataKey.toString())) {
|
||||
if (StringUtils.isEmpty(dataValue)) {
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ package com.engine.salary.sys.entity.po;
|
|||
|
||||
|
||||
import com.engine.salary.annotation.TableTitle;
|
||||
import com.engine.salary.util.valid.DataCheck;
|
||||
import com.engine.salary.util.valid.RuntimeTypeEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -15,33 +17,40 @@ import java.util.Date;
|
|||
@AllArgsConstructor
|
||||
public class SalarySysConfPO {
|
||||
|
||||
@DataCheck(require = true, runtime = RuntimeTypeEnum.UPDATE, message = "id为空")
|
||||
private Long id;
|
||||
/**
|
||||
* 标识
|
||||
*/
|
||||
@TableTitle(title = "标识", dataIndex = "confKey", key = "confKey")
|
||||
@DataCheck(require = true, message = "标识为空")
|
||||
private String confKey;
|
||||
/**
|
||||
* 值
|
||||
*/
|
||||
@TableTitle(title = "值", dataIndex = "confValue", key = "confValue")
|
||||
@DataCheck(require = true, message = "标识为空")
|
||||
private String confValue;
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
@TableTitle(title = "标题", dataIndex = "title", key = "title")
|
||||
@DataCheck(require = true, message = "标题为空")
|
||||
private String title;
|
||||
/**
|
||||
* 所属模块
|
||||
*/
|
||||
@TableTitle(title = "所属模块", dataIndex = "module", key = "module")
|
||||
private String module;
|
||||
/**
|
||||
* 排序权重
|
||||
*/
|
||||
@TableTitle(title = "排序权重", dataIndex = "orderWeight", key = "orderWeight")
|
||||
private Integer orderWeight;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@TableTitle(title = "描述", dataIndex = "description", key = "description")
|
||||
private String description;
|
||||
/**
|
||||
* 是否已删除,0否,1是
|
||||
|
|
|
|||
|
|
@ -27,4 +27,8 @@ public interface SalarySysConfService {
|
|||
SalarySysConfPO getOneByCode(String code);
|
||||
|
||||
List<SalarySysConfPO> listSome(SalarySysConfPO build);
|
||||
|
||||
void save(SalarySysConfPO salarySysConfPO);
|
||||
|
||||
void update(SalarySysConfPO salarySysConfPO);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.engine.salary.sys.service.impl;
|
|||
|
||||
import com.api.formmode.mybatis.util.SqlProxyHandle;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.sys.SalarySysConfMapper;
|
||||
import com.engine.salary.sys.entity.po.SalarySysConfPO;
|
||||
import com.engine.salary.sys.enums.TaxDeclarationFunctionEnum;
|
||||
|
|
@ -70,4 +71,27 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
|
|||
public List<SalarySysConfPO> listSome(SalarySysConfPO po) {
|
||||
return getSalarySysConfMapper().listSome(po);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save(SalarySysConfPO salarySysConfPO) {
|
||||
salarySysConfPO.setId(IdGenerator.generate());
|
||||
salarySysConfPO.setUpdateTime(new Date());
|
||||
salarySysConfPO.setCreateTime(new Date());
|
||||
salarySysConfPO.setDeleteType(0);
|
||||
salarySysConfPO.setOrderWeight(0);
|
||||
salarySysConfPO.setModule("basic");
|
||||
|
||||
getSalarySysConfMapper().insertIgnoreNull(salarySysConfPO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(SalarySysConfPO salarySysConfPO) {
|
||||
SalarySysConfPO po = getSalarySysConfMapper().getById(salarySysConfPO.getId());
|
||||
if (po == null) {
|
||||
throw new SalaryRunTimeException("系统配置不存在");
|
||||
}
|
||||
salarySysConfPO.setUpdateTime(new Date());
|
||||
getSalarySysConfMapper().updateIgnoreNull(salarySysConfPO);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,4 +90,34 @@ public class SalarySystemConfigController {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 保存系统配置
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/save")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String save(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySysConfPO param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalarySysConfPO, String>(user).run(getSalarySystemConfigWrapper(user)::save, param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新系统配置
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/update")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String update(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySysConfPO param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalarySysConfPO, String>(user).run(getSalarySystemConfigWrapper(user)::update, param);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ import com.engine.salary.sys.service.SalarySysConfService;
|
|||
import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.page.SalaryPageUtil;
|
||||
import com.engine.salary.util.valid.RuntimeTypeEnum;
|
||||
import com.engine.salary.util.valid.ValidUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.general.BaseBean;
|
||||
import weaver.hrm.User;
|
||||
|
|
@ -81,4 +83,15 @@ public class SalarySystemConfigWrapper extends Service {
|
|||
page.setPageSize(param.getPageSize());
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
public void save(SalarySysConfPO salarySysConfPO) {
|
||||
ValidUtil.doValidator(salarySysConfPO);
|
||||
getSalarySysConfService(user).save(salarySysConfPO);
|
||||
}
|
||||
|
||||
public void update(SalarySysConfPO salarySysConfPO) {
|
||||
ValidUtil.doValidator(salarySysConfPO, RuntimeTypeEnum.UPDATE);
|
||||
getSalarySysConfService(user).update(salarySysConfPO);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue