2022-07-05 16:56:09 +08:00
|
|
|
package com.engine.salary.wrapper;
|
|
|
|
|
|
2022-08-11 10:27:15 +08:00
|
|
|
import com.engine.common.util.ServiceUtil;
|
2022-07-05 16:56:09 +08:00
|
|
|
import com.engine.core.impl.Service;
|
2022-09-14 11:28:17 +08:00
|
|
|
import com.engine.salary.sys.entity.param.SalarySysConfQueryParam;
|
2022-09-05 17:20:57 +08:00
|
|
|
import com.engine.salary.sys.entity.po.SalarySysConfPO;
|
2022-08-11 10:27:15 +08:00
|
|
|
import com.engine.salary.sys.enums.TaxDeclarationFunctionEnum;
|
|
|
|
|
import com.engine.salary.sys.service.SalarySysConfService;
|
|
|
|
|
import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
|
2022-09-13 16:03:55 +08:00
|
|
|
import com.engine.salary.util.page.PageInfo;
|
2022-09-14 11:28:17 +08:00
|
|
|
import com.engine.salary.util.page.SalaryPageUtil;
|
2022-09-15 15:15:34 +08:00
|
|
|
import com.engine.salary.util.valid.RuntimeTypeEnum;
|
|
|
|
|
import com.engine.salary.util.valid.ValidUtil;
|
2022-09-05 17:20:57 +08:00
|
|
|
import org.apache.commons.lang3.StringUtils;
|
2022-07-05 16:56:09 +08:00
|
|
|
import weaver.general.BaseBean;
|
2022-08-11 10:27:15 +08:00
|
|
|
import weaver.hrm.User;
|
2022-07-05 16:56:09 +08:00
|
|
|
|
|
|
|
|
import java.util.HashMap;
|
2022-09-14 11:28:17 +08:00
|
|
|
import java.util.List;
|
2022-07-05 16:56:09 +08:00
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 累计专项附加扣除
|
|
|
|
|
* <p>Copyright: Copyright (c) 2022</p>
|
|
|
|
|
* <p>Company: 泛微软件</p>
|
|
|
|
|
*
|
|
|
|
|
* @author qiantao
|
|
|
|
|
* @version 1.0
|
|
|
|
|
**/
|
|
|
|
|
public class SalarySystemConfigWrapper extends Service {
|
|
|
|
|
|
2022-08-11 10:27:15 +08:00
|
|
|
private SalarySysConfService getSalarySysConfService(User user) {
|
|
|
|
|
return ServiceUtil.getService(SalarySysConfServiceImpl.class, user);
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-05 16:56:09 +08:00
|
|
|
public Map<String, Object> info() {
|
|
|
|
|
BaseBean baseBean = new BaseBean();
|
|
|
|
|
String log = baseBean.getPropValue("hrmSalary", "log");
|
|
|
|
|
String version = baseBean.getPropValue("hrmSalary", "version");
|
|
|
|
|
String openFormulaForcedEditing = baseBean.getPropValue("hrmSalary", "openFormulaForcedEditing");
|
|
|
|
|
|
|
|
|
|
Map<String, Object> o = new HashMap<>();
|
|
|
|
|
o.put("log", log);
|
|
|
|
|
o.put("version", version);
|
|
|
|
|
o.put("openFormulaForcedEditing", openFormulaForcedEditing);
|
|
|
|
|
return o;
|
|
|
|
|
}
|
2022-08-11 10:27:15 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 操作是否需要申报功能
|
|
|
|
|
*
|
|
|
|
|
* @param flag 开启 0/关闭 1/重新开启 2
|
|
|
|
|
* @return 执行结果
|
|
|
|
|
*/
|
|
|
|
|
public boolean operateTaxDeclarationFunction(TaxDeclarationFunctionEnum flag) {
|
|
|
|
|
return getSalarySysConfService(user).operateTaxDeclarationFunction(flag);
|
|
|
|
|
}
|
|
|
|
|
|
2022-09-05 17:20:57 +08:00
|
|
|
/**
|
|
|
|
|
* 获取单一配置
|
|
|
|
|
*
|
|
|
|
|
* @param code
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public String getOneByCode(String code) {
|
|
|
|
|
SalarySysConfPO one = getSalarySysConfService(user).getOneByCode(code);
|
|
|
|
|
if (one != null) {
|
|
|
|
|
return one.getConfValue();
|
|
|
|
|
} else {
|
|
|
|
|
return StringUtils.EMPTY;
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-09-13 16:03:55 +08:00
|
|
|
|
|
|
|
|
|
2022-09-14 11:28:17 +08:00
|
|
|
public PageInfo<SalarySysConfPO> list(SalarySysConfQueryParam param) {
|
|
|
|
|
List<SalarySysConfPO> salarySysConfPOS = getSalarySysConfService(user).listSome(SalarySysConfPO.builder().build());
|
|
|
|
|
|
|
|
|
|
List<SalarySysConfPO> list = SalaryPageUtil.subList(param.getCurrent(), param.getPageSize(), salarySysConfPOS);
|
|
|
|
|
PageInfo<SalarySysConfPO> page = new PageInfo<>(list, SalarySysConfPO.class);
|
|
|
|
|
|
|
|
|
|
page.setTotal(salarySysConfPOS.size());
|
|
|
|
|
page.setPageNum(param.getCurrent());
|
|
|
|
|
page.setPageSize(param.getPageSize());
|
|
|
|
|
return page;
|
2022-09-13 16:03:55 +08:00
|
|
|
}
|
2022-09-15 15:15:34 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
}
|
2022-09-15 15:41:48 +08:00
|
|
|
|
|
|
|
|
public SalarySysConfPO detail(Long id) {
|
|
|
|
|
return getSalarySysConfService(user).getById(id);
|
|
|
|
|
}
|
2022-09-19 13:41:09 +08:00
|
|
|
|
|
|
|
|
public void updateByCode(SalarySysConfPO salarySysConfPO) {
|
|
|
|
|
getSalarySysConfService(user).updateByCode(salarySysConfPO);
|
|
|
|
|
}
|
2022-07-05 16:56:09 +08:00
|
|
|
}
|