人员入场上传
This commit is contained in:
parent
8a6fdf641a
commit
02f86476f2
|
|
@ -78,5 +78,22 @@ public class BmWorkerWageCardController extends BaseController {
|
||||||
return error("系统异常,请联系管理员");
|
return error("系统异常,请联系管理员");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新人员红绿灯状态
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//, requiresPermissions = @RequiresPermissions("system:wageCard:remove")
|
||||||
|
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth)
|
||||||
|
@PostMapping("/light/{id}")
|
||||||
|
@SysLog(title = "工资卡管理", businessType = OperaType.DELETE, logType = 0, module = "施工人员->红绿灯管理->工资卡管理", details = "更新人员红绿灯")
|
||||||
|
public void light(@PathVariable("id") Integer id) {
|
||||||
|
try {
|
||||||
|
service.updateLightByWorkerId(id);
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error(e.toString(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,17 +33,6 @@ public class PmWorkerController extends BaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private PmWorkerServiceImpl service;
|
private PmWorkerServiceImpl service;
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过主键查询单条数据
|
|
||||||
*
|
|
||||||
* @param id 主键
|
|
||||||
* @return 单条数据
|
|
||||||
*/
|
|
||||||
@GetMapping("selectOne")
|
|
||||||
public PmWorker selectOne(Integer id) {
|
|
||||||
return service.selectByPrimaryKey(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询列表
|
* 查询列表
|
||||||
* @param o
|
* @param o
|
||||||
|
|
|
||||||
|
|
@ -46,4 +46,8 @@ public interface BmWorkerWageCardMapper {
|
||||||
* @return update count
|
* @return update count
|
||||||
*/
|
*/
|
||||||
int updateByPrimaryKeySelective(BmWorkerWageCard record);
|
int updateByPrimaryKeySelective(BmWorkerWageCard record);
|
||||||
|
|
||||||
|
int selectWageCardAndContract(Integer id);
|
||||||
|
|
||||||
|
void updateEinMsgByWorkerId(Integer id);
|
||||||
}
|
}
|
||||||
|
|
@ -24,14 +24,6 @@ public interface PmWorkerMapper {
|
||||||
*/
|
*/
|
||||||
int insert(PmWorker record);
|
int insert(PmWorker record);
|
||||||
|
|
||||||
/**
|
|
||||||
* insert record to table selective
|
|
||||||
*
|
|
||||||
* @param record the record
|
|
||||||
* @return insert count
|
|
||||||
*/
|
|
||||||
int insertSelective(PmWorker record);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* select by primary key
|
* select by primary key
|
||||||
*
|
*
|
||||||
|
|
@ -40,22 +32,6 @@ public interface PmWorkerMapper {
|
||||||
*/
|
*/
|
||||||
PmWorker selectByPrimaryKey(Integer id);
|
PmWorker selectByPrimaryKey(Integer id);
|
||||||
|
|
||||||
/**
|
|
||||||
* update record selective
|
|
||||||
*
|
|
||||||
* @param record the updated record
|
|
||||||
* @return update count
|
|
||||||
*/
|
|
||||||
int updateByPrimaryKeySelective(PmWorker record);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* update record
|
|
||||||
*
|
|
||||||
* @param record the updated record
|
|
||||||
* @return update count
|
|
||||||
*/
|
|
||||||
int updateByPrimaryKey(PmWorker record);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询人员列表
|
* 查询人员列表
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -40,5 +40,12 @@ public interface BmWorkerWageCardService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int deleteByPrimaryKey(Integer id);
|
int deleteByPrimaryKey(Integer id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新人员红绿灯
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
void updateLightByWorkerId(Integer id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,12 +13,8 @@ public interface PmWorkerService{
|
||||||
|
|
||||||
AjaxResult insert(PmWorker record);
|
AjaxResult insert(PmWorker record);
|
||||||
|
|
||||||
int insertSelective(PmWorker record);
|
|
||||||
|
|
||||||
PmWorker selectByPrimaryKey(Integer id);
|
PmWorker selectByPrimaryKey(Integer id);
|
||||||
|
|
||||||
int updateByPrimaryKeySelective(PmWorker record);
|
|
||||||
|
|
||||||
int updateByPrimaryKey(PmWorker record);
|
int updateByPrimaryKey(PmWorker record);
|
||||||
|
|
||||||
List<PmWorker> selectWorkList(PmWorkerDto o);
|
List<PmWorker> selectWorkList(PmWorkerDto o);
|
||||||
|
|
|
||||||
|
|
@ -80,5 +80,18 @@ public class BmWorkerWageCardServiceImpl implements BmWorkerWageCardService {
|
||||||
//删除minio文件
|
//删除minio文件
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateLightByWorkerId(Integer id) {
|
||||||
|
//查询工资卡和合同是不是存在
|
||||||
|
int i = selectWageCardAndContract(id);
|
||||||
|
if(i==2){
|
||||||
|
mapper.updateEinMsgByWorkerId(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private int selectWageCardAndContract(Integer id) {
|
||||||
|
return mapper.selectWageCardAndContract(id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -94,11 +94,6 @@ public class PmWorkerServiceImpl implements PmWorkerService{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int insertSelective(PmWorker record) {
|
|
||||||
return mapper.insertSelective(record);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PmWorker selectByPrimaryKey(Integer id) {
|
public PmWorker selectByPrimaryKey(Integer id) {
|
||||||
//人员数据
|
//人员数据
|
||||||
|
|
@ -118,11 +113,6 @@ public class PmWorkerServiceImpl implements PmWorkerService{
|
||||||
return worker;
|
return worker;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int updateByPrimaryKeySelective(PmWorker record) {
|
|
||||||
return mapper.updateByPrimaryKeySelective(record);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int updateByPrimaryKey(PmWorker record) {
|
public int updateByPrimaryKey(PmWorker record) {
|
||||||
//已经入过场了
|
//已经入过场了
|
||||||
|
|
|
||||||
|
|
@ -102,4 +102,27 @@
|
||||||
</set>
|
</set>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<select id="selectWageCardAndContract" resultType="int">
|
||||||
|
SELECT
|
||||||
|
SUM(num)
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
count(1) as num
|
||||||
|
FROM
|
||||||
|
`bm_worker_wage_card` where is_active = 1 and worker_id = #{workerId}
|
||||||
|
UNION ALL
|
||||||
|
SELECT
|
||||||
|
count(1) as num
|
||||||
|
FROM
|
||||||
|
`bm_worker_contract` where is_active = 1 and worker_id = #{workerId}
|
||||||
|
) t
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<update id="updateEinMsgByWorkerId">
|
||||||
|
update bm_worker_ein_msg
|
||||||
|
set light_status = 2
|
||||||
|
where worker_id = #{workerId}
|
||||||
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
@ -74,186 +74,6 @@
|
||||||
values (#{name}, #{idNumber}, #{sex}, #{age}, #{phone}, #{birthday}, #{nation}, #{issuingAuthority},
|
values (#{name}, #{idNumber}, #{sex}, #{age}, #{phone}, #{birthday}, #{nation}, #{issuingAuthority},
|
||||||
#{startTime}, #{endTime}, #{address}, #{facePhoto}, #{createUser})
|
#{startTime}, #{endTime}, #{address}, #{facePhoto}, #{createUser})
|
||||||
</insert>
|
</insert>
|
||||||
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.bonus.bmw.domain.vo.PmWorker" useGeneratedKeys="true">
|
|
||||||
<!--@mbg.generated-->
|
|
||||||
insert into pm_worker
|
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
||||||
<if test="name != null">
|
|
||||||
`name`,
|
|
||||||
</if>
|
|
||||||
<if test="idNumber != null">
|
|
||||||
id_number,
|
|
||||||
</if>
|
|
||||||
<if test="sex != null">
|
|
||||||
sex,
|
|
||||||
</if>
|
|
||||||
<if test="age != null">
|
|
||||||
age,
|
|
||||||
</if>
|
|
||||||
<if test="phone != null">
|
|
||||||
phone,
|
|
||||||
</if>
|
|
||||||
<if test="birthday != null">
|
|
||||||
birthday,
|
|
||||||
</if>
|
|
||||||
<if test="nation != null">
|
|
||||||
nation,
|
|
||||||
</if>
|
|
||||||
<if test="issuingAuthority != null">
|
|
||||||
issuing_authority,
|
|
||||||
</if>
|
|
||||||
<if test="startTime != null">
|
|
||||||
start_time,
|
|
||||||
</if>
|
|
||||||
<if test="endTime != null">
|
|
||||||
end_time,
|
|
||||||
</if>
|
|
||||||
<if test="address != null">
|
|
||||||
address,
|
|
||||||
</if>
|
|
||||||
<if test="facePhoto != null">
|
|
||||||
face_photo,
|
|
||||||
</if>
|
|
||||||
<if test="einStatus != null">
|
|
||||||
ein_status,
|
|
||||||
</if>
|
|
||||||
<if test="lightStatus != null">
|
|
||||||
light_status,
|
|
||||||
</if>
|
|
||||||
<if test="createUser != null">
|
|
||||||
create_user,
|
|
||||||
</if>
|
|
||||||
<if test="updateUser != null">
|
|
||||||
update_user,
|
|
||||||
</if>
|
|
||||||
</trim>
|
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
||||||
<if test="name != null">
|
|
||||||
#{name},
|
|
||||||
</if>
|
|
||||||
<if test="idNumber != null">
|
|
||||||
#{idNumber},
|
|
||||||
</if>
|
|
||||||
<if test="sex != null">
|
|
||||||
#{sex},
|
|
||||||
</if>
|
|
||||||
<if test="age != null">
|
|
||||||
#{age},
|
|
||||||
</if>
|
|
||||||
<if test="phone != null">
|
|
||||||
#{phone},
|
|
||||||
</if>
|
|
||||||
<if test="birthday != null">
|
|
||||||
#{birthday},
|
|
||||||
</if>
|
|
||||||
<if test="nation != null">
|
|
||||||
#{nation},
|
|
||||||
</if>
|
|
||||||
<if test="issuingAuthority != null">
|
|
||||||
#{issuingAuthority},
|
|
||||||
</if>
|
|
||||||
<if test="startTime != null">
|
|
||||||
#{startTime},
|
|
||||||
</if>
|
|
||||||
<if test="endTime != null">
|
|
||||||
#{endTime},
|
|
||||||
</if>
|
|
||||||
<if test="address != null">
|
|
||||||
#{address},
|
|
||||||
</if>
|
|
||||||
<if test="facePhoto != null">
|
|
||||||
#{facePhoto},
|
|
||||||
</if>
|
|
||||||
<if test="einStatus != null">
|
|
||||||
#{einStatus},
|
|
||||||
</if>
|
|
||||||
<if test="lightStatus != null">
|
|
||||||
#{lightStatus},
|
|
||||||
</if>
|
|
||||||
<if test="createUser != null">
|
|
||||||
#{createUser},
|
|
||||||
</if>
|
|
||||||
<if test="updateUser != null">
|
|
||||||
#{updateUser},
|
|
||||||
</if>
|
|
||||||
</trim>
|
|
||||||
</insert>
|
|
||||||
<update id="updateByPrimaryKeySelective" parameterType="com.bonus.bmw.domain.vo.PmWorker">
|
|
||||||
<!--@mbg.generated-->
|
|
||||||
update pm_worker
|
|
||||||
<set>
|
|
||||||
<if test="name != null">
|
|
||||||
`name` = #{name},
|
|
||||||
</if>
|
|
||||||
<if test="idNumber != null">
|
|
||||||
id_number = #{idNumber},
|
|
||||||
</if>
|
|
||||||
<if test="sex != null">
|
|
||||||
sex = #{sex},
|
|
||||||
</if>
|
|
||||||
<if test="age != null">
|
|
||||||
age = #{age},
|
|
||||||
</if>
|
|
||||||
<if test="phone != null">
|
|
||||||
phone = #{phone},
|
|
||||||
</if>
|
|
||||||
<if test="birthday != null">
|
|
||||||
birthday = #{birthday},
|
|
||||||
</if>
|
|
||||||
<if test="nation != null">
|
|
||||||
nation = #{nation},
|
|
||||||
</if>
|
|
||||||
<if test="issuingAuthority != null">
|
|
||||||
issuing_authority = #{issuingAuthority},
|
|
||||||
</if>
|
|
||||||
<if test="startTime != null">
|
|
||||||
start_time = #{startTime},
|
|
||||||
</if>
|
|
||||||
<if test="endTime != null">
|
|
||||||
end_time = #{endTime},
|
|
||||||
</if>
|
|
||||||
<if test="address != null">
|
|
||||||
address = #{address},
|
|
||||||
</if>
|
|
||||||
<if test="facePhoto != null">
|
|
||||||
face_photo = #{facePhoto},
|
|
||||||
</if>
|
|
||||||
<if test="einStatus != null">
|
|
||||||
ein_status = #{einStatus},
|
|
||||||
</if>
|
|
||||||
<if test="lightStatus != null">
|
|
||||||
light_status = #{lightStatus},
|
|
||||||
</if>
|
|
||||||
<if test="createUser != null">
|
|
||||||
create_user = #{createUser},
|
|
||||||
</if>
|
|
||||||
<if test="updateUser != null">
|
|
||||||
update_user = #{updateUser},
|
|
||||||
</if>
|
|
||||||
</set>
|
|
||||||
where id = #{id}
|
|
||||||
</update>
|
|
||||||
<update id="updateByPrimaryKey" parameterType="com.bonus.bmw.domain.vo.PmWorker">
|
|
||||||
<!--@mbg.generated-->
|
|
||||||
update pm_worker
|
|
||||||
set `name` = #{name},
|
|
||||||
id_number = #{idNumber},
|
|
||||||
sex = #{sex},
|
|
||||||
age = #{age},
|
|
||||||
phone = #{phone},
|
|
||||||
birthday = #{birthday},
|
|
||||||
nation = #{nation},
|
|
||||||
issuing_authority = #{issuingAuthority},
|
|
||||||
start_time = #{startTime},
|
|
||||||
end_time = #{endTime},
|
|
||||||
address = #{address},
|
|
||||||
face_photo = #{facePhoto},
|
|
||||||
ein_status = #{einStatus},
|
|
||||||
light_status = #{lightStatus},
|
|
||||||
create_user = #{createUser},
|
|
||||||
update_user = #{updateUser}
|
|
||||||
where id = #{id}
|
|
||||||
</update>
|
|
||||||
|
|
||||||
<select id="selectWorkList" resultMap="BaseResultMap">
|
<select id="selectWorkList" resultMap="BaseResultMap">
|
||||||
SELECT
|
SELECT
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue