班组管理,班组出入场,考勤机管理
This commit is contained in:
parent
62c58c4196
commit
5e6fde7209
|
|
@ -60,13 +60,15 @@ public class BmSubContractController extends BaseController {
|
|||
/* @RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("pm:company:edit"))*/
|
||||
@PostMapping("/addOrUpdateSubContract")
|
||||
@SysLog(title = "分包商合同信息", businessType = OperaType.UPDATE, logType = 0, module = "分包商合同信息->新增和修改分包商合同信息")
|
||||
public AjaxResult addOrUpdateSubContract(@RequestParam(value = "files") MultipartFile[] files, @RequestParam(value = "fileMsg") String fileMsg, @RequestParam(value = "params")String params) {
|
||||
public AjaxResult addOrUpdateSubContract(@RequestParam(value = "files",required = false) MultipartFile[] files, @RequestParam(value = "fileMsg",required = false) String fileMsg, @RequestParam(value = "params")String params) {
|
||||
try {
|
||||
List<WebFileDto> listFile = FastJsonHelper.jsonArrStrToBeanList(fileMsg, WebFileDto.class);
|
||||
BmSubContract bmSubContract = FastJsonHelper.jsonStrToBean(params, BmSubContract.class);
|
||||
int res = bmSubContractService.addOrUpdateSubContract(bmSubContract,new FileBasicMsgDto(listFile, files));
|
||||
if (res>0){
|
||||
return toAjax(res);
|
||||
} else if (res==2) {
|
||||
return error("分包下存在班组未出场");
|
||||
}else {
|
||||
return error("分包商合同信息已存在");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,11 @@
|
|||
package com.bonus.bmw.controller;
|
||||
|
||||
import com.bonus.bmw.domain.po.PmAttDevice;
|
||||
import com.bonus.bmw.domain.vo.PmAttDeviceVo;
|
||||
import com.bonus.bmw.service.PmAttDeviceService;
|
||||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.common.log.annotation.SysLog;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
|
|
@ -11,10 +14,12 @@ import com.bonus.common.security.annotation.RequiresPermissions;
|
|||
import com.bonus.common.security.annotation.RequiresPermissionsOrInnerAuth;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -33,13 +38,13 @@ public class PmAttDeviceController extends BaseController {
|
|||
/**
|
||||
* 考勤机列表
|
||||
*/
|
||||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("sub:contract:list"))
|
||||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("att:device:list"))
|
||||
@GetMapping("/list")
|
||||
@SysLog(title = "考勤机", businessType = OperaType.QUERY, logType = 0, module = "考勤机->考勤机列表")
|
||||
public TableDataInfo list(PmAttDevice pmAttDevice) {
|
||||
try {
|
||||
startPage();
|
||||
List<PmAttDevice> list = pmAttDeviceService.selectPmAttDeviceList(pmAttDevice);
|
||||
List<PmAttDeviceVo> list = pmAttDeviceService.selectPmAttDeviceList(pmAttDevice);
|
||||
return getDataTable(list);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
|
|
@ -47,5 +52,81 @@ public class PmAttDeviceController extends BaseController {
|
|||
return getDataTableError(new ArrayList<>());
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增考勤机
|
||||
*/
|
||||
// @RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("sub:contract:list"))
|
||||
@GetMapping("/addPmAttDevice")
|
||||
@SysLog(title = "考勤机", businessType = OperaType.QUERY, logType = 0, module = "考勤机->新增考勤机")
|
||||
public AjaxResult addPmAttDevice(PmAttDevice pmAttDevice) {
|
||||
try {
|
||||
int res = pmAttDeviceService.addPmAttDevice(pmAttDevice);
|
||||
if (res>0){
|
||||
return toAjax(res);
|
||||
}else {
|
||||
return error("考勤机已存在");
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
}
|
||||
return error("系统异常,请联系管理员");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增考勤机
|
||||
*/
|
||||
// @RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("sub:contract:list"))
|
||||
@GetMapping("/updatePmAttDevice")
|
||||
@SysLog(title = "考勤机", businessType = OperaType.QUERY, logType = 0, module = "考勤机->新增考勤机")
|
||||
public AjaxResult updatePmAttDevice(PmAttDevice pmAttDevice) {
|
||||
try {
|
||||
int res = pmAttDeviceService.updatePmAttDevice(pmAttDevice);
|
||||
if (res>0){
|
||||
return toAjax(res);
|
||||
}else {
|
||||
return error("考勤机操作失败");
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
}
|
||||
return error("系统异常,请联系管理员");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除考勤机
|
||||
*/
|
||||
// @RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("sub:contract:list"))
|
||||
@GetMapping("/delPmAttDevice")
|
||||
@SysLog(title = "考勤机", businessType = OperaType.QUERY, logType = 0, module = "考勤机->删除考勤机")
|
||||
public AjaxResult delPmAttDevice(PmAttDevice pmAttDevice) {
|
||||
try {
|
||||
int res = pmAttDeviceService.delPmAttDevice(pmAttDevice);
|
||||
if (res>0){
|
||||
return toAjax(res);
|
||||
}else {
|
||||
return error("考勤机操作失败");
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
}
|
||||
return error("系统异常,请联系管理员");
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出分包商合同信息
|
||||
*/
|
||||
@PostMapping("/export")
|
||||
@SysLog(title = "考勤机", businessType = OperaType.EXPORT, logType = 0, module = "考勤机->导出考勤机")
|
||||
public void export(HttpServletResponse response, PmAttDevice pmAttDevice) {
|
||||
try {
|
||||
List<PmAttDeviceVo> list = pmAttDeviceService.selectPmAttDeviceList(pmAttDevice);
|
||||
ExcelUtil<PmAttDeviceVo> util = new ExcelUtil<PmAttDeviceVo>(PmAttDeviceVo.class);
|
||||
util.exportExcel(response, list, "考勤机");
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ public class PmSubController extends BaseController {
|
|||
/* @RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("pm:company:edit"))*/
|
||||
@PostMapping("/addOrUpdateSub")
|
||||
@SysLog(title = "分包商管理", businessType = OperaType.UPDATE, logType = 0, module = "分包商管理->新增和修改分包商")
|
||||
public AjaxResult addOrUpdateSub(@RequestParam(value = "files") MultipartFile[] files, @RequestParam(value = "fileMsg") String fileMsg, @RequestParam(value = "params")String params) {
|
||||
public AjaxResult addOrUpdateSub(@RequestParam(value = "files",required = false) MultipartFile[] files, @RequestParam(value = "fileMsg",required = false) String fileMsg, @RequestParam(value = "params")String params) {
|
||||
try {
|
||||
List<WebFileDto> listFile = FastJsonHelper.jsonArrStrToBeanList(fileMsg, WebFileDto.class);
|
||||
PmSub pmSub = FastJsonHelper.jsonStrToBean(params, PmSub.class);
|
||||
|
|
@ -87,7 +87,7 @@ public class PmSubController extends BaseController {
|
|||
if (res>0){
|
||||
return toAjax(res);
|
||||
}else {
|
||||
return error("公司下面存在未删除的分公司");
|
||||
return error("公司下面有未出场工程");
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ public class PmSubTeamContractController extends BaseController {
|
|||
/* @RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("pm:company:edit"))*/
|
||||
@PostMapping("/addOrUpdateSubTeamContract")
|
||||
@SysLog(title = "分包班组入场信息管理", businessType = OperaType.UPDATE, logType = 0, module = "分包班组入场信息管理->新增和修改分包班组信息")
|
||||
public AjaxResult addOrUpdateSubTeamContract(@RequestParam(value = "files") MultipartFile[] files, @RequestParam(value = "fileMsg") String fileMsg, @RequestParam(value = "params")String params) {
|
||||
public AjaxResult addOrUpdateSubTeamContract(@RequestParam(value = "files",required = false) MultipartFile[] files, @RequestParam(value = "fileMsg",required = false) String fileMsg, @RequestParam(value = "params")String params) {
|
||||
try {
|
||||
List<WebFileDto> listFile = FastJsonHelper.jsonArrStrToBeanList(fileMsg, WebFileDto.class);
|
||||
PmSubTeamContract pmSubTeamContract = FastJsonHelper.jsonStrToBean(params, PmSubTeamContract.class);
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
|||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 马三炮
|
||||
|
|
@ -33,7 +34,7 @@ public class BmSubContract {
|
|||
/**
|
||||
* 分包id
|
||||
*/
|
||||
private String subId;
|
||||
private Integer subId;
|
||||
|
||||
/**
|
||||
* 分包商名称
|
||||
|
|
@ -44,7 +45,7 @@ public class BmSubContract {
|
|||
/**
|
||||
* 工程id
|
||||
*/
|
||||
private String proId;
|
||||
private Integer proId;
|
||||
|
||||
/**
|
||||
* 工程名称
|
||||
|
|
@ -97,4 +98,9 @@ public class BmSubContract {
|
|||
@Excel(name = "出入场状态",sort = 5,readConverterExp = "1=在场,2=出场")
|
||||
private String subEinStatus;
|
||||
|
||||
/**
|
||||
* 删除文件id集合
|
||||
*/
|
||||
List<String> fileIdList;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
package com.bonus.bmw.domain.po;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.bonus.system.api.model.UploadFileVo;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 马三炮
|
||||
|
|
@ -103,4 +105,14 @@ public class PmSub {
|
|||
*关键字搜索
|
||||
*/
|
||||
private String keyWord;
|
||||
|
||||
/**
|
||||
* 文件列表
|
||||
*/
|
||||
List<UploadFileVo> contractFile;
|
||||
|
||||
/**
|
||||
* 删除文件id集合
|
||||
*/
|
||||
List<String> fileIdList;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
package com.bonus.bmw.domain.po;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.bonus.system.api.model.UploadFileVo;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 马三炮
|
||||
|
|
@ -95,4 +97,9 @@ public class PmSubTeamContract {
|
|||
* 是否有效
|
||||
*/
|
||||
private Integer isActive;
|
||||
|
||||
/**
|
||||
* 文件列表
|
||||
*/
|
||||
List<UploadFileVo> contractFile;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
package com.bonus.bmw.domain.vo;
|
||||
|
||||
import com.bonus.system.api.model.UploadFileVo;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 马三炮
|
||||
|
|
@ -89,4 +91,9 @@ public class BmSubContractVo {
|
|||
*/
|
||||
private String subEinStatus;
|
||||
|
||||
/**
|
||||
* 文件列表
|
||||
*/
|
||||
List<UploadFileVo> contractFile;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,78 @@
|
|||
package com.bonus.bmw.domain.vo;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author 马三炮
|
||||
* @date 2025/8/15
|
||||
*/
|
||||
@Data
|
||||
public class PmAttDeviceVo {
|
||||
|
||||
/**
|
||||
* 设备编码(唯一、必填-从硬件上获取查看)
|
||||
*/
|
||||
@Excel(name = "考勤机编号",sort = 1)
|
||||
private String deviceCode;
|
||||
|
||||
/**
|
||||
* 设备名
|
||||
*/
|
||||
@Excel(name = "考勤机名称",sort = 2)
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
* 工程id
|
||||
*/
|
||||
private Integer proId;
|
||||
|
||||
/**
|
||||
*工程名称
|
||||
*/
|
||||
@Excel(name = "工程名称",sort = 3)
|
||||
private String proName;
|
||||
|
||||
/**
|
||||
* 是否上海项目 1 是 0 不是
|
||||
*/
|
||||
@Excel(name = "是否上海项目",sort = 4)
|
||||
private Integer isShanghai;
|
||||
|
||||
/**
|
||||
*创建人
|
||||
*/
|
||||
private String createUser;
|
||||
|
||||
/**
|
||||
*修改人
|
||||
*/
|
||||
@Excel(name = "绑定人",sort = 5)
|
||||
private String updateUser;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@Excel(name = "绑定时间",sort = 6,dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 设备型号
|
||||
*/
|
||||
private String devModel;
|
||||
|
||||
/**
|
||||
* 在线状态
|
||||
*/
|
||||
private String onLine;
|
||||
}
|
||||
|
|
@ -1,20 +1,42 @@
|
|||
package com.bonus.bmw.mapper;
|
||||
|
||||
import com.bonus.bmw.domain.po.BmSubContract;
|
||||
import com.bonus.bmw.domain.po.PmSubTeamContract;
|
||||
import com.bonus.bmw.domain.vo.BmSubContractVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface BmSubContractMapper {
|
||||
/**
|
||||
* 分包商合同信息列表
|
||||
*/
|
||||
List<BmSubContractVo> selectSubContractList(BmSubContract bmSubContract);
|
||||
|
||||
/**
|
||||
* 分包商合同信息修改
|
||||
*/
|
||||
int updateSubContract(BmSubContract bmSubContract);
|
||||
|
||||
/**
|
||||
* 分包商合同信息新增
|
||||
*/
|
||||
int addSubContract(BmSubContract bmSubContract);
|
||||
|
||||
BmSubContract getSubContractBySubContractName(BmSubContract bmSubContract);
|
||||
|
||||
/**
|
||||
* 根据合同名称获取合同信息
|
||||
*/
|
||||
int delSubContract(BmSubContract bmSubContract);
|
||||
|
||||
/**
|
||||
* 根据id获取合同信息
|
||||
* @param bmSubContract
|
||||
* @return
|
||||
*/
|
||||
BmSubContractVo getSubContractById(BmSubContract bmSubContract);
|
||||
|
||||
/**
|
||||
* 后驱班组出入场信息
|
||||
* @param bmSubContract
|
||||
* @return
|
||||
*/
|
||||
List<PmSubTeamContract> getSubTeamContract(BmSubContract bmSubContract);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,19 @@
|
|||
package com.bonus.bmw.mapper;
|
||||
|
||||
import com.bonus.bmw.domain.po.PmAttDevice;
|
||||
import com.bonus.bmw.domain.vo.PmAttDeviceVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface PmAttDeviceMapper {
|
||||
List<PmAttDevice> selectPmAttDeviceList(PmAttDevice pmAttDevice);
|
||||
List<PmAttDeviceVo> selectPmAttDeviceList(PmAttDevice pmAttDevice);
|
||||
|
||||
|
||||
PmAttDevice getPmAttDeviceByCoode(PmAttDevice pmAttDevice);
|
||||
|
||||
int addPmAttDevice(PmAttDevice pmAttDevice);
|
||||
|
||||
int updatePmAttDevice(PmAttDevice pmAttDevice);
|
||||
|
||||
int delPmAttDevice(PmAttDevice pmAttDevice);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,11 +7,24 @@ import com.bonus.bmw.domain.vo.BmSubContractVo;
|
|||
import java.util.List;
|
||||
|
||||
public interface BmSubContractService {
|
||||
|
||||
/**
|
||||
* 分包商合同信息列表
|
||||
*/
|
||||
List<BmSubContractVo> selectSubContractList(BmSubContract bmSubContract);
|
||||
|
||||
/**
|
||||
* 新增和修改分包商合同信息
|
||||
*/
|
||||
int addOrUpdateSubContract(BmSubContract bmSubContract, FileBasicMsgDto fileBasicMsgDto);
|
||||
|
||||
/**
|
||||
* 删除分包商合同信息
|
||||
*/
|
||||
int delSubContract(BmSubContract bmSubContract);
|
||||
|
||||
/**
|
||||
* 分包商合同信息详情
|
||||
*/
|
||||
BmSubContractVo getSubContractById(BmSubContract bmSubContract);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,16 @@
|
|||
package com.bonus.bmw.service;
|
||||
|
||||
import com.bonus.bmw.domain.po.PmAttDevice;
|
||||
import com.bonus.bmw.domain.vo.PmAttDeviceVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface PmAttDeviceService {
|
||||
List<PmAttDevice> selectPmAttDeviceList(PmAttDevice pmAttDevice);
|
||||
List<PmAttDeviceVo> selectPmAttDeviceList(PmAttDevice pmAttDevice);
|
||||
|
||||
int addPmAttDevice(PmAttDevice pmAttDevice);
|
||||
|
||||
int updatePmAttDevice(PmAttDevice pmAttDevice);
|
||||
|
||||
int delPmAttDevice(PmAttDevice pmAttDevice);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.bonus.bmw.service.impl;
|
|||
import com.bonus.bmw.domain.dto.FileBasicMsgDto;
|
||||
import com.bonus.bmw.domain.dto.WebFileDto;
|
||||
import com.bonus.bmw.domain.po.BmSubContract;
|
||||
import com.bonus.bmw.domain.po.PmSubTeamContract;
|
||||
import com.bonus.bmw.domain.vo.BmSubContractVo;
|
||||
import com.bonus.bmw.mapper.BmSubContractMapper;
|
||||
import com.bonus.bmw.service.BmSubContractService;
|
||||
|
|
@ -13,6 +14,7 @@ import com.bonus.common.security.utils.SecurityUtils;
|
|||
import com.bonus.system.api.model.UploadFileVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
|
|
@ -33,12 +35,27 @@ public class BmSubContractServiceImpl implements BmSubContractService {
|
|||
private FileUploadUtils fileUploadUtils;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 分包商合同信息列表
|
||||
*/
|
||||
@Override
|
||||
public List<BmSubContractVo> selectSubContractList(BmSubContract bmSubContract) {
|
||||
return bmSubContractMapper.selectSubContractList(bmSubContract);
|
||||
List<BmSubContractVo> bmSubContractVoList = bmSubContractMapper.selectSubContractList(bmSubContract);
|
||||
if (bmSubContractVoList.size()>0){
|
||||
for (BmSubContractVo bmSubContractVo:bmSubContractVoList) {
|
||||
List<UploadFileVo> contractFile = fileUploadUtils.getFileList("", bmSubContractVo.getId().toString(), Constants.BM_SUB_CONTRACT, "");
|
||||
bmSubContractVo.setContractFile(contractFile);
|
||||
}
|
||||
}
|
||||
return bmSubContractVoList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增和修改分包商合同信息
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public int addOrUpdateSubContract(BmSubContract bmSubContract, FileBasicMsgDto fileBasicMsgDto) {
|
||||
//BmSubContract bmSubContractOld = bmSubContractMapper.getSubContractBySubContractName(bmSubContract);
|
||||
int res =0;
|
||||
|
|
@ -52,8 +69,20 @@ public class BmSubContractServiceImpl implements BmSubContractService {
|
|||
//出场时获取当前时间
|
||||
if ("2".equals(bmSubContract.getSubEinStatus())){
|
||||
bmSubContract.setSubExitTime(DateUtils.getDate());
|
||||
//判断下面的班组是否全部出场
|
||||
List<PmSubTeamContract> pmSubTeamContractList = bmSubContractMapper.getSubTeamContract(bmSubContract);
|
||||
if (pmSubTeamContractList.size()>0){
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
res = bmSubContractMapper.updateSubContract(bmSubContract);
|
||||
if (!bmSubContract.getFileIdList().isEmpty()){
|
||||
for (String fileId:bmSubContract.getFileIdList()
|
||||
) {
|
||||
//删除合同图片 删除minio文件
|
||||
fileUploadUtils.delFileListById(fileId, bmSubContract.getId().toString(), Constants.BM_SUB_CONTRACT,"");
|
||||
}
|
||||
}
|
||||
}else {
|
||||
/*if (StringUtils.isNotNull(bmSubContractOld)){
|
||||
return res;
|
||||
|
|
@ -66,7 +95,7 @@ public class BmSubContractServiceImpl implements BmSubContractService {
|
|||
res = bmSubContractMapper.addSubContract(bmSubContract);
|
||||
}
|
||||
//添加到文件库和minio上
|
||||
if(res > 0){
|
||||
if(res > 0 && StringUtils.isNotNull(fileBasicMsgDto.getFiles())){
|
||||
//存文件
|
||||
List<WebFileDto> fileMsg = fileBasicMsgDto.getFileMsg();
|
||||
String[] type = new String[fileMsg.size()];
|
||||
|
|
@ -78,7 +107,11 @@ public class BmSubContractServiceImpl implements BmSubContractService {
|
|||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除分包商合同信息
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public int delSubContract(BmSubContract bmSubContract) {
|
||||
//删除数据和合同图片
|
||||
int i = bmSubContractMapper.delSubContract(bmSubContract);
|
||||
|
|
@ -87,8 +120,16 @@ public class BmSubContractServiceImpl implements BmSubContractService {
|
|||
return i;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分包商合同信息详情
|
||||
*/
|
||||
@Override
|
||||
public BmSubContractVo getSubContractById(BmSubContract bmSubContract) {
|
||||
return bmSubContractMapper.getSubContractById(bmSubContract);
|
||||
BmSubContractVo bmSubContractVo =bmSubContractMapper.getSubContractById(bmSubContract);
|
||||
if (StringUtils.isNotNull(bmSubContractVo)){
|
||||
List<UploadFileVo> contractFile = fileUploadUtils.getFileList("", bmSubContractVo.getId().toString(), Constants.PM_SUB_TEAM_CONTRACT, "");
|
||||
bmSubContractVo.setContractFile(contractFile);
|
||||
}
|
||||
return bmSubContractVo;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,16 @@
|
|||
package com.bonus.bmw.service.impl;
|
||||
|
||||
import com.bonus.bmw.domain.po.PmAttDevice;
|
||||
import com.bonus.bmw.domain.vo.PmAttDeviceVo;
|
||||
import com.bonus.bmw.mapper.PmAttDeviceMapper;
|
||||
import com.bonus.bmw.service.PmAttDeviceService;
|
||||
import com.bonus.common.core.utils.StringUtils;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -21,7 +25,33 @@ public class PmAttDeviceServiceImpl implements PmAttDeviceService {
|
|||
private PmAttDeviceMapper pmAttDeviceMapper;
|
||||
|
||||
@Override
|
||||
public List<PmAttDevice> selectPmAttDeviceList(PmAttDevice pmAttDevice) {
|
||||
public List<PmAttDeviceVo> selectPmAttDeviceList(PmAttDevice pmAttDevice) {
|
||||
return pmAttDeviceMapper.selectPmAttDeviceList(pmAttDevice);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int addPmAttDevice(PmAttDevice pmAttDevice) {
|
||||
//查看是否存在
|
||||
PmAttDevice pmAttDeviceOld = pmAttDeviceMapper.getPmAttDeviceByCoode(pmAttDevice);
|
||||
if (StringUtils.isNotNull(pmAttDeviceOld)){
|
||||
return 0;
|
||||
}
|
||||
pmAttDevice.setCreateUser(SecurityUtils.getUsername());
|
||||
pmAttDevice.setCreateTime(new Date());
|
||||
pmAttDevice.setUpdateUser(SecurityUtils.getUsername());
|
||||
pmAttDevice.setUpdateTime(new Date());
|
||||
return pmAttDeviceMapper.addPmAttDevice(pmAttDevice);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updatePmAttDevice(PmAttDevice pmAttDevice) {
|
||||
pmAttDevice.setUpdateUser(SecurityUtils.getUsername());
|
||||
pmAttDevice.setUpdateTime(new Date());
|
||||
return pmAttDeviceMapper.updatePmAttDevice(pmAttDevice);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int delPmAttDevice(PmAttDevice pmAttDevice) {
|
||||
return pmAttDeviceMapper.delPmAttDevice(pmAttDevice);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,10 @@ package com.bonus.bmw.service.impl;
|
|||
|
||||
import com.bonus.bmw.domain.dto.FileBasicMsgDto;
|
||||
import com.bonus.bmw.domain.dto.WebFileDto;
|
||||
import com.bonus.bmw.domain.po.BmSubContract;
|
||||
import com.bonus.bmw.domain.po.PmSub;
|
||||
import com.bonus.bmw.domain.vo.BmSubContractVo;
|
||||
import com.bonus.bmw.mapper.BmSubContractMapper;
|
||||
import com.bonus.bmw.mapper.PmSubMapper;
|
||||
import com.bonus.bmw.service.PmSubService;
|
||||
import com.bonus.common.core.constant.Constants;
|
||||
|
|
@ -31,9 +34,19 @@ public class PmSubServiceImpl implements PmSubService {
|
|||
@Resource
|
||||
private FileUploadUtils fileUploadUtils;
|
||||
|
||||
@Resource
|
||||
private BmSubContractMapper bmSubContractMapper;
|
||||
|
||||
@Override
|
||||
public List<PmSub> selectSubList(PmSub pmSub) {
|
||||
return pmSubMapper.selectSubList(pmSub);
|
||||
List<PmSub> pmSubList = pmSubMapper.selectSubList(pmSub);
|
||||
if (pmSubList.size()>0){
|
||||
for (PmSub pmSubRes:pmSubList) {
|
||||
List<UploadFileVo> contractFile = fileUploadUtils.getFileList("", pmSubRes.getId().toString(), Constants.PM_SUB, "");
|
||||
pmSubRes.setContractFile(contractFile);
|
||||
}
|
||||
}
|
||||
return pmSubList;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -49,6 +62,13 @@ public class PmSubServiceImpl implements PmSubService {
|
|||
pmSub.setUpdateUser(SecurityUtils.getUsername());
|
||||
pmSub.setUpdateTime(new Date());
|
||||
res = pmSubMapper.updateSub(pmSub);
|
||||
//判断是否修改图片信息
|
||||
if (!pmSub.getFileIdList().isEmpty()){
|
||||
for (String fileId:pmSub.getFileIdList()) {
|
||||
//删除合同图片 删除minio文件
|
||||
fileUploadUtils.delFileListById(fileId, pmSub.getId().toString(), Constants.PM_SUB,"");
|
||||
}
|
||||
}
|
||||
}else {
|
||||
if (StringUtils.isNotNull(pmSubOld)){
|
||||
return res;
|
||||
|
|
@ -60,7 +80,7 @@ public class PmSubServiceImpl implements PmSubService {
|
|||
res = pmSubMapper.addSub(pmSub);
|
||||
}
|
||||
//添加到文件库和minio上
|
||||
if(res > 0){
|
||||
if(res > 0 && ! StringUtils.isNotNull(fileBasicMsgDto.getFiles())){
|
||||
//存文件
|
||||
List<WebFileDto> fileMsg = fileBasicMsgDto.getFileMsg();
|
||||
String[] type = new String[fileMsg.size()];
|
||||
|
|
@ -73,15 +93,17 @@ public class PmSubServiceImpl implements PmSubService {
|
|||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public int delSub(PmSub pmSub) {
|
||||
//查看当前分公司公司下面是否有项目部
|
||||
/* PmOrg pmOrg = new PmOrg();
|
||||
pmOrg.setSubComId(pmSubCompany.getId());
|
||||
List<PmOrgVo> pmOrgList = pmOrgMapper.selectPmOrgList(pmOrg);
|
||||
if (pmOrgList.size()>0){
|
||||
//查看当前分包下是否出入场
|
||||
BmSubContract bmSubContract = new BmSubContract();
|
||||
bmSubContract.setSubId(pmSub.getId());
|
||||
bmSubContract.setSubEinStatus("1");
|
||||
List<BmSubContractVo> BmSubContractVos = bmSubContractMapper.selectSubContractList(bmSubContract);
|
||||
if (BmSubContractVos.size()>0){
|
||||
return 0;
|
||||
}*/
|
||||
int res = pmSubMapper.delSub(pmSub);
|
||||
}
|
||||
int res = pmSubMapper.delSub(pmSub);
|
||||
//删除合同图片 删除minio文件
|
||||
fileUploadUtils.delFileListById("", pmSub.getId().toString(), Constants.PM_SUB,"");
|
||||
return res;
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import com.bonus.common.security.utils.SecurityUtils;
|
|||
import com.bonus.system.api.model.UploadFileVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
|
|
@ -33,10 +34,18 @@ public class PmSubTeamContractServiceImpl implements PmSubTeamContractService {
|
|||
|
||||
@Override
|
||||
public List<PmSubTeamContract> selectSubTeamContractList(PmSubTeamContract pmSubTeamContract) {
|
||||
return pmSubTeamContractMapper.selectSubTeamContractList(pmSubTeamContract);
|
||||
List<PmSubTeamContract> PmSubTeamContractList = pmSubTeamContractMapper.selectSubTeamContractList(pmSubTeamContract);
|
||||
if (PmSubTeamContractList.size()>0){
|
||||
for (PmSubTeamContract subTeamContract:PmSubTeamContractList) {
|
||||
List<UploadFileVo> contractFile = fileUploadUtils.getFileList("", subTeamContract.getId().toString(), Constants.BM_SUB_CONTRACT, "");
|
||||
subTeamContract.setContractFile(contractFile);
|
||||
}
|
||||
}
|
||||
return PmSubTeamContractList;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public int addOrUpdateSubTeamContract(PmSubTeamContract pmSubTeamContract, FileBasicMsgDto fileBasicMsgDto) {
|
||||
int res =0;
|
||||
if (StringUtils.isNotNull(pmSubTeamContract.getId())){
|
||||
|
|
@ -44,28 +53,32 @@ public class PmSubTeamContractServiceImpl implements PmSubTeamContractService {
|
|||
pmSubTeamContract.setUpdateTime(new Date());
|
||||
pmSubTeamContract.setTeamExitTime(DateUtils.getDate());
|
||||
res = pmSubTeamContractMapper.updateSubTeamContract(pmSubTeamContract);
|
||||
//添加到文件库和minio上
|
||||
if(res > 0 && StringUtils.isNotNull(fileBasicMsgDto.getFiles())){
|
||||
//存文件
|
||||
List<WebFileDto> fileMsg = fileBasicMsgDto.getFileMsg();
|
||||
String[] type = new String[fileMsg.size()];
|
||||
for (int i = 0; i < fileMsg.size(); i++) {
|
||||
type[i] = fileMsg.get(i).getType();
|
||||
}
|
||||
fileUploadUtils.uploadFile(fileBasicMsgDto.getFiles(), Constants.PM_SUB_TEAM_CONTRACT, pmSubTeamContract.getId().toString(), type,"", "");
|
||||
}
|
||||
}else {
|
||||
pmSubTeamContract.setCreateUser(SecurityUtils.getUsername());
|
||||
pmSubTeamContract.setCreateTime(new Date());
|
||||
pmSubTeamContract.setUpdateUser(SecurityUtils.getUsername());
|
||||
pmSubTeamContract.setUpdateTime(new Date());
|
||||
pmSubTeamContract.setTeamEinTime(DateUtils.getDate());
|
||||
res = pmSubTeamContractMapper.addSubTeamContract(pmSubTeamContract);
|
||||
}
|
||||
//添加到文件库和minio上
|
||||
if(res > 0){
|
||||
//存文件
|
||||
List<WebFileDto> fileMsg = fileBasicMsgDto.getFileMsg();
|
||||
String[] type = new String[fileMsg.size()];
|
||||
for (int i = 0; i < fileMsg.size(); i++) {
|
||||
type[i] = fileMsg.get(i).getType();
|
||||
}
|
||||
List<UploadFileVo> uploadFileVos = fileUploadUtils.uploadFile(fileBasicMsgDto.getFiles(), Constants.PM_SUB_TEAM_CONTRACT, pmSubTeamContract.getId().toString(), type,"", "");
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PmSubTeamContract getSubTeamContractById(PmSubTeamContract pmSubTeamContract) {
|
||||
return pmSubTeamContractMapper.getSubTeamContractById(pmSubTeamContract);
|
||||
PmSubTeamContract subTeamContract = pmSubTeamContractMapper.getSubTeamContractById(pmSubTeamContract);
|
||||
List<UploadFileVo> contractFile = fileUploadUtils.getFileList("", subTeamContract.getId().toString(), Constants.BM_SUB_CONTRACT, "");
|
||||
subTeamContract.setContractFile(contractFile);
|
||||
return subTeamContract;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,12 @@
|
|||
<if test="subExitTime!= null " >
|
||||
sub_exit_time=#{subExitTime},
|
||||
</if>
|
||||
<if test="subContractCode!= null " >
|
||||
sub_contract_code=#{subContractCode},
|
||||
</if>
|
||||
<if test="subContractName!= null " >
|
||||
sub_contract_name=#{subContractName},
|
||||
</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
|
@ -53,6 +59,9 @@
|
|||
<if test="subEinStatus!=null and subEinStatus!=''">
|
||||
and bsc.sub_ein_status =#{subEinStatus}
|
||||
</if>
|
||||
<if test="subId!=null and subId!=''">
|
||||
and bsc.sub_id =#{subId}
|
||||
</if>
|
||||
</select>
|
||||
<select id="getSubContractBySubContractName" resultType="com.bonus.bmw.domain.po.BmSubContract">
|
||||
select bsc.id as id,
|
||||
|
|
@ -87,4 +96,12 @@
|
|||
left join pm_project pp on bsc.pro_id = pp.id
|
||||
where bsc.is_active = '1' and bsc.id = #{id}
|
||||
</select>
|
||||
<select id="getSubTeamContract" resultType="com.bonus.bmw.domain.po.PmSubTeamContract">
|
||||
select pstc.team_id as teamId,
|
||||
pstc.team_name as teamName,
|
||||
pstc.sub_id as subId
|
||||
from pm_sub_team_contract pstc
|
||||
left join bm_sub_contract bsc on bsc.sub_id = pstc.sub_id and bsc.pro_id = pstc.pro_id
|
||||
where bsc.id = #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,51 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.bmw.mapper.PmAttDeviceMapper">
|
||||
<insert id="addPmAttDevice">
|
||||
insert into pm_att_device (device_code, device_name, pro_id,create_user, update_user,
|
||||
create_time, update_time,dev_model,on_line)
|
||||
values (#{deviceCode}, #{deviceName},#{proId}, #{createUser}, #{updateUser},
|
||||
#{createTime}, #{updateTime},#{devModel},#{onLine})
|
||||
</insert>
|
||||
<update id="updatePmAttDevice">
|
||||
update pm_att_device set pro_id = #{proId},update_time = #{updateTime},update_user = #{updateUser}
|
||||
where is_active = '0' and device_code = #{deviceCode}
|
||||
</update>
|
||||
<delete id="delPmAttDevice">
|
||||
update pm_att_device set is_active = '0' where device_code = #{deviceCode}
|
||||
</delete>
|
||||
|
||||
<select id="selectPmAttDeviceList" resultType="com.bonus.bmw.domain.po.PmAttDevice">
|
||||
|
||||
<select id="selectPmAttDeviceList" resultType="com.bonus.bmw.domain.vo.PmAttDeviceVo">
|
||||
select pad2.device_code as deviceCode,
|
||||
pad2.device_name as deviceName,
|
||||
pad2.pro_id as proId,
|
||||
pp.pro_name as proName,
|
||||
pp.is_shanghai as isShanghai,
|
||||
pad2.update_user as updateUser,
|
||||
pad2.update_time as updateTime
|
||||
from pm_att_device pad2
|
||||
left join pm_project pp on pp.id = pad2.pro_id
|
||||
where pad2.is_active = '1'
|
||||
<if test="deviceCode!=null and deviceCode!=''">
|
||||
and pad2.device_code LIKE CONCAT('%', #{deviceCode}, '%')
|
||||
</if>
|
||||
<if test="deviceName!=null and deviceName!=''">
|
||||
and pad2.device_name LIKE CONCAT('%', #{deviceName}, '%')
|
||||
</if>
|
||||
<if test="proName!=null and proName!=''">
|
||||
and pp.pro_name LIKE CONCAT('%', #{proName}, '%')
|
||||
</if>
|
||||
<if test="isShanghai!=null and isShanghai!=''">
|
||||
and pp.is_shanghai LIKE CONCAT('%', #{isShanghai}, '%')
|
||||
</if>
|
||||
</select>
|
||||
<select id="getPmAttDeviceByCoode" resultType="com.bonus.bmw.domain.po.PmAttDevice">
|
||||
select pad2.device_code as deviceCode,
|
||||
pad2.device_name as deviceName,
|
||||
pad2.pro_id as proId,,
|
||||
pad2.update_user as updateUser,
|
||||
pad2.update_time as updateTime
|
||||
from pm_att_device pad2
|
||||
where pad2.is_active = '1' and pad2.device_code = #{deviceCode}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue