Merge branch 'feature/qt' into develop

This commit is contained in:
钱涛 2022-03-30 12:16:07 +08:00
commit 50a62e3b29
19 changed files with 986 additions and 854 deletions

View File

@ -1,7 +1,10 @@
package com.engine.salary.biz;
import com.engine.salary.entity.salarysob.param.SalarySobCheckRuleQueryParam;
import com.engine.salary.entity.salarysob.po.SalarySobCheckRulePO;
import com.engine.salary.mapper.salarysob.SalarySobCheckRuleMapper;
import com.engine.salary.util.page.PageInfo;
import com.engine.salary.util.page.PageUtil;
import org.apache.ibatis.session.SqlSession;
import weaver.conn.mybatis.MyBatisFactory;
@ -85,4 +88,17 @@ public class SalarySobCheckRuleBiz {
sqlSession.close();
}
}
public PageInfo<SalarySobCheckRulePO> listPageByParam(SalarySobCheckRuleQueryParam param) {
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
SalarySobCheckRuleMapper mapper = sqlSession.getMapper(SalarySobCheckRuleMapper.class);
PageUtil.start(param.getCurrent(), param.getPageSize());
List<SalarySobCheckRulePO> list = mapper.listByParam(param);
PageInfo<SalarySobCheckRulePO> pageInfo = new PageInfo<SalarySobCheckRulePO>(list, SalarySobCheckRulePO.class);
return pageInfo;
} finally {
sqlSession.close();
}
}
}

View File

@ -1,20 +1,20 @@
package com.engine.salary.entity.salaryarchive.param;
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveListDTO;
import com.engine.salary.entity.salaryarchive.dto.TaxAgentListDTO;
import com.engine.salary.entity.salaryarchive.po.SalaryArchiveEmployeePO;
import com.engine.salary.entity.salaryarchive.po.SalaryArchiveItemPO;
import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO;
import com.engine.salary.entity.salaryarchive.po.SalaryArchiveTaxAgentPO;
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
import com.engine.salary.entity.taxrate.TaxAgent;
import com.engine.salary.enums.salaryarchive.SalaryArchiveImportTypeEnum;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Collection;
import java.util.Date;
import java.util.List;
/**
@ -31,15 +31,31 @@ import java.util.List;
@AllArgsConstructor
public class SalaryArchiveImportHandleParam {
//**********************前端需传入参数**************************/
/**
* 上传文件id
*/
String imageId;
/**
* 导入类型
*
* @see SalaryArchiveImportTypeEnum
*/
String importType;
//************************************************************/
/**
* 获取租户下所有的人员
*/
List<SalaryArchiveEmployeePO> employees;
List<DataCollectionEmployee> employees;
/**
* 获取所有个税扣缴义务人
*/
Collection<TaxAgentListDTO> taxAgentList;
Collection<TaxAgent> taxAgentList;
/**
* 获取所有可被引用的薪资项目
@ -79,12 +95,12 @@ public class SalaryArchiveImportHandleParam {
/**
* 当前时间
*/
LocalDateTime nowTime = LocalDateTime.now();
Date nowTime = new Date();
/**
* 当天
*/
LocalDate today = LocalDate.now();
Date today = new Date();
/**
* 待保存薪资档案

View File

@ -4,6 +4,7 @@ import com.cloudstore.eccom.pc.table.WeaTableType;
import com.engine.salary.annotation.SalaryTable;
import com.engine.salary.annotation.SalaryTableColumn;
import com.engine.salary.annotation.SalaryTableOperate;
import com.engine.salary.annotation.TableTitle;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@ -29,20 +30,24 @@ public class SalarySobCheckRuleListDTO {
//主键id
@SalaryTableColumn(column = "id", display = false)
@TableTitle(title = "id", dataIndex = "id", key = "id")
private Long id;
//薪资账套id
private Long salarySobId;
@SalaryTableColumn(text = "名称", width = "10%", column = "name")
@TableTitle(title = "名称", dataIndex = "name", key = "name")
private String name;
//公式id
private Long formulaId;
@SalaryTableColumn(text = "校验规则", width = "10%", column = "formulaContent")
@TableTitle(title = "校验规则", dataIndex = "formulaContent", key = "formulaContent")
private String formulaContent;
@SalaryTableColumn(text = "备注", width = "10%", column = "description")
@TableTitle(title = "备注", dataIndex = "description", key = "description")
private String description;
}

View File

@ -7,12 +7,13 @@ import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @description: 薪资账套校验规则查询参数
* @author: xiajun
* @modified By: xiajun
* @date: Created in 11/23/21 7:02 PM
* @version:v1.0
*/
* 薪资账套校验规则查询参数
* <p>Copyright: Copyright (c) 2022</p>
* <p>Company: 泛微软件</p>
*
* @author qiantao
* @version 1.0
**/
@Data
@Builder
@NoArgsConstructor

