需求优化
This commit is contained in:
parent
09780f13e1
commit
23b9315210
|
|
@ -88,5 +88,15 @@ public class NoSignalTeamSetUpController {
|
|||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@PostMapping("delNoSignalTeam")
|
||||
@Log(title = "根据id信号班组", businessType = BusinessType.INSERT)
|
||||
@RequiresPermissions("sys:noSignalTeamSetUp:del")
|
||||
public R delNoSignalTeam(NoSignalTeamSetUpBean bean){
|
||||
Long userId = SecurityUtils.getLoginUser().getSysUser().getUserId();
|
||||
bean.setUploadId(userId.toString());
|
||||
int result = service.delNoSignalTeam(bean);
|
||||
return result > 0 ? R.ok(null,"删除成功") : R.fail(null,"删除失败");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.bmw.team.dao;
|
||||
|
||||
import com.bonus.bmw.team.entity.NoSignalTeamAttendBean;
|
||||
import com.bonus.bmw.team.entity.NoSignalTeamSetUpBean;
|
||||
import org.apache.ibatis.annotations.*;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
|
@ -22,6 +23,10 @@ public interface NoSignalTeamSetUpDao {
|
|||
|
||||
List<NoSignalTeamSetUpBean> getNoSignalTeam(NoSignalTeamSetUpBean bean);
|
||||
|
||||
int delNoSignalTeam(NoSignalTeamSetUpBean bean);
|
||||
|
||||
List<NoSignalTeamAttendBean> getPersonList(String id);
|
||||
|
||||
/*
|
||||
TeamBean getById(Long id);
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ public interface NoSignalTeamSetUpService {
|
|||
|
||||
int updNoSignalTeam(NoSignalTeamSetUpBean bean);
|
||||
|
||||
int delNoSignalTeam(NoSignalTeamSetUpBean bean);
|
||||
|
||||
/*
|
||||
|
||||
int deleteTeamManager(TeamManagerBean bean);
|
||||
|
|
|
|||
|
|
@ -1,11 +1,14 @@
|
|||
package com.bonus.bmw.team.service;
|
||||
|
||||
import com.bonus.bmw.team.dao.NoSignalTeamAttendDao;
|
||||
import com.bonus.bmw.team.dao.NoSignalTeamSetUpDao;
|
||||
import com.bonus.bmw.team.entity.NoSignalTeamAttendBean;
|
||||
import com.bonus.bmw.team.entity.NoSignalTeamSetUpBean;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
|
@ -15,6 +18,9 @@ public class NoSignalTeamSetUpServiceImpl implements NoSignalTeamSetUpService{
|
|||
@Resource(name = "noSignalTeamSetUpDao")
|
||||
private NoSignalTeamSetUpDao dao;
|
||||
|
||||
@Resource(name = "noSignalTeamAttendDao")
|
||||
private NoSignalTeamAttendDao noSignalTeamAttendDao;
|
||||
|
||||
@Override
|
||||
public int getCount(Map<String, Object> params) {
|
||||
return dao.getCount(params);
|
||||
|
|
@ -29,11 +35,18 @@ public class NoSignalTeamSetUpServiceImpl implements NoSignalTeamSetUpService{
|
|||
public int addNoSignalTeam(NoSignalTeamSetUpBean bean) {
|
||||
int msg = 0;
|
||||
List<NoSignalTeamSetUpBean> list = new ArrayList<NoSignalTeamSetUpBean>();
|
||||
List<NoSignalTeamAttendBean> beanList = new ArrayList<NoSignalTeamAttendBean>();
|
||||
try{
|
||||
//查询班组是否已经设置 (重复条件,同一分包、同一工程、同一班组,有效期未过期)
|
||||
list = dao.getNoSignalTeam(bean);
|
||||
if(list.size() <= 0){
|
||||
msg = dao.addNoSignalTeam(bean);
|
||||
//同步新增班组人员
|
||||
beanList = dao.getPersonList(bean.getId());
|
||||
for (NoSignalTeamAttendBean noSignalTeamAttendBean:beanList) {
|
||||
noSignalTeamAttendBean.setTeamId(bean.getId());
|
||||
noSignalTeamAttendDao.addPerson(noSignalTeamAttendBean);
|
||||
}
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
|
|
@ -51,4 +64,9 @@ public class NoSignalTeamSetUpServiceImpl implements NoSignalTeamSetUpService{
|
|||
return dao.updNoSignalTeam(bean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int delNoSignalTeam(NoSignalTeamSetUpBean bean) {
|
||||
return dao.delNoSignalTeam(bean);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.bmw.team.dao.NoSignalTeamSetUpDao">
|
||||
<insert id="addNoSignalTeam">
|
||||
<insert id="addNoSignalTeam" useGeneratedKeys="true" keyProperty = "id" keyColumn="id">
|
||||
INSERT INTO
|
||||
bm_no_signal_team
|
||||
(
|
||||
|
|
@ -41,6 +41,9 @@
|
|||
update_time = NOW()
|
||||
WHERE ID = #{id}
|
||||
</update>
|
||||
<delete id="delNoSignalTeam">
|
||||
update bm_no_signal_team set is_active='0' where id = #{id}
|
||||
</delete>
|
||||
|
||||
|
||||
<select id="getList" resultType="com.bonus.bmw.team.entity.NoSignalTeamSetUpBean" >
|
||||
|
|
@ -143,4 +146,25 @@
|
|||
AND bnst.team_id = #{teamId}
|
||||
AND CURRENT_DATE BETWEEN start_time AND stop_time
|
||||
</select>
|
||||
</mapper>
|
||||
<select id="getPersonList" resultType="com.bonus.bmw.team.entity.NoSignalTeamAttendBean">
|
||||
SELECT
|
||||
DISTINCT bw.id_number AS idNumber,
|
||||
bnst.team_id AS teamId,
|
||||
bw.`name` AS personName,
|
||||
bnst.start_time AS startTime,
|
||||
bnst.stop_time AS stopTime,
|
||||
bnst.remark AS remark,
|
||||
GROUP_CONCAT(bwp1.PHOTO_TYPE SEPARATOR '@') AS photoType,
|
||||
bwc.ID AS contractId,
|
||||
btur.team_id AS realityTeamId
|
||||
FROM bm_no_signal_team bnst
|
||||
LEFT JOIN bm_team_user_relation btur ON btur.team_id = bnst.team_id AND btur.is_active = '1'
|
||||
LEFT JOIN bm_worker bw ON bw.id_number = btur.id_number AND bw.IS_ACTIVE = '1'
|
||||
LEFT JOIN bm_worker_ein_history bweh on bweh.id_number = bw.id_number AND bweh.is_active ='1'
|
||||
LEFT JOIN bm_no_signal_team_person bnstp ON bnstp.id_number = bw.id_number AND bnstp.IS_ACTIVE = '1'
|
||||
LEFT JOIN bm_worker_photo bwp1 ON bwp1.ID_NUMBER = bw.id_number AND bwp1.IS_ACTIVE = '1'
|
||||
LEFT JOIN bm_worker_contract bwc ON bwc.idCard = bw.id_number AND bwc.is_active = '1' AND CURRENT_DATE() BETWEEN contractValidDate AND contractInvalidDate
|
||||
WHERE bnst.is_active = '1' AND bw.id_number is not null AND bweh.exit_status ='-1' AND bnst.id = #{id}
|
||||
GROUP BY bw.id_number
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -233,7 +233,8 @@ function setInOutData(data) {
|
|||
elem: '#exitSignPath' + layTableIndexSigns[i],
|
||||
url: fileUrl + '/file/upload',
|
||||
multiple: true, //是否允许多文件上传,默认未false
|
||||
accept: 'images',
|
||||
exts: 'jpg|png|jpeg|pdf',
|
||||
//accept: 'images',
|
||||
auto: true, //是否自动上传 ,默认为true
|
||||
max: 1, //最大上传数量
|
||||
bindAction: '#exitSignPath' + layTableIndexSigns[i], //绑定的按钮
|
||||
|
|
@ -282,7 +283,7 @@ function setInOutData(data) {
|
|||
elem: '#exitProvePath' + layTableIndexProves[i],
|
||||
url: fileUrl + '/file/upload',
|
||||
multiple: false, //是否允许多文件上传,默认未false
|
||||
exts: 'pdf',
|
||||
exts: 'jpg|png|jpeg|pdf',
|
||||
auto: true, //是否自动上传 ,默认为true
|
||||
max: 1, //最大上传数量
|
||||
bindAction: '#exitProvePath' + layTableIndexProves[i], //绑定的按钮
|
||||
|
|
@ -323,7 +324,7 @@ function setInOutData(data) {
|
|||
elem: '#salaryApplicationPath' + layTableIndexSalaryApplication[i],
|
||||
url: fileUrl + '/file/upload',
|
||||
multiple: false, //是否允许多文件上传,默认未false
|
||||
exts: 'pdf',
|
||||
exts: 'jpg|png|jpeg|pdf',
|
||||
auto: true, //是否自动上传 ,默认为true
|
||||
max: 1, //最大上传数量
|
||||
bindAction: '#salaryApplicationPath' + layTableIndexSalaryApplication[i], //绑定的按钮
|
||||
|
|
|
|||
|
|
@ -155,7 +155,12 @@ function init(){
|
|||
html += buttonUpdate(id, "sys:noSignalTeamSetUp:update", pers);
|
||||
}
|
||||
}
|
||||
|
||||
if(state == '已失效'){
|
||||
html += buttonDel(id, "sys:noSignalTeamSetUp:del", pers);
|
||||
}
|
||||
return html;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -282,3 +287,46 @@ function updateView(id) {
|
|||
}
|
||||
})
|
||||
}
|
||||
|
||||
function buttonDel(id, permission, pers) {
|
||||
if (permission != "") {
|
||||
if ($.inArray(permission, pers) < 0) {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
var btn = $("<button class='layui-btn layui-btn-xs' title='删除' onclick='delView(\"" + id + "\")'>删除</button>");
|
||||
return btn.prop("outerHTML");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* */
|
||||
function delView(id) {
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
contentType: "application/x-www-form-urlencoded",
|
||||
url: ctxPath + '/NoSignalTeamSetUp/delNoSignalTeam',
|
||||
data: {
|
||||
id: id
|
||||
},
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
layer.msg("删除成功",{icon:1});
|
||||
setTimeout(function() {
|
||||
window.location.reload();
|
||||
}, 500);
|
||||
}, error: function () {
|
||||
layer.msg("删除失败",{icon:1});
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭页面 刷新页面
|
||||
*/
|
||||
function reloading() {
|
||||
var index = parent.layer.getFrameIndex(window.name); //先得到当前 iframe层的索引
|
||||
parent.layer.close(index); //再执行关闭
|
||||
window.parent.location.reload();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue