Merge remote-tracking branch 'origin/master'
# Conflicts:
# server/src/main/java/doumeemes/dao/business/model/SalaryParam.java
| | |
| | | import doumeemes.dao.business.model.WorkorderRecord; |
| | | import doumeemes.dao.ext.bean.EndCheckApBean; |
| | | import doumeemes.dao.ext.beanDto.QueryWStockDto; |
| | | import doumeemes.dao.ext.dto.QuerySalaryStatisticDTO; |
| | | import doumeemes.dao.ext.dto.QueryWorkorderRecordExtDTO; |
| | | import doumeemes.dao.ext.vo.SalaryStatisticsListVO; |
| | | import doumeemes.dao.ext.vo.WStockExtListForWorkorderVO; |
| | | import doumeemes.dao.ext.vo.WStockExtListVO; |
| | | import doumeemes.dao.ext.vo.WorkorderRecordExtListVO; |
| | |
| | | public ApiResponse<PageData<WorkorderRecordExtListVO>> findPage (@RequestBody PageWrap<QueryWorkorderRecordExtDTO> pageWrap) { |
| | | return ApiResponse.success(workorderRecordExtService.findPage(pageWrap)); |
| | | } |
| | | @ApiOperation("å·¥èµæ¥è¡¨ç»è®¡å页æ¥è¯¢") |
| | | @PostMapping("/salaryStatistic") |
| | | @RequiresPermissions("ext:workorderrecordext:query") |
| | | public ApiResponse<PageData<SalaryStatisticsListVO>> salaryStatistic (@RequestBody PageWrap<QuerySalaryStatisticDTO> pageWrap) { |
| | | return ApiResponse.success(workorderRecordExtService.salaryStatistic(pageWrap)); |
| | | } |
| | | |
| | | @ApiOperation("æ¥è¯¢å
¨é¨") |
| | | @PostMapping("/all") |
| | |
| | | for (SystemMenu menu : menus) { |
| | | if(Constants.equalsInteger(menu.getType(),Constants.PlatType.companyH5) && StringUtils.isNotBlank(menu.getIcon())){ |
| | | menu.setIcon(rPath+menu.getIcon()); |
| | | menu.setResourcePath(rPath); |
| | | } |
| | | if (menu.getParentId() == null) { |
| | | SystemMenuListVO rootMenu = new SystemMenuListVO(); |
| | |
| | | for (SystemMenuListVO child : rootMenus) { |
| | | if(Constants.equalsInteger(child.getType(),Constants.PlatType.companyH5) && StringUtils.isNotBlank(child.getIcon())){ |
| | | child.setIcon(rPath+child.getIcon()); |
| | | child.setResourcePath(rPath); |
| | | } |
| | | this.fillChildren(child, menus); |
| | | } |
| | |
| | | @NotEmpty(message = "ç©æç¼ç ä¸è½ä¸ºç©º") |
| | | private Integer materialId; |
| | | |
| | | @ApiModelProperty(value = "å·¥èµåä»·ï¼å
)") |
| | | @ApiModelProperty(value = "å·¥èµç»æï¼å
)", example = "1") |
| | | @ExcelColumn(name="å·¥èµç»æï¼å
)") |
| | | private Integer salary; |
| | | @ApiModelProperty(value = "å·¥èµåä»·ï¼å
)", example = "1") |
| | | @ExcelColumn(name="å·¥èµåä»·ï¼å
)") |
| | | private BigDecimal salary; |
| | | private Integer salaryPrice; |
| | | |
| | | @ApiModelProperty(value = "æ åæ°é") |
| | | @ExcelColumn(name="æ åæ°é") |
| | |
| | | @ExcelColumn(name="æ¥å·¥æ¶é¿ï¼ç§ï¼") |
| | | private Integer duration; |
| | | |
| | | @ApiModelProperty(value = "å·¥èµåä»·ï¼å)", example = "1") |
| | | @ExcelColumn(name="å·¥èµåä»·ï¼å)") |
| | | @ApiModelProperty(value = "å·¥èµç»æï¼å
)", example = "1") |
| | | @ExcelColumn(name="å·¥èµç»æï¼å
)") |
| | | private Integer salary; |
| | | |
| | | @ApiModelProperty(value = "å·¥èµåä»·ï¼å
)", example = "1") |
| | | @ExcelColumn(name="å·¥èµåä»·ï¼å
)") |
| | | private Integer salaryPrice; |
| | | @ApiModelProperty(value = "æ åæ°é", example = "1") |
| | | @ExcelColumn(name="æ åæ°é") |
| | | private Integer salaryNum; |
| | |
| | | |
| | | import doumeemes.dao.business.model.WorkorderRecord; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import doumeemes.dao.ext.dto.QuerySalaryStatisticDTO; |
| | | import doumeemes.dao.ext.vo.SalaryStatisticsListVO; |
| | | import doumeemes.dao.ext.vo.WOutboundRecordExtListVO; |
| | | import doumeemes.dao.ext.vo.WStockExtListForWorkorderVO; |
| | | import doumeemes.dao.ext.vo.WorkorderRecordExtListVO; |
| | |
| | | * @date 2022/04/20 10:56 |
| | | */ |
| | | List<WorkorderRecordExtListVO> selectListNew(QueryWorkorderRecordExtDTO dto); |
| | | List<SalaryStatisticsListVO> salaryStatistic(QuerySalaryStatisticDTO dto); |
| | | |
| | | List<WStockExtListForWorkorderVO> choiceWorkorderRecordUseStockList(QueryWorkorderRecordExtDTO dto); |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package doumeemes.dao.ext.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import doumeemes.dao.business.dto.MaterialListDTO; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author æ±è¹è¹ |
| | | * @date 2022/04/20 10:56 |
| | | */ |
| | | @Data |
| | | @ApiModel("å·¥èµæ¥è¡¨ç»è®¡å页æ¥è¯¢è¯·æ±åæ°") |
| | | public class QuerySalaryStatisticDTO { |
| | | @ApiModelProperty(value = "ç产人åç¼ç ", example = "1") |
| | | private Integer userId; |
| | | @ApiModelProperty(value = "æ ¹ç»ç»ç¼ç ", example = "1",hidden = true) |
| | | private Integer rootDepartId; |
| | | @ApiModelProperty(value = "å¼å§æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date stateDate; |
| | | @ApiModelProperty(value = "ç»ææ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date endDate; |
| | | |
| | | @ApiModelProperty(value = "æ°æ®æéé¨é¨ç¼ç éå" ,hidden = true) |
| | | private List<Integer> departIds; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "æ¥å·¥æ¶é¿ï¼ç§ï¼", example = "1") |
| | | private Integer duration; |
| | | |
| | | @ApiModelProperty(value = "å·¥èµåä»·ï¼å)", example = "1") |
| | | @ApiModelProperty(value = "å·¥èµç»æï¼å
)", example = "1") |
| | | private Integer salary; |
| | | |
| | | @ApiModelProperty(value = "å·¥èµåä»·ï¼å
)", example = "1") |
| | | private Integer salaryPrice; |
| | | @ApiModelProperty(value = "æ åæ°é", example = "1") |
| | | private Integer salaryNum; |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package doumeemes.dao.ext.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import doumeemes.core.annotation.excel.ExcelColumn; |
| | | import doumeemes.dao.business.model.*; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author æ±è¹è¹ |
| | | * @date 2022/04/20 10:56 |
| | | */ |
| | | @Data |
| | | @ApiModel("å·¥èµæ¥è¡¨ç»è®¡åé¡µæ°æ®") |
| | | public class SalaryStatisticsListVO implements Serializable{ |
| | | |
| | | @ApiModelProperty(value = "ç产人åç¼ç ", example = "1") |
| | | @ExcelColumn(name="ç产人åç¼ç ") |
| | | private Integer userId; |
| | | @ApiModelProperty(value = "ç产人åå§å") |
| | | @ExcelColumn(name="ç产人åå§å") |
| | | private String userName; |
| | | @ApiModelProperty(value = "æå±é¨é¨ç¼ç ", example = "1") |
| | | @ExcelColumn(name="æå±é¨é¨ç¼ç ") |
| | | private Integer departId; |
| | | |
| | | @ApiModelProperty(value = "æå±é¨é¨åç§°") |
| | | @ExcelColumn(name="æå±é¨é¨åç§°") |
| | | private String departName; |
| | | |
| | | @ApiModelProperty(value = "计件工èµï¼åï¼", example = "1") |
| | | @ExcelColumn(name="计件工èµï¼åï¼") |
| | | private BigDecimal jijianSalary; |
| | | @ApiModelProperty(value = "计æ¶å·¥èµï¼åï¼", example = "1") |
| | | @ExcelColumn(name="计æ¶å·¥èµï¼åï¼") |
| | | private BigDecimal jishiSalary; |
| | | @ApiModelProperty(value = "å°è®¡å·¥èµï¼åï¼", example = "1") |
| | | @ExcelColumn(name="å°è®¡å·¥èµï¼åï¼") |
| | | private BigDecimal totalSalary; |
| | | @ApiModelProperty(value = "æ¥å·¥æ»åæ°,ä¸å
å«å·¥èµä¸º0ç", example = "1") |
| | | @ExcelColumn(name="æ¥å·¥æ»åæ°") |
| | | private Integer num; |
| | | |
| | | } |
| | |
| | | @ExcelColumn(name="æ¥å·¥æ¶é¿ï¼ç§ï¼") |
| | | private Integer duration; |
| | | |
| | | @ApiModelProperty(value = "å·¥èµåä»·ï¼å)", example = "1") |
| | | @ExcelColumn(name="å·¥èµåä»·ï¼å)") |
| | | @ApiModelProperty(value = "å·¥èµç»æï¼å
)", example = "1") |
| | | @ExcelColumn(name="å·¥èµç»æï¼å
)") |
| | | private Integer salary; |
| | | @ApiModelProperty(value = "å·¥èµåä»·ï¼å
)", example = "1") |
| | | @ExcelColumn(name="å·¥èµåä»·ï¼å
)") |
| | | private Integer salaryPrice; |
| | | |
| | | @ApiModelProperty(value = "æ åæ°é", example = "1") |
| | | @ExcelColumn(name="æ åæ°é") |
| | |
| | | |
| | | @ApiModelProperty(value = "ç±»å 0å¹³å° 1ä¼ä¸PC端 2ä¼ä¸ææºç«¯", example = "1") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "æä»¶è®¿é®åç¼") |
| | | @TableField(exist = false) |
| | | private String resourcePath; |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "æ´æ°äººä¿¡æ¯") |
| | | private SystemUser updateUserInfo; |
| | | @ApiModelProperty(value = "æä»¶è®¿é®åç¼") |
| | | private String resourcePath; |
| | | } |
| | |
| | | import doumeemes.dao.business.model.Workorder; |
| | | import doumeemes.dao.business.model.WorkorderRecord; |
| | | import doumeemes.dao.ext.bean.EndCheckApBean; |
| | | import doumeemes.dao.ext.dto.QuerySalaryStatisticDTO; |
| | | import doumeemes.dao.ext.dto.QueryWorkorderRecordExtDTO; |
| | | import doumeemes.dao.ext.vo.SalaryStatisticsListVO; |
| | | import doumeemes.dao.ext.vo.WorkorderRecordExtListVO; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | |
| | | |
| | | void exportExcel(PageWrap<QueryWorkorderRecordExtDTO> pageWrap ,HttpServletResponse response); |
| | | |
| | | PageData<SalaryStatisticsListVO> salaryStatistic(PageWrap<QuerySalaryStatisticDTO> pageWrap); |
| | | } |
| | |
| | | } |
| | | return PageData.from(new PageInfo<>(result)); |
| | | } |
| | | @Override |
| | | public PageData<SalaryStatisticsListVO> salaryStatistic(PageWrap<QuerySalaryStatisticDTO> pageWrap) { |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | if(!Constants.equalsInteger(user.getType(),Constants.USERTYPE.COM)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "对ä¸èµ·ï¼æ¨æ æéè¿è¡è¯¥æä½ï¼"); |
| | | } |
| | | //åªè½æ¥çå½åæ ¹ç»ç»çæ°æ® |
| | | pageWrap.getModel().setRootDepartId(user.getRootDepartment().getId()); |
| | | pageWrap.getModel().setRootDepartId(user.getRootDepartment().getId()); |
| | | PageHelper.startPage(pageWrap.getPage(), pageWrap.getCapacity()); |
| | | |
| | | //æ°æ®æé |
| | | List<Integer> dataPermission = user.getDepartPermissionList(); |
| | | if(dataPermission!=null){ |
| | | // pageWrap.getModel().setUserId(user.getId()); |
| | | // pageWrap.getModel().setDepartIds(dataPermission); |
| | | /*if(dataPermission.size() == 0){ |
| | | //åªè½çèªå·±ç(ç产人åä¿¡æ¯ï¼ |
| | | // pageWrap.getModel().setProUserId(user.getId()); |
| | | //鿱忴 æ¥çæ°æ®æéèå´å
çæ°æ®ï¼èµ°å建人æè
ç产人åä¸ºææ°æ®æéèå´å
ï¼ï¼ |
| | | pageWrap.getModel().setCreateUser(user.getId()); |
| | | }else{ |
| | | //å¦åèµ°æ°æ®æé |
| | | pageWrap.getModel().setDepartIds(dataPermission); |
| | | }*/ |
| | | } |
| | | List<SalaryStatisticsListVO> result = workorderRecordExtMapper.salaryStatistic(pageWrap.getModel()); |
| | | if(result!=null){ |
| | | List<DepartmentExtListVO> allDepartList = RedisUtil.getObject(redisTemplate,Constants.RedisKeys.COM_DEPART_LIST_KEY+user.getCompany().getId(),ArrayList.class); |
| | | for(SalaryStatisticsListVO model : result){ |
| | | //æ¥è¯¢ç产人åå§å |
| | | initProUser(user,model,allDepartList); |
| | | } |
| | | } |
| | | return PageData.from(new PageInfo<>(result)); |
| | | } |
| | | |
| | | private void initProUser(LoginUserInfo user, WorkorderRecordExtListVO data, List<DepartmentExtListVO> allDepartList) { |
| | | if(data.getCreateUser() ==null){ |
| | |
| | | data.setProcedureName(comp.getName()+"-"+dName); |
| | | } |
| | | } |
| | | private void initProUser(LoginUserInfo user, SalaryStatisticsListVO data, List<DepartmentExtListVO> allDepartList) { |
| | | if(data.getUserId() ==null){ |
| | | return; |
| | | } |
| | | CompanyUser query=new CompanyUser(); |
| | | query.setUserId(data.getUserId()); |
| | | query.setRootDepartId(user.getRootDepartment().getId()); |
| | | query.setDeleted(Constants.ZERO); |
| | | CompanyUser comp= companyUserExtMapper.selectOne(new QueryWrapper<>(query).last(" limit 1")); |
| | | if(comp!=null){ |
| | | DepartmentExtListVO d = departmentExtService.getModelById(user.getCompany().getId(),comp.getDepartmentId(),allDepartList); |
| | | String dName =d==null?"":StringUtils.defaultString(d.getName(),""); |
| | | data.setUserName(comp.getName()+"-"+dName); |
| | | } |
| | | } |
| | | @Override |
| | | public List<WorkorderRecordExtListVO> findAll(QueryWorkorderRecordExtDTO pageWrap) { |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | |
| | | </where> |
| | | limit 1 |
| | | </select> |
| | | <select id="salaryStatistic" parameterType="doumeemes.dao.ext.dto.QuerySalaryStatisticDTO" resultType="doumeemes.dao.ext.vo.SalaryStatisticsListVO"> |
| | | select `CREATE_USER` ,sum(CASE WHEN salary_type=0 THEN salary ELSE 0 END ) as jijiaSalry |
| | | ,sum(CASE WHEN salary_type=0 THEN 0 ELSE salary END ) as jishiSalary |
| | | ,count(id) as num |
| | | ,sum(salary) as totalSalary |
| | | from `workorder_record` |
| | | where `DELETED` =0 and `SALARY` >0 |
| | | <if test="rootDepartId != null"> |
| | | AND `ROOT_DEPART_ID` = #{rootDepartId} |
| | | </if> |
| | | <if test="userId != null"> |
| | | AND `CREATE_USER` = #{userId} |
| | | </if> |
| | | group by `CREATE_USER` |
| | | |
| | | </select> |
| | | <select id="selectListNew" parameterType="doumeemes.dao.ext.dto.QueryWorkorderRecordExtDTO" resultMap="WorkorderRecordExtListVO"> |
| | | SELECT |
| | | `a`.`ID`, |
| | |
| | | RELOBJ_TYPE, |
| | | `DURATION`, |
| | | `SALARY`, |
| | | `SALARY_PRICE`, |
| | | `SALARY_NUM`, |
| | | `SALARY_TIMES`, |
| | | `SALARY_UNQUALIFIED`, |
| | |
| | | #{item.relobjType}, |
| | | #{item.duration}, |
| | | #{item.salary}, |
| | | #{item.salaryPrice}, |
| | | #{item.salaryNum}, |
| | | #{item.salaryTimes}, |
| | | #{item.salaryUnqualified}, |