人员出场上传
This commit is contained in:
parent
480407394a
commit
72b317f879
|
|
@ -54,11 +54,23 @@ public class PmWorkerExitController extends BaseController {
|
|||
|
||||
//, requiresPermissions = @RequiresPermissions("system:workerExit:exit")
|
||||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth)
|
||||
@PostMapping("/exit/{id}")
|
||||
@SysLog(title = "人员出场管理", businessType = OperaType.UPDATE, logType = 0, module = "施工人员->出入场管理->人员出场管理", details = "人员入场")
|
||||
public AjaxResult exit(@PathVariable("id") Integer id) {
|
||||
@PostMapping("/exit/{id}/{workerId}")
|
||||
@SysLog(title = "人员出场管理", businessType = OperaType.UPDATE, logType = 0, module = "施工人员->出入场管理->人员出场管理", details = "人员出场")
|
||||
public AjaxResult exit(@PathVariable("id") Integer id,@PathVariable("workerId") Integer workerId) {
|
||||
try {
|
||||
return toAjax(service.updateWorkerExit(id));
|
||||
return toAjax(service.updateWorkerExit(id,workerId));
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
}
|
||||
return error("系统异常,请联系管理员");
|
||||
}
|
||||
|
||||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth)
|
||||
@PostMapping("/exit/batchExit")
|
||||
@SysLog(title = "人员出场管理", businessType = OperaType.UPDATE, logType = 0, module = "施工人员->出入场管理->人员出场管理", details = "批量人员出场")
|
||||
public AjaxResult batchExit(List<PmWorkerDto> list) {
|
||||
try {
|
||||
return toAjax(service.updateWorkerBatchExit(list));
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
}
|
||||
|
|
@ -66,4 +78,24 @@ public class PmWorkerExitController extends BaseController {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询单人历史列表
|
||||
* @param o
|
||||
* @return
|
||||
* , requiresPermissions = @RequiresPermissions("system:workerExit:list")
|
||||
*/
|
||||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth(isUser = false))
|
||||
@GetMapping("/workerList")
|
||||
@SysLog(title = "人员出场管理", businessType = OperaType.QUERY, logType = 0, module = "施工人员->出入场管理->人员出场管理", details = "查询单人出场列表")
|
||||
public TableDataInfo workerList(PmWorkerDto o) {
|
||||
try {
|
||||
startPage();
|
||||
List<PmWorker> list = service.selectWorkListByWorkerId(o);
|
||||
return getDataTable(list);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
}
|
||||
return getDataTableError(new ArrayList<>());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,5 +52,10 @@ public class PmWorkerDto {
|
|||
*/
|
||||
private Integer einStatus;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private Integer workerId;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -13,11 +13,6 @@ public class PmWorker {
|
|||
*/
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 入场项目表主键
|
||||
*/
|
||||
private Integer einProId;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
|
|
@ -154,4 +149,6 @@ public class PmWorker {
|
|||
*/
|
||||
private BmWorkerWageCard bmWorkerWageCard;
|
||||
|
||||
private String workerId;
|
||||
|
||||
}
|
||||
|
|
@ -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;
|
||||
|
||||
|
|
@ -23,4 +24,15 @@ public interface PmWorkerExitMapper {
|
|||
* @return
|
||||
*/
|
||||
int deleteEinMsgByWorkerId(Integer id);
|
||||
|
||||
/**
|
||||
* 修改入场记录表入场状态
|
||||
*
|
||||
* @param id
|
||||
* @param einStatus
|
||||
* @return
|
||||
*/
|
||||
int updateEinProRecordStatus(@Param("workerId") Integer id,@Param("einStatus") Integer einStatus);
|
||||
|
||||
List<PmWorker> selectWorkListByWorkerId(PmWorkerDto o);
|
||||
}
|
||||
|
|
@ -19,7 +19,24 @@ public interface PmWorkerExitService {
|
|||
* 人员出场
|
||||
*
|
||||
* @param id
|
||||
* @param workerId
|
||||
* @return
|
||||
*/
|
||||
int updateWorkerExit(Integer id);
|
||||
int updateWorkerExit(Integer id,Integer workerId);
|
||||
|
||||
/**
|
||||
* 批量人员出场
|
||||
*
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
int updateWorkerBatchExit(List<PmWorkerDto> list);
|
||||
|
||||
/**
|
||||
* 根据人员id查询人员列表
|
||||
*
|
||||
* @param o
|
||||
* @return
|
||||
*/
|
||||
List<PmWorker> selectWorkListByWorkerId(PmWorkerDto o);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
|
|
@ -35,13 +36,40 @@ public class PmWorkerExitServiceImpl implements PmWorkerExitService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int updateWorkerExit(Integer id) {
|
||||
public int updateWorkerExit(Integer id, Integer workerId) {
|
||||
//删除合同
|
||||
int i = contractService.deleteByWorkerId(id);
|
||||
int i = contractService.deleteByWorkerId(workerId);
|
||||
//删除实时在场
|
||||
int j = mapper.deleteEinMsgByWorkerId(id);
|
||||
int j = mapper.deleteEinMsgByWorkerId(workerId);
|
||||
//修改在场记录表状态
|
||||
return 0;
|
||||
int einStatus = 2;
|
||||
int k = mapper.updateEinProRecordStatus(id,einStatus);
|
||||
return k;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateWorkerBatchExit(List<PmWorkerDto> list) {
|
||||
int count = 0;
|
||||
for (PmWorkerDto bean : list) {
|
||||
//删除合同
|
||||
int i = contractService.deleteByWorkerId(bean.getWorkerId());
|
||||
//删除实时在场
|
||||
int j = mapper.deleteEinMsgByWorkerId(bean.getWorkerId());
|
||||
int einStatus = 2;
|
||||
int k = mapper.updateEinProRecordStatus(bean.getId(),einStatus);
|
||||
count += k;
|
||||
}
|
||||
return count==list.size()?1:0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据人员id查询人员列表
|
||||
* @param o
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<PmWorker> selectWorkListByWorkerId(PmWorkerDto o) {
|
||||
return mapper.selectWorkListByWorkerId(o);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,20 +5,8 @@
|
|||
<id column="id" property="id" />
|
||||
<result column="name" property="name" />
|
||||
<result column="id_number" property="idNumber" />
|
||||
<result column="sex" property="sex" />
|
||||
<result column="age" property="age" />
|
||||
<result column="phone" property="phone" />
|
||||
<result column="birthday" property="birthday" />
|
||||
<result column="nation" property="nation" />
|
||||
<result column="issuing_authority" property="issuingAuthority" />
|
||||
<result column="start_time" property="startTime" />
|
||||
<result column="end_time" property="endTime" />
|
||||
<result column="address" property="address" />
|
||||
<result column="face_photo" property="facePhoto" />
|
||||
<result column="ein_status" property="einStatus" />
|
||||
<result column="light_status" property="lightStatus" />
|
||||
<result column="create_user" property="createUser" />
|
||||
<result column="update_user" property="updateUser" />
|
||||
<result column="pro_name" property="proName" />
|
||||
<result column="sub_name" property="subName" />
|
||||
<result column="team_name" property="teamName" />
|
||||
|
|
@ -28,12 +16,8 @@
|
|||
<result column="team_id" property="teamId" />
|
||||
<result column="post_id" property="postId" />
|
||||
<result column="sub_id" property="subId" />
|
||||
<result column="worker_id" property="workerId" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, `name`, id_number, sex, age, phone, birthday, nation, issuing_authority, start_time,
|
||||
end_time, address, face_photo, ein_status, light_status, create_user, update_user
|
||||
</sql>
|
||||
|
||||
<select id="selectWorkList" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
|
|
@ -41,8 +25,8 @@
|
|||
pw.`name`,
|
||||
pw.id_number,
|
||||
pw.phone,
|
||||
bwep.pro_id,
|
||||
bwep.pro_name,
|
||||
bwepr.pro_id,
|
||||
bwepr.pro_name,
|
||||
bwepr.sub_id,
|
||||
bwepr.sub_name,
|
||||
bwepr.team_id,
|
||||
|
|
@ -53,12 +37,10 @@
|
|||
bwepr.ein_status
|
||||
FROM
|
||||
pm_worker pw
|
||||
LEFT JOIN bm_worker_ein_pro bwep ON pw.id = bwep.worker_id
|
||||
AND bwep.is_active = 1
|
||||
LEFT JOIN bm_worker_ein_pro_record bwepr ON bwep.id = bwepr.ein_pro_id
|
||||
LEFT JOIN bm_worker_ein_pro_record bwepr ON pw.id = bwepr.worker_id
|
||||
AND bwepr.is_active = 1
|
||||
WHERE
|
||||
pw.is_active = 1
|
||||
pw.is_active = 1 And bwepr.is_last = 1
|
||||
<if test="name != null and name != ''">
|
||||
AND pw.`name` LIKE CONCAT('%', #{name}, '%')
|
||||
</if>
|
||||
|
|
@ -69,7 +51,7 @@
|
|||
AND pw.phone LIKE CONCAT('%', #{phone}, '%')
|
||||
</if>
|
||||
<if test="proId != null and proId != ''">
|
||||
AND bwep.pro_id = #{proId}
|
||||
AND bwepr.pro_id = #{proId}
|
||||
</if>
|
||||
<if test="subId != null and subId != ''">
|
||||
AND bwepr.sub_id = #{subId}
|
||||
|
|
@ -88,4 +70,27 @@
|
|||
<delete id="deleteEinMsgByWorkerId">
|
||||
DELETE FROM bm_worker_ein_msg WHERE worker_id = #{id}
|
||||
</delete>
|
||||
|
||||
<update id="updateEinProRecordStatus">
|
||||
UPDATE bm_worker_ein_pro_record SET ein_status = #{einStatus} WHERE worker_id = #{workerId}
|
||||
</update>
|
||||
|
||||
<select id="selectWorkListByWorkerId" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
bwepr.id,
|
||||
bwepr.worker_id,
|
||||
pw.`name`,
|
||||
bwepr.pro_name,
|
||||
bwepr.sub_name,
|
||||
bwepr.team_name,
|
||||
bwepr.post_name,
|
||||
bwepr.ein_time,
|
||||
bwepr.ein_status,
|
||||
bwepr.exit_time
|
||||
FROM
|
||||
pm_worker pw
|
||||
LEFT JOIN bm_worker_ein_pro_record bwepr ON pw.id = bwepr.worker_id
|
||||
WHERE
|
||||
pw.id = #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue