bug修改提交
This commit is contained in:
parent
bd986822cb
commit
4d3d900f2d
|
|
@ -1,9 +1,9 @@
|
|||
package com.bonus.bmw.controller;
|
||||
import com.bonus.bmw.domain.dto.PmWorkerDto;
|
||||
import com.bonus.bmw.domain.vo.BmWorkerLight;
|
||||
import com.bonus.bmw.domain.vo.PmWorker;
|
||||
import com.bonus.bmw.domain.vo.*;
|
||||
import com.bonus.bmw.service.BmWorkerLightService;
|
||||
import com.bonus.bmw.service.impl.BmWorkerLightServiceImpl;
|
||||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.common.log.annotation.SysLog;
|
||||
|
|
@ -11,12 +11,15 @@ import com.bonus.common.log.enums.OperaType;
|
|||
import com.bonus.common.security.annotation.InnerAuth;
|
||||
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||
import com.bonus.common.security.annotation.RequiresPermissionsOrInnerAuth;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 红绿灯统计
|
||||
|
|
@ -91,4 +94,47 @@ public class BmWorkerLightController extends BaseController {
|
|||
return getDataTableError(new ArrayList<>());
|
||||
}
|
||||
|
||||
/**
|
||||
* 红绿灯工程统计导出
|
||||
*/
|
||||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth(isUser = false), requiresPermissions = @RequiresPermissions("worker:light:export"))
|
||||
@PostMapping("/lightProExport")
|
||||
@SysLog(title = "红绿灯工程统计导出", businessType = OperaType.EXPORT, logType = 0, module = "施工人员->红绿灯管理->红绿灯统计", details = "红绿灯工程统计导出")
|
||||
public void lightProExport(HttpServletResponse response, BmWorkerLight o) {
|
||||
try {
|
||||
List<BmWorkerLight> list = service.getProLightList(o);
|
||||
ExcelUtil<BmWorkerLight> util = new ExcelUtil<>(BmWorkerLight.class);
|
||||
util.exportExcel(response, list, "红绿灯工程统计导出");
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 红绿灯人员统计导出
|
||||
*/
|
||||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth(isUser = false), requiresPermissions = @RequiresPermissions("worker:light:export"))
|
||||
@PostMapping("/lightWorkerExport")
|
||||
@SysLog(title = "红绿灯人员统计导出", businessType = OperaType.EXPORT, logType = 0, module = "施工人员->红绿灯管理->红绿灯统计", details = "红绿灯工程统计导出")
|
||||
public void lightWorkerExport(HttpServletResponse response, BmWorkerLight o) {
|
||||
try {
|
||||
try {
|
||||
List<BmWorkerLight> list = service.getWorkerLightList(o);
|
||||
List<BmWorkerLightExport> exportList = list.stream()
|
||||
.map(worker -> {
|
||||
BmWorkerLightExport export = new BmWorkerLightExport();
|
||||
BeanUtils.copyProperties(worker, export);
|
||||
return export;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
ExcelUtil<BmWorkerLightExport> util = new ExcelUtil<>(BmWorkerLightExport.class);
|
||||
util.exportExcel(response, exportList, "红绿灯人员统计导出");
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.bonus.bmw.domain.vo;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
|
|
@ -9,9 +11,14 @@ import lombok.Data;
|
|||
@Data
|
||||
public class BmWorkerLight {
|
||||
|
||||
//用于excel导出的序号一列,不需要业务逻辑处理
|
||||
@Excel(name = "序号", isSequence = true, type = Excel.Type.EXPORT,sort = 1)
|
||||
int sequence;
|
||||
|
||||
/**
|
||||
* 工程
|
||||
*/
|
||||
@Excel(name = "工程", type = Excel.Type.EXPORT,sort = 2)
|
||||
private String proName;
|
||||
|
||||
/**
|
||||
|
|
@ -79,23 +86,17 @@ public class BmWorkerLight {
|
|||
/**
|
||||
* 在场人员数量
|
||||
*/
|
||||
@Excel(name = "在场人员数量", type = Excel.Type.EXPORT,sort = 3)
|
||||
private String einNum;
|
||||
/**
|
||||
* 黄灯数量
|
||||
*/
|
||||
@Excel(name = "黄灯数量", type = Excel.Type.EXPORT,sort = 4)
|
||||
private String yellowNum;
|
||||
/**
|
||||
* 绿灯数量
|
||||
*/
|
||||
@Excel(name = "绿灯数量", type = Excel.Type.EXPORT,sort = 5)
|
||||
private String greenNum;
|
||||
|
||||
|
||||
|
||||
public String getSubComId() {
|
||||
return subComId;
|
||||
}
|
||||
|
||||
public void setSubComId(String subComId) {
|
||||
this.subComId = subComId;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
package com.bonus.bmw.domain.vo;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 所有在场人员实时信息表-离场就删除
|
||||
*/
|
||||
@Data
|
||||
public class BmWorkerLightExport {
|
||||
|
||||
//用于excel导出的序号一列,不需要业务逻辑处理
|
||||
@Excel(name = "序号", isSequence = true, type = Excel.Type.EXPORT,sort = 1)
|
||||
int sequence;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@Excel(name = "姓名", type = Excel.Type.EXPORT,sort = 2)
|
||||
private String name;
|
||||
/**
|
||||
* 身份证号
|
||||
*/
|
||||
@Excel(name = "身份证号", type = Excel.Type.EXPORT,sort = 3)
|
||||
private String idNumber;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@Excel(name = "手机号", type = Excel.Type.EXPORT,sort = 4)
|
||||
private String phone;
|
||||
|
||||
|
||||
/**
|
||||
* 工种
|
||||
*/
|
||||
@Excel(name = "工种", type = Excel.Type.EXPORT,sort = 5)
|
||||
private String postName;
|
||||
|
||||
/**
|
||||
* 工程
|
||||
*/
|
||||
@Excel(name = "工程", type = Excel.Type.EXPORT,sort = 6)
|
||||
private String proName;
|
||||
|
||||
/**
|
||||
* 分包
|
||||
*/
|
||||
@Excel(name = "分包", type = Excel.Type.EXPORT,sort = 7)
|
||||
private String subName;
|
||||
|
||||
/**
|
||||
* 班组
|
||||
*/
|
||||
@Excel(name = "班组", type = Excel.Type.EXPORT,sort = 8)
|
||||
private String teamName;
|
||||
|
||||
/**
|
||||
* 1 黄灯 2 绿灯
|
||||
*/
|
||||
@Excel(name = "状态", type = Excel.Type.EXPORT,sort = 9,readConverterExp = "1=黄灯,2=绿灯")
|
||||
private Integer lightStatus;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -3,6 +3,7 @@ package com.bonus.bmw.mapper;
|
|||
import com.bonus.bmw.domain.dto.PmWorkerDto;
|
||||
import com.bonus.bmw.domain.vo.PmWorker;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -118,5 +119,5 @@ public interface PmWorkerMapper {
|
|||
* @param phone
|
||||
* @return
|
||||
*/
|
||||
PmWorker getWorkerByPhone(String phone,String idNumber);
|
||||
PmWorker getWorkerByPhone(@Param("phone") String phone,@Param("idNumber") String idNumber);
|
||||
}
|
||||
|
|
@ -54,7 +54,7 @@ public class PmWorkerExitServiceImpl implements PmWorkerExitService {
|
|||
|
||||
//查询合同工资卡是否齐全
|
||||
List<MapBeanVo> list = mapper.getContractIdAndWageCard(record.getWorkerId());
|
||||
if("1".equals(list.get(0).getValue()) && "1".equals(list.get(1).getValue())){
|
||||
if(Integer.parseInt(list.get(0).getValue())>1 && Integer.parseInt(list.get(1).getValue())>1){
|
||||
//删除合同
|
||||
int m = contractService.deleteByWorkerId(record.getWorkerId());
|
||||
//删除实时在场
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@
|
|||
group_concat(DISTINCT psc.id) AS sub_company_id,
|
||||
group_concat(DISTINCT pp.pro_name) AS pro_name,
|
||||
group_concat(DISTINCT psc.sub_company_name) AS sub_company_name,
|
||||
count(DISTINCT psc.id) AS teamNum,
|
||||
count(DISTINCT pst.id) AS teamNum,
|
||||
count(DISTINCT bwem.worker_id) AS einNum,
|
||||
count(DISTINCT bap.worker_id) AS attNum,
|
||||
count(DISTINCT IF(bwem.light_status = 1, bwem.worker_id, NULL)) AS yellowNum,
|
||||
|
|
@ -143,8 +143,10 @@
|
|||
LEFT JOIN pm_sub_team pst ON pst.id = pstc.team_id
|
||||
AND pst.is_active = 1
|
||||
LEFT JOIN bm_worker_ein_msg bwem ON pp.id = bwem.pro_id
|
||||
AND ps.id = bwem.sub_id
|
||||
AND bwem.is_active = 1
|
||||
LEFT JOIN bm_att_person bap ON pp.id = bap.pro_id
|
||||
AND ps.id = bap.sub_id
|
||||
AND bap.is_active = 1
|
||||
AND bap.att_day = #{currentDay}
|
||||
WHERE
|
||||
|
|
@ -152,16 +154,19 @@
|
|||
<if test="subId != null">
|
||||
AND ps.id = #{subId}
|
||||
</if>
|
||||
<if test="subName != null and subName != ''">
|
||||
AND locate(#{subName},ps.sub_name)
|
||||
</if>
|
||||
GROUP BY
|
||||
ps.id
|
||||
<if test="proName != null or subComName != null or proId != null or subCompanyId != null">
|
||||
) aa
|
||||
</if>
|
||||
<where>
|
||||
<if test="proName != null">
|
||||
<if test="proName != null and proName != ''">
|
||||
AND locate(#{proName},aa.pro_name)
|
||||
</if>
|
||||
<if test="subComName != null">
|
||||
<if test="subComName != null and subComName != ''">
|
||||
AND locate(#{subComName},aa.sub_company_name)
|
||||
</if>
|
||||
<if test="proId != null">
|
||||
|
|
|
|||
|
|
@ -102,6 +102,7 @@
|
|||
bwepr.id,
|
||||
bwepr.worker_id,
|
||||
pw.`name`,
|
||||
pw.`id_number`,
|
||||
bwepr.pro_name,
|
||||
bwepr.sub_name,
|
||||
bwepr.team_name,
|
||||
|
|
|
|||
Loading…
Reference in New Issue