View File

@ -92,7 +92,9 @@ public class SalarySobItemPO {
Collection<Long> ids;
Collection<Long> salarySobIds;
//not in
Collection<Long> salaryItemIds;
Collection<Long> notInSalaryItemIds;
}

View File

@ -1,5 +1,6 @@
package com.engine.salary.mapper.salarysob;
import com.engine.salary.entity.salarysob.param.SalarySobCheckRuleQueryParam;
import com.engine.salary.entity.salarysob.po.SalarySobCheckRulePO;
import org.apache.ibatis.annotations.Param;
@ -21,6 +22,8 @@ public interface SalarySobCheckRuleMapper {
* @return 返回集合没有返回空List
*/
List<SalarySobCheckRulePO> listSome(SalarySobCheckRulePO salarySobCheckRule);
List<SalarySobCheckRulePO> listByParam(SalarySobCheckRuleQueryParam param);
/**
@ -83,5 +86,6 @@ public interface SalarySobCheckRuleMapper {
* @param salarySobCheckRules
*/
void batchInsert(@Param("collection") Collection<SalarySobCheckRulePO> salarySobCheckRules);
}

View File

@ -93,6 +93,45 @@
</select>
<!-- 条件查询 -->
<select id="listByParam" resultMap="BaseResultMap"
parameterType="com.engine.salary.entity.salarysob.po.SalarySobCheckRulePO">
SELECT
<include refid="baseColumns"/>
FROM hrsa_salary_sob_check_rule t
WHERE delete_type = 0
<include refid="paramSql"/>
ORDER BY id DESC
</select>
<sql id="paramSql">
<if test="salarySobId != null">
AND salary_sob_id = #{salarySobId}
</if>
<if test="name != null and name != ''">
AND name like CONCAT('%',#{name},'%')
</if>
</sql>
<sql id="paramSql" databaseId="oracle">
<if test="salarySobId != null">
AND salary_sob_id = #{salarySobId}
</if>
<if test="name != null and name != ''">
AND name like '%'||#{name}||'%'
</if>
</sql>
<sql id="paramSql" databaseId="sqlserver">
<if test="salarySobId != null">
AND salary_sob_id = #{salarySobId}
</if>
<if test="name != null and name != ''">
AND name like '%'+#{name}+'%'
</if>
</sql>
<!-- 插入不为NULL的字段 -->
<insert id="insertIgnoreNull" parameterType="com.engine.salary.entity.salarysob.po.SalarySobCheckRulePO"
keyProperty="id" keyColumn="id" useGeneratedKeys="true"

View File

@ -110,6 +110,12 @@
#{salaryItemId}
</foreach>
</if>
<if test="notInSalaryItemIds != null and notInSalaryItemIds.size()>0">
AND salary_item_id NOT IN
<foreach collection="notInSalaryItemIds" open="(" item="salaryItemId" separator="," close=")">
#{salaryItemId}
</foreach>
</if>
ORDER BY id DESC
</select>

View File

@ -1,8 +1,10 @@
package com.engine.salary.service;
import com.engine.salary.entity.salarysob.param.SalarySobCheckRuleQueryParam;
import com.engine.salary.entity.salarysob.param.SalarySobCheckRuleSaveParam;
import com.engine.salary.entity.salarysob.param.UpdateCheckRuleFormulaParam;
import com.engine.salary.entity.salarysob.po.SalarySobCheckRulePO;
import com.engine.salary.util.page.PageInfo;
import java.util.Collection;
import java.util.List;
@ -56,7 +58,7 @@ public interface SalarySobCheckRuleService {
* @param queryParam 搜索条件
* @return
*/
// Page<SalarySobCheckRulePO> listPageByParam(SalarySobCheckRuleQueryParam queryParam);
PageInfo<SalarySobCheckRulePO> listPageByParam(SalarySobCheckRuleQueryParam queryParam);
/**
* 保存
@ -99,4 +101,6 @@ public interface SalarySobCheckRuleService {
* @param salarySobIds 薪资账套id
*/
void deleteBySalarySobIds(Collection<Long> salarySobIds);
}

View File

@ -32,10 +32,13 @@ import java.util.*;
import java.util.stream.Collectors;
/**
* @Description: 数据采集-考勤引用数据
* @Author: wangxiangzhong
* @Date: 2021-11-17 14:37
*/
* 数据采集-考勤引用数据
* <p>Copyright: Copyright (c) 2022</p>
* <p>Company: 泛微软件</p>
*
* @author qiantao
* @version 1.0
**/
public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDataService {
private AttendQuoteBiz quoteBiz = new AttendQuoteBiz();

View File

@ -4,6 +4,7 @@ import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.salary.biz.SalarySobCheckRuleBiz;
import com.engine.salary.entity.salarysob.bo.SalarySobCheckRuleBO;
import com.engine.salary.entity.salarysob.param.SalarySobCheckRuleQueryParam;
import com.engine.salary.entity.salarysob.param.SalarySobCheckRuleSaveParam;
import com.engine.salary.entity.salarysob.param.UpdateCheckRuleFormulaParam;
import com.engine.salary.entity.salarysob.po.SalarySobCheckRulePO;
@ -13,6 +14,7 @@ import com.engine.salary.service.SalarySobCheckRuleService;
import com.engine.salary.service.SalarySobService;
import com.engine.salary.util.SalaryEntityUtil;
import com.engine.salary.util.SalaryI18nUtil;
import com.engine.salary.util.page.PageInfo;
import com.engine.salary.util.valid.RuntimeTypeEnum;
import com.engine.salary.util.valid.ValidUtil;
import org.apache.commons.collections4.CollectionUtils;
@ -57,19 +59,12 @@ public class SalarySobCheckRuleServiceImpl extends Service implements SalarySobC
return salarySobCheckRuleMapper.listSome(SalarySobCheckRulePO.builder().salarySobId(salarySobId).name(name).build());
}
// @Override
// public Page<SalarySobCheckRulePO> listPageByParam(SalarySobCheckRuleQueryParam queryParam) {
// // 分页参数
// Page<SalarySobCheckRulePO> page = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize());
// // 查询薪资账套的校验规则
// return new LambdaQueryChainWrapper<>(salarySobCheckRuleMapper)
// .eq(SalarySobCheckRulePO::getTenantKey, tenantKey)
// .eq(SalarySobCheckRulePO::getDeleteType, 0)
// .eq(SalarySobCheckRulePO::getSalarySobId, queryParam.getSalarySobId())
// .like(SalaryEntityUtil.isNotNullOrEmpty(queryParam.getName()), SalarySobCheckRulePO::getName, queryParam.getName())
// .orderByDesc(SalarySobCheckRulePO::getId)
// .page(page);
// }
@Override
public PageInfo<SalarySobCheckRulePO> listPageByParam(SalarySobCheckRuleQueryParam queryParam) {
return salarySobCheckRuleMapper.listPageByParam(queryParam);
}
@Override
public void save(SalarySobCheckRuleSaveParam saveParam) {

View File

@ -73,7 +73,7 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe
@Override
public List<SalarySobItemPO> listBySalarySobIdAndSalaryItemIdNotIn(Long salarySobId, Collection<Long> salaryItemIds) {
return salarySobItemMapper.listSome(SalarySobItemPO.builder().salarySobId(salarySobId).salaryItemIds(salaryItemIds).build());
return salarySobItemMapper.listSome(SalarySobItemPO.builder().salarySobId(salarySobId).notInSalaryItemIds(salaryItemIds).build());
}
@Override

View File

@ -9,9 +9,9 @@ import org.springframework.web.multipart.MultipartFile;
import java.io.InputStream;
import java.lang.reflect.Field;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.*;
import static com.engine.salary.util.excel.ExcelSupport.EXCEL_TYPE_XLSX;
/**
* Excel 解析工具类
@ -121,6 +121,35 @@ public class ExcelParseHelper {
return result;
}
/**
* 将sheet数据转为map
* @param file
* @param sheetIndex sheet下标
* @param rowIndex 从哪行开始解析
* @return
*/
public static List<Map<String, Object>> parse(InputStream file, int sheetIndex, int rowIndex) {
Sheet sheet = ExcelSupport.parseFile(file, sheetIndex, EXCEL_TYPE_XLSX);
int rowCount = sheet.getPhysicalNumberOfRows(); // 总行数
int cellCount = sheet.getRow(PARSE_EXCEL_ROW_VALID_CELL_INDEX).getPhysicalNumberOfCells(); // 总列数
List<String> sheetHeader = ExcelSupport.getSheetHeader(sheet, PARSE_EXCEL_ROW_VALID_CELL_INDEX);
List<Map<String, Object>> result = new ArrayList<>();
for (; rowIndex < rowCount; rowIndex++) {
Map<String, Object> cellResult = new HashMap<>();
for (int j = 0; j < cellCount; j++) {
String key = sheetHeader.get(j);
cellResult.put(key, ExcelSupport.getCellValue(sheet, rowIndex, j));
}
result.add(cellResult);
}
return result;
}
/**
* 为对象的每一个属性赋值
*

View File

@ -2,10 +2,7 @@ package com.engine.salary.util.excel;
import org.apache.commons.lang3.Validate;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.DateUtil;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.web.multipart.MultipartFile;
@ -13,7 +10,10 @@ import java.io.BufferedInputStream;
import java.io.InputStream;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import static org.apache.poi.ss.usermodel.CellType.STRING;
@ -23,8 +23,8 @@ public class ExcelSupport {
private static final String pattern = "yyyy-MM-dd HH:mm:ss";
//excel类型
private static final String EXCEL_TYPE_XLSX = "xlsx";
private static final String EXCEL_TYPE_XLS = "xls";
public static final String EXCEL_TYPE_XLSX = "xlsx";
public static final String EXCEL_TYPE_XLS = "xls";
/**
@ -73,6 +73,26 @@ public class ExcelSupport {
}
}
/**
* 获取sheet的头列
*
* @param sheet
* @param headerIndex 头下标
* @return
*/
public static List<String> getSheetHeader(Sheet sheet, int headerIndex) {
List<java.lang.String> headers = new ArrayList<>();
Row headerRow = sheet.getRow(headerIndex);
Iterator cellIterator = headerRow.cellIterator();
while (cellIterator.hasNext()) {
Cell cell = (Cell) cellIterator.next();
java.lang.String stringCellValue = cell.getStringCellValue();
headers.add(stringCellValue);
}
return headers;
}
/**
* 返回指定单元格的数据
*

View File

@ -185,12 +185,11 @@ public class ExcelUtil {
}
if(CollectionUtils.isNotEmpty(comments)){
comments.forEach(c -> {
for (ExcelComment c:comments) {
XSSFDrawing patr = sheet.createDrawingPatriarch();
XSSFComment cellComment = patr.createCellComment(new XSSFClientAnchor(c.dx1, c.dy1, c.dx2, c.dy2, c.col1, c.row1, c.col2, c.row2));
cellComment.setString(c.content);
});
}
}
return workbook;
}

View File

@ -313,13 +313,13 @@ public class SalarySobController {
/**
* 薪资账套校验规则列表
*/
// @POST
// @Path("/checkrule/list")
// @Produces(MediaType.APPLICATION_JSON)
// public String listSalarySobCheckRule(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySobCheckRuleQueryParam queryParam) {
// User user = HrmUserVarify.getUser(request, response);
// return new ResponseResult<SalarySobCheckRuleQueryParam, Map<String, Object>>().run(getSalarySobCheckRuleWrapper(user)::listPage, queryParam);
// }
@POST
@Path("/checkrule/list")
@Produces(MediaType.APPLICATION_JSON)
public String listSalarySobCheckRule(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySobCheckRuleQueryParam queryParam) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<SalarySobCheckRuleQueryParam, PageInfo<SalarySobCheckRuleListDTO>>().run(getSalarySobCheckRuleWrapper(user)::listPage, queryParam);
}
/**
* 薪资账套校验规则表单

View File

@ -21,7 +21,6 @@ import com.engine.salary.service.SalaryArchiveItemService;
import com.engine.salary.service.SalaryArchiveService;
import com.engine.salary.service.TaxAgentService;
import com.engine.salary.service.impl.SalaryArchiveItemServiceImpl;
import com.engine.salary.service.impl.SalaryArchiveServiceImpl;
import com.engine.salary.service.impl.TaxAgentServiceImpl;
import com.engine.salary.util.SalaryDateUtil;
import com.engine.salary.util.SalaryI18nUtil;
@ -45,7 +44,8 @@ import java.util.stream.Collectors;
public class SalaryArchiveWrapper extends Service {
private SalaryArchiveService getSalaryArchiveService(User user) {
return (SalaryArchiveService) ServiceUtil.getService(SalaryArchiveServiceImpl.class, user);
return null;
// return (SalaryArchiveService) ServiceUtil.getService(SalaryArchiveServiceImpl.class, user);
}
private SalaryArchiveItemService getSalaryArchiveItemService(User user) {

View File

@ -4,6 +4,8 @@ import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.salary.entity.salarysob.bo.SalarySobCheckRuleBO;
import com.engine.salary.entity.salarysob.dto.SalarySobCheckRuleFormDTO;
import com.engine.salary.entity.salarysob.dto.SalarySobCheckRuleListDTO;
import com.engine.salary.entity.salarysob.param.SalarySobCheckRuleQueryParam;
import com.engine.salary.entity.salarysob.param.SalarySobCheckRuleSaveParam;
import com.engine.salary.entity.salarysob.param.UpdateCheckRuleFormulaParam;
import com.engine.salary.entity.salarysob.po.SalarySobCheckRulePO;
@ -12,10 +14,13 @@ import com.engine.salary.service.SalaryFormulaService;
import com.engine.salary.service.SalarySobCheckRuleService;
import com.engine.salary.service.impl.SalarySobCheckRuleServiceImpl;
import com.engine.salary.util.SalaryI18nUtil;
import com.engine.salary.util.page.PageInfo;
import com.weaver.excel.formula.api.entity.ExpressFormula;
import weaver.hrm.User;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
/**
@ -40,27 +45,28 @@ public class SalarySobCheckRuleWrapper extends Service {
* 薪资账套的校验规则列表
*
* @param queryParam 列表查询条件
* @param tenantKey 租户key
* @return
*/
// public WeaTable<SalarySobCheckRuleListDTO> listPage(SalarySobCheckRuleQueryParam queryParam, String tenantKey) {
// // 分页查询薪资账套的校验规则
// Page<SalarySobCheckRulePO> page = salarySobCheckRuleService.listPageByParam(queryParam, tenantKey);
// // 查询公式详情
// Set<Long> formulaIds = SalaryEntityUtil.properties(page.getRecords(), SalarySobCheckRulePO::getFormulaId);
// List<ExpressFormula> expressFormulas = salaryFormulaService.listExpressFormula(formulaIds, tenantKey);
// // 转换成dto
// List<SalarySobCheckRuleListDTO> salarySobCheckRuleListDTOS = SalarySobCheckRuleBO.convert2ListDTO(page.getRecords(), expressFormulas);
// // 转换成前端所需的数据格式
// Page<SalarySobCheckRuleListDTO> dtoPage = new Page<>(page.getCurrent(), page.getSize(), page.getTotal(), page.isSearchCount());
// dtoPage.setRecords(salarySobCheckRuleListDTOS);
// return SalaryFormatUtil.<SalarySobCheckRuleListDTO>getInstance().buildTable(SalarySobCheckRuleListDTO.class, dtoPage);
// }
public PageInfo<SalarySobCheckRuleListDTO> listPage(SalarySobCheckRuleQueryParam queryParam) {
// 分页查询薪资账套的校验规则
PageInfo<SalarySobCheckRulePO> page = getSalarySobCheckRuleService(user).listPageByParam(queryParam);
// todo 查询公式详情
// Set<Long> formulaIds = SalaryEntityUtil.properties(page.getList(), SalarySobCheckRulePO::getFormulaId);
// List<ExpressFormula> expressFormulas = salaryFormulaService.listExpressFormula(formulaIds);
// 转换成dto
List<SalarySobCheckRuleListDTO> salarySobCheckRuleListDTOS = SalarySobCheckRuleBO.convert2ListDTO(page.getList(), new ArrayList<>());
// 转换成前端所需的数据格式
PageInfo<SalarySobCheckRuleListDTO> dtoPage = new PageInfo<>(salarySobCheckRuleListDTOS, SalarySobCheckRuleListDTO.class);
dtoPage.setPageSize(page.getPageSize());
dtoPage.setPageNum(page.getPageNum());
dtoPage.setTotal(page.getTotal());
return dtoPage;
}
/**
* 薪资账套的校验规则详情
*
* @param id 校验规则的id
* @param id 校验规则的id
* @return
*/
public SalarySobCheckRuleFormDTO getForm(Long id) {
@ -83,7 +89,7 @@ public class SalarySobCheckRuleWrapper extends Service {
/**
* 保存
*
* @param saveParam 保存参数
* @param saveParam 保存参数
*/
public void save(SalarySobCheckRuleSaveParam saveParam) {
getSalarySobCheckRuleService(user).save(saveParam);
@ -110,7 +116,7 @@ public class SalarySobCheckRuleWrapper extends Service {
/**
* 删除
*
* @param ids 校验规则的id
* @param ids 校验规则的id
*/
public void delete(Collection<Long> ids) {
getSalarySobCheckRuleService(user).deleteByIds(ids);