Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
9c5284cc58
|
|
@ -60,6 +60,8 @@ public class MachinesVo extends PageInfo {
|
|||
*/
|
||||
private String remark;
|
||||
|
||||
private String num;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,12 +13,15 @@ import java.util.List;
|
|||
* @author 黑子
|
||||
*/
|
||||
@Data
|
||||
public class PartApplyAppVo extends PageInfo {
|
||||
|
||||
public class PartApplyAppVo extends PageInfo implements java.io.Serializable {
|
||||
|
||||
@Excel(name = "序号", width = 10.0, orderNum = "0")
|
||||
private int xh;
|
||||
|
||||
private String id;
|
||||
|
||||
private List<String> idList;
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
|
|
@ -178,5 +181,9 @@ public class PartApplyAppVo extends PageInfo {
|
|||
*/
|
||||
private String statusName;
|
||||
|
||||
private String partName;
|
||||
|
||||
private String partModel;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,6 +67,12 @@ public class PartApplyDetailAppVo {
|
|||
|
||||
private String proId;
|
||||
|
||||
private String proName;
|
||||
|
||||
private int num;
|
||||
|
||||
private String deviceId;
|
||||
|
||||
private String keyWord;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.bonus.gzgqj.business.bases.controller;
|
|||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.bonus.gzgqj.business.app.entity.PartApplyAppVo;
|
||||
import com.bonus.gzgqj.business.app.entity.PartApplyDetailAppVo;
|
||||
import com.bonus.gzgqj.business.bases.entity.PartInputDetails;
|
||||
|
|
@ -36,6 +37,7 @@ import java.util.List;
|
|||
@RequestMapping("/backstage/partApply")
|
||||
@Slf4j
|
||||
public class PartApplyController {
|
||||
|
||||
@Autowired
|
||||
private PartApplyService service;
|
||||
|
||||
|
|
@ -62,6 +64,7 @@ public class PartApplyController {
|
|||
public ServerResponse getPartDetails(EncryptedReq<PartApplyAppVo> dto) {
|
||||
return service.getPartDetails(dto.getData());
|
||||
}
|
||||
|
||||
/**
|
||||
* 领料出库 查询
|
||||
* @param dto
|
||||
|
|
@ -75,6 +78,7 @@ public class PartApplyController {
|
|||
PageInfo<PartApplyDetailAppVo> pageInfo = new PageInfo<>(list);
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出需求计划
|
||||
* @param
|
||||
|
|
@ -102,6 +106,7 @@ public class PartApplyController {
|
|||
log.error(e.toString(), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出需求计划详情
|
||||
* @param request
|
||||
|
|
@ -131,7 +136,6 @@ public class PartApplyController {
|
|||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 数据审核
|
||||
* @param dto
|
||||
|
|
@ -143,7 +147,21 @@ public class PartApplyController {
|
|||
return service.auditData(dto.getData());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 数据审核--批量审核
|
||||
*/
|
||||
@PostMapping("batchAudit")
|
||||
@DecryptAndVerify(decryptedClass = PartApplyAppVo.class)
|
||||
public ServerResponse batchAudit(EncryptedReq<PartApplyAppVo> dto) {
|
||||
PartApplyAppVo data = dto.getData();
|
||||
ServerResponse serverResponse = null;
|
||||
for (String id : data.getIdList()) {
|
||||
PartApplyAppVo cloned = ObjectUtil.cloneByStream(data);
|
||||
cloned.setId(id);
|
||||
serverResponse = service.auditData(cloned);
|
||||
}
|
||||
return serverResponse;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.bonus.gzgqj.business.bases.controller;
|
|||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import com.bonus.gzgqj.business.app.entity.MachinesVo;
|
||||
import com.bonus.gzgqj.business.app.entity.PartApplyAppVo;
|
||||
import com.bonus.gzgqj.business.app.entity.PartApplyDetailAppVo;
|
||||
import com.bonus.gzgqj.business.bases.entity.*;
|
||||
|
|
@ -221,6 +222,58 @@ public class StatisticsController {
|
|||
|
||||
|
||||
|
||||
/** ---------------------设备工程领用统计-开始--------------------- */
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 设备工程领用统计分页查询
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("findListByPage")
|
||||
@DecryptAndVerify(decryptedClass = MachinesVo.class)
|
||||
public PageInfo<MachinesVo> findListByPage(EncryptedReq<MachinesVo> dto) {
|
||||
PageHelper.startPage(dto.getPageNum(),dto.getPageSize());
|
||||
List<MachinesVo> list = service.findListByPage(dto.getData());;
|
||||
PageInfo<MachinesVo> pageInfo = new PageInfo<>(list);
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 设备工程领用统计分页查询
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("getListDetails")
|
||||
@DecryptAndVerify(decryptedClass = PartApplyDetailAppVo.class)
|
||||
public PageInfo<PartApplyDetailAppVo> getListDetails(EncryptedReq<PartApplyDetailAppVo> dto) {
|
||||
PageHelper.startPage(dto.getPageNum(),dto.getPageSize());
|
||||
List<PartApplyDetailAppVo> list = service.getListDetails(dto.getData());;
|
||||
PageInfo<PartApplyDetailAppVo> pageInfo = new PageInfo<>(list);
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 配件详情分页查询
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("getPartList")
|
||||
@DecryptAndVerify(decryptedClass = PartApplyAppVo.class)
|
||||
public PageInfo<PartApplyAppVo> getPartList(EncryptedReq<PartApplyAppVo> dto) {
|
||||
PageHelper.startPage(dto.getPageNum(),dto.getPageSize());
|
||||
List<PartApplyAppVo> list = service.getPartList(dto.getData());;
|
||||
PageInfo<PartApplyAppVo> pageInfo = new PageInfo<>(list);
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
/** ---------------------设备工程领用统计-结束--------------------- */
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ public interface PartInputMapper {
|
|||
|
||||
/**
|
||||
* 修改 入库信息
|
||||
* @param list
|
||||
* @param data
|
||||
*/
|
||||
int uploadDetails(PartInputDetails data);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.gzgqj.business.bases.mapper;
|
||||
|
||||
import com.bonus.gzgqj.business.app.entity.MachinesVo;
|
||||
import com.bonus.gzgqj.business.app.entity.PartApplyAppVo;
|
||||
import com.bonus.gzgqj.business.app.entity.PartApplyDetailAppVo;
|
||||
import com.bonus.gzgqj.business.bases.entity.PaTypeVo;
|
||||
|
|
@ -56,4 +57,32 @@ public interface StatisticsMapper {
|
|||
* @return
|
||||
*/
|
||||
ProjectInfoVo getProDetails(PartApplyAppVo data);
|
||||
|
||||
/**
|
||||
* 查询
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
List<MachinesVo> findListByPage(MachinesVo data);
|
||||
|
||||
/**
|
||||
* 查询工程
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
String getProNum(MachinesVo vo);
|
||||
|
||||
/**
|
||||
* 查询
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
List<PartApplyDetailAppVo> getListDetails(PartApplyDetailAppVo data);
|
||||
|
||||
/**
|
||||
* 获取配件列表
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
List<PartApplyAppVo> getPartList(PartApplyAppVo data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,209 +28,206 @@ import java.util.Objects;
|
|||
|
||||
/**
|
||||
* 配件管理 入库
|
||||
*
|
||||
* @author 黑子
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class PartApplyServiceImpl implements PartApplyService{
|
||||
|
||||
@Autowired
|
||||
private PartApplyMapper mapper;
|
||||
|
||||
@Autowired
|
||||
private FileUploadService uploadService;
|
||||
public class PartApplyServiceImpl implements PartApplyService {
|
||||
|
||||
@Autowired
|
||||
UserPartInfoServiceImpl userPartInfoService;
|
||||
@Autowired
|
||||
private PartApplyMapper mapper;
|
||||
@Autowired
|
||||
private FileUploadService uploadService;
|
||||
|
||||
public static String transBast64(String url) {
|
||||
try {
|
||||
if (StringHelper.isEmpty(url)) {
|
||||
return "";
|
||||
}
|
||||
Path path = Paths.get(url);
|
||||
byte[] fileBytes = Files.readAllBytes(path);
|
||||
return Base64.getEncoder().encodeToString(fileBytes);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
return "";
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 申请记录列表查询
|
||||
*
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<PartApplyAppVo> findByPage(PartApplyAppVo data) {
|
||||
List<PartApplyAppVo> list=new ArrayList<>();
|
||||
try{
|
||||
list=mapper.findByPage(data);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return list;
|
||||
List<PartApplyAppVo> list = new ArrayList<>();
|
||||
try {
|
||||
list = mapper.findByPage(data);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询申请记录详情
|
||||
*
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ServerResponse getPartDetails(PartApplyAppVo data) {
|
||||
try{
|
||||
PartApplyAppVo vo=mapper.getPartDetails(data);
|
||||
List<String> info=mapper.getInfoMsg(data);
|
||||
try {
|
||||
PartApplyAppVo vo = mapper.getPartDetails(data);
|
||||
List<String> info = mapper.getInfoMsg(data);
|
||||
String infoMsg = String.join(",", info);
|
||||
vo.setInfoMsg(infoMsg);
|
||||
//图片转换
|
||||
String bast641=transBast64(vo.getLyUrl());
|
||||
String bast642=transBast64(vo.getCkUrl());
|
||||
String bast643=transBast64(vo.getShUrl());
|
||||
String bast644=transBast64(vo.getZdUrl());
|
||||
String bast641 = transBast64(vo.getLyUrl());
|
||||
String bast642 = transBast64(vo.getCkUrl());
|
||||
String bast643 = transBast64(vo.getShUrl());
|
||||
String bast644 = transBast64(vo.getZdUrl());
|
||||
vo.setLyUrl(bast641);
|
||||
vo.setCkUrl(bast642);
|
||||
vo.setShUrl(bast643);
|
||||
vo.setZdUrl(bast644);
|
||||
List<FileUploadVo> flieList=uploadService.getFileList(data.getId(),"t_part_apply",null);
|
||||
List<FileUploadVo> flieList = uploadService.getFileList(data.getId(), "t_part_apply", null);
|
||||
vo.setFileList(flieList);
|
||||
return ServerResponse.createSuccess(vo);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
return ServerResponse.createSuccess(vo);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
return ServerResponse.createSuccess(new PartApplyAppVo());
|
||||
return ServerResponse.createSuccess(new PartApplyAppVo());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询申请记录详情
|
||||
*
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<PartApplyDetailAppVo> getPartDetailsList(PartApplyDetailAppVo data) {
|
||||
try{
|
||||
List<PartApplyDetailAppVo> details=mapper.getDetailsList(data);
|
||||
public List<PartApplyDetailAppVo> getPartDetailsList(PartApplyDetailAppVo data) {
|
||||
try {
|
||||
List<PartApplyDetailAppVo> details = mapper.getDetailsList(data);
|
||||
return details;
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
return new ArrayList<PartApplyDetailAppVo>();
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核 数据
|
||||
*
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ServerResponse auditData(PartApplyAppVo data) {
|
||||
try{
|
||||
String status=data.getStatus();
|
||||
PartApplyAppVo vo=mapper.getAuditStatus(data);
|
||||
if(!"1".equals(vo.getStatus())){
|
||||
return ServerResponse.createErroe("该数据已被审核,请刷新重试");
|
||||
}
|
||||
Long userId= Objects.requireNonNull(UserUtil.getLoginUser()).getUserId();
|
||||
AuditRecord voo=new AuditRecord();
|
||||
voo.setAuditor(userId.toString());
|
||||
voo.setAuditRemark(data.getRemark());
|
||||
voo.setApplyId(data.getId());
|
||||
voo.setAuditStatus(status);
|
||||
voo.setAuditType("2");
|
||||
try {
|
||||
String status = data.getStatus();
|
||||
PartApplyAppVo vo = mapper.getAuditStatus(data);
|
||||
if (!"1".equals(vo.getStatus())) {
|
||||
return ServerResponse.createErroe("该数据已被审核,请刷新重试");
|
||||
}
|
||||
Long userId = Objects.requireNonNull(UserUtil.getLoginUser()).getUserId();
|
||||
AuditRecord voo = new AuditRecord();
|
||||
voo.setAuditor(userId.toString());
|
||||
voo.setAuditRemark(data.getRemark());
|
||||
voo.setApplyId(data.getId());
|
||||
voo.setAuditStatus(status);
|
||||
voo.setAuditType("2");
|
||||
//通过
|
||||
if("2".equals(status)){
|
||||
if ("2".equals(status)) {
|
||||
data.setStatusType("3");
|
||||
}
|
||||
int num=mapper.insertAuditRecord(voo);
|
||||
if(num>0){
|
||||
int num = mapper.insertAuditRecord(voo);
|
||||
if (num > 0) {
|
||||
data.setFzUser(userId.toString());
|
||||
mapper.updatePartInfo(data);
|
||||
return ServerResponse.createSuccess("审核成功","审核成功");
|
||||
return ServerResponse.createSuccess("审核成功", "审核成功");
|
||||
}
|
||||
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return ServerResponse.createErroe("审核失败");
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
return ServerResponse.createErroe("审核失败");
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 出库-接口
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ServerResponse partOutInfo(HttpServletRequest request, MultipartFile[] files) {
|
||||
List<PartApplyAppVo> list=new ArrayList<>();
|
||||
try{
|
||||
String param=request.getParameter("params");
|
||||
PartApplyAppVo data= JSON.parseObject(param,PartApplyAppVo.class);
|
||||
String id=data.getId();
|
||||
if(StringHelper.isEmpty(id)){
|
||||
return ServerResponse.createErroe("请选择出库记录");
|
||||
List<PartApplyAppVo> list = new ArrayList<>();
|
||||
try {
|
||||
String param = request.getParameter("params");
|
||||
PartApplyAppVo data = JSON.parseObject(param, PartApplyAppVo.class);
|
||||
String id = data.getId();
|
||||
if (StringHelper.isEmpty(id)) {
|
||||
return ServerResponse.createErroe("请选择出库记录");
|
||||
}
|
||||
if(files==null || files.length <= 0){
|
||||
if (files == null || files.length <= 0) {
|
||||
System.out.println("本次未上传附件");
|
||||
//return ServerResponse.createErroe("请先上传文件");
|
||||
} else {
|
||||
List<FileUploadVo> fileList=uploadService.uploadImage(files,id,"t_part_apply","出库附件");
|
||||
if(fileList.size()!=files.length){
|
||||
return ServerResponse.createErroe("出库失败,附件上传缺失");
|
||||
List<FileUploadVo> fileList = uploadService.uploadImage(files, id, "t_part_apply", "出库附件");
|
||||
if (fileList.size() != files.length) {
|
||||
return ServerResponse.createErroe("出库失败,附件上传缺失");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
PartApplyAppVo vo=mapper.getAuditStatus(data);
|
||||
if(!"2".equals(vo.getStatus())){
|
||||
return ServerResponse.createErroe("该数据状态已变更,请刷新数据重试");
|
||||
PartApplyAppVo vo = mapper.getAuditStatus(data);
|
||||
if (!"2".equals(vo.getStatus())) {
|
||||
return ServerResponse.createErroe("该数据状态已变更,请刷新数据重试");
|
||||
}
|
||||
Long userId= Objects.requireNonNull(UserUtil.getLoginUser()).getUserId();
|
||||
AuditRecord voo=new AuditRecord();
|
||||
Long userId = Objects.requireNonNull(UserUtil.getLoginUser()).getUserId();
|
||||
AuditRecord voo = new AuditRecord();
|
||||
voo.setAuditor(userId.toString());
|
||||
voo.setApplyId(data.getId());
|
||||
voo.setAuditStatus("4");
|
||||
voo.setAuditType("3");
|
||||
int num=mapper.insertAuditRecord(voo);
|
||||
if(num>0){
|
||||
int num = mapper.insertAuditRecord(voo);
|
||||
if (num > 0) {
|
||||
//出库
|
||||
data.setCkUser(userId.toString());
|
||||
data.setStatus("4");
|
||||
data.setStatusType("1");
|
||||
mapper.updatePartInfo(data);
|
||||
//
|
||||
PartApplyDetailAppVo det=new PartApplyDetailAppVo();
|
||||
PartApplyDetailAppVo det = new PartApplyDetailAppVo();
|
||||
det.setId(data.getId());
|
||||
//计算出库数量
|
||||
List<PartApplyDetailAppVo> details=mapper.getDetailsList(det);
|
||||
String userName=UserUtil.getLoginUser().getUsername();
|
||||
List<PartApplyDetailAppVo> details = mapper.getDetailsList(det);
|
||||
String userName = UserUtil.getLoginUser().getUsername();
|
||||
//出库数据 维护
|
||||
userPartInfoService.insert(details,vo.getCreator(),vo.getUserName());
|
||||
details.forEach(detail->{
|
||||
String partId=detail.getPartId();
|
||||
int applyNum=detail.getApplyNum();
|
||||
PaTypeVo paTypeVo=mapper.getPaTypeVoById(partId);
|
||||
paTypeVo.setNum(paTypeVo.getNum()-applyNum);
|
||||
paTypeVo.setCkNum(paTypeVo.getCkNum()+applyNum);
|
||||
userPartInfoService.insert(details, vo.getCreator(), vo.getUserName());
|
||||
details.forEach(detail -> {
|
||||
String partId = detail.getPartId();
|
||||
int applyNum = detail.getApplyNum();
|
||||
PaTypeVo paTypeVo = mapper.getPaTypeVoById(partId);
|
||||
paTypeVo.setNum(paTypeVo.getNum() - applyNum);
|
||||
paTypeVo.setCkNum(paTypeVo.getCkNum() + applyNum);
|
||||
//更新当前库存
|
||||
mapper.updatePaTypeVoById(paTypeVo);
|
||||
});
|
||||
return ServerResponse.createSuccess("出库成功","出库成功");
|
||||
return ServerResponse.createSuccess("出库成功", "出库成功");
|
||||
}
|
||||
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
return ServerResponse.createErroe("出库失败");
|
||||
}
|
||||
|
||||
|
||||
public static String transBast64(String url){
|
||||
try{
|
||||
if(StringHelper.isEmpty(url)){
|
||||
return "";
|
||||
}
|
||||
Path path = Paths.get(url);
|
||||
byte[] fileBytes = Files.readAllBytes(path);
|
||||
return Base64.getEncoder().encodeToString(fileBytes);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return "";
|
||||
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.err.println(transBast64("D:\\files\\zg_gqj\\20241109\\173113057456537938315.jpg"));
|
||||
return ServerResponse.createErroe("出库失败");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.gzgqj.business.bases.service;
|
||||
|
||||
import com.bonus.gzgqj.business.app.entity.MachinesVo;
|
||||
import com.bonus.gzgqj.business.app.entity.PartApplyAppVo;
|
||||
import com.bonus.gzgqj.business.app.entity.PartApplyDetailAppVo;
|
||||
import com.bonus.gzgqj.business.bases.entity.PaTypeVo;
|
||||
|
|
@ -120,4 +121,37 @@ public class StatisticsServiceImpl {
|
|||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public List<MachinesVo> findListByPage(MachinesVo data) {
|
||||
try {
|
||||
List<MachinesVo> list = mapper.findListByPage(data);
|
||||
if (list.size() > 0) {
|
||||
for (MachinesVo vo : list) {
|
||||
vo.setNum(mapper.getProNum(vo));
|
||||
}
|
||||
}
|
||||
return list;
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
||||
public List<PartApplyDetailAppVo> getListDetails(PartApplyDetailAppVo data) {
|
||||
try {
|
||||
return mapper.getListDetails(data);
|
||||
} catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
||||
public List<PartApplyAppVo> getPartList(PartApplyAppVo data) {
|
||||
try {
|
||||
return mapper.getPartList(data);
|
||||
} catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -212,10 +212,10 @@ public class PlanApplicationServiceImp implements PlanApplicationService {
|
|||
Row row = sheet.getRow(i);
|
||||
PlanDevBean data = new PlanDevBean();
|
||||
// 获取全部列的值
|
||||
data.setPpName(row.getCell(1).getStringCellValue()); //物资类型
|
||||
data.setpName(row.getCell(2).getStringCellValue()); //物资名称
|
||||
data.setName(row.getCell(3).getStringCellValue()); //物资型号
|
||||
data.setUnit(row.getCell(4).getStringCellValue()); //单位
|
||||
data.setPpName(row.getCell(1).getStringCellValue().trim()); //物资类型
|
||||
data.setpName(row.getCell(2).getStringCellValue().trim()); //物资名称
|
||||
data.setName(row.getCell(3).getStringCellValue().trim()); //物资型号
|
||||
data.setUnit(row.getCell(4).getStringCellValue().trim()); //单位
|
||||
data.setNeedNum((int)row.getCell(5).getNumericCellValue()); //数量
|
||||
// data.setTimes(row.getCell(6).getStringCellValue()); //时间
|
||||
Cell cell = row.getCell(6); // 假设时间是在第7列(0-based index 6)
|
||||
|
|
@ -255,20 +255,21 @@ public class PlanApplicationServiceImp implements PlanApplicationService {
|
|||
workbook.close();
|
||||
}
|
||||
}
|
||||
if(dataList!=null && !dataList.isEmpty()){
|
||||
if (!dataList.isEmpty()) {
|
||||
for (PlanDevBean planDevBean : dataList) {
|
||||
//根据物资类型,物资名称,物资型号 去数据库查询是否存在
|
||||
PlanDevBean bean = dao.getExist(planDevBean);
|
||||
if(bean == null){
|
||||
if (bean == null) {
|
||||
// 在数据库中不存在,则记录下,全部判断完,返回到前段,提示
|
||||
nonExistList.add(planDevBean);
|
||||
}else{
|
||||
} else {
|
||||
planDevBean.setId(bean.getId());
|
||||
}
|
||||
}
|
||||
// 如果存在数据库中不存在的数据,返回提示
|
||||
if (!nonExistList.isEmpty()) {
|
||||
return ServerResponse.createError("导入失败,以下数据在数据库中不存在", nonExistList);
|
||||
return ServerResponse.createSuccess("导入成功,有部分物资不存在", dataList);
|
||||
// return ServerResponse.createError("导入失败,以下数据在数据库中不存在", nonExistList);
|
||||
}
|
||||
}
|
||||
return ServerResponse.createSuccess("导入成功", dataList);
|
||||
|
|
|
|||
|
|
@ -108,7 +108,8 @@
|
|||
mt2.NAME like concat('%',#{keyWord},'%') or
|
||||
mt3.NAME like concat('%',#{keyWord},'%') or
|
||||
mm.DEVICE_CODE like concat('%',#{keyWord},'%') or
|
||||
mt.NAME like concat('%',#{keyWord},'%')
|
||||
mt.NAME like concat('%',#{keyWord},'%') or
|
||||
mm.REMARK like concat('%',#{keyWord},'%')
|
||||
)
|
||||
</if>
|
||||
</select>
|
||||
|
|
@ -139,7 +140,8 @@
|
|||
<select id="getPaTypeList" resultType="com.bonus.gzgqj.business.bases.entity.PaTypeVo">
|
||||
select pt.id, pt.parent_id parentId,pt.name model ,pt.num,
|
||||
pt.price,pt.unit ,pt.weight,pt.is_consumables ,
|
||||
pt.remarks,pt.is_active ,pt.level,pt.warn_num,pt1.`name` name ,pt2.name type
|
||||
pt.remarks,pt.is_active ,pt.level,pt.warn_num,pt1.`name` name ,pt2.name type,
|
||||
pt.remarks
|
||||
FROM pa_type pt
|
||||
left join pa_type pt1 on pt.parent_id=pt1.id and pt1.`level`=2 and pt1.is_active=1
|
||||
left join pa_type pt2 on pt1.parent_id=pt2.id and pt2.`level`=1 and pt2.is_active=1
|
||||
|
|
@ -148,7 +150,8 @@
|
|||
and (
|
||||
pt2.name like concat('%',#{keyWord},'%') or
|
||||
pt1.name like concat('%',#{keyWord},'%') or
|
||||
pt.name like concat('%',#{keyWord},'%')
|
||||
pt.name like concat('%',#{keyWord},'%') or
|
||||
pt.remarks like concat('%',#{keyWord},'%')
|
||||
)
|
||||
</if>
|
||||
<if test="name!=null and name!=''">
|
||||
|
|
@ -158,6 +161,15 @@
|
|||
pt.name like concat('%',#{name},'%')
|
||||
)
|
||||
</if>
|
||||
ORDER BY CASE
|
||||
WHEN pt.name REGEXP '^[0-9]+$' THEN 1
|
||||
ELSE 0
|
||||
END,
|
||||
CASE
|
||||
WHEN pt.name REGEXP '^[0-9]+$' THEN CAST(pt.name AS UNSIGNED)
|
||||
ELSE NULL
|
||||
END,
|
||||
pt.name ASC
|
||||
</select>
|
||||
<select id="getSqList" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
|
|
@ -223,11 +235,28 @@ order by tpa.create_time desc
|
|||
where tpa.id=#{id}
|
||||
</select>
|
||||
<select id="getDetailsList" resultType="com.bonus.gzgqj.business.app.entity.PartApplyDetailAppVo">
|
||||
select ppd.id,ppd.apply_id applyId, ppd.part_id partId, ppd.apply_num applyNum,
|
||||
ppd.part_type partType, ppd.part_name partName, ppd.part_model partModel,ppd.part_unit partUnit,
|
||||
pt.price ,(ppd.apply_num*pt.price ) money,pt.num
|
||||
from t_part_apply_details ppd
|
||||
LEFT JOIN pa_type pt on pt.id=ppd.part_id
|
||||
where ppd.apply_id=#{id}
|
||||
select ppd.id,
|
||||
ppd.apply_id applyId,
|
||||
ppd.part_id partId,
|
||||
ppd.apply_num applyNum,
|
||||
ppd.part_type partType,
|
||||
ppd.part_name partName,
|
||||
ppd.part_model partModel,
|
||||
ppd.part_unit partUnit,
|
||||
pt.price,
|
||||
(ppd.apply_num * pt.price) money,
|
||||
pt.num
|
||||
from t_part_apply_details ppd
|
||||
LEFT JOIN pa_type pt on pt.id = ppd.part_id
|
||||
where ppd.apply_id = #{id}
|
||||
ORDER BY CASE
|
||||
WHEN ppd.part_model REGEXP '^[0-9]+$' THEN 1
|
||||
ELSE 0
|
||||
END,
|
||||
CASE
|
||||
WHEN ppd.part_model REGEXP '^[0-9]+$' THEN CAST(ppd.part_model AS UNSIGNED)
|
||||
ELSE NULL
|
||||
END,
|
||||
ppd.part_model ASC
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -84,6 +84,15 @@
|
|||
<if test="model!=null and model !=''">
|
||||
and pt.name like concat('%',#{model},'%')
|
||||
</if>
|
||||
ORDER BY CASE
|
||||
WHEN pt.nam REGEXP '^[0-9]+$' THEN 1
|
||||
ELSE 0
|
||||
END,
|
||||
CASE
|
||||
WHEN pt.nam REGEXP '^[0-9]+$' THEN CAST(pt.nam AS UNSIGNED)
|
||||
ELSE NULL
|
||||
END,
|
||||
pt.nam ASC
|
||||
</select>
|
||||
|
||||
<select id="getVendList" resultType="com.bonus.gzgqj.business.bases.entity.VendVo">
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
</if>
|
||||
<if test="ckUser!=null and ckUser!=''">
|
||||
,ck_user=#{ckUser} ,ck_time=now()
|
||||
,zd_user=#{ckUser},zd_time=now()
|
||||
</if>
|
||||
where id=#{id}
|
||||
</update>
|
||||
|
|
@ -45,37 +46,67 @@
|
|||
order by tpa.create_time desc
|
||||
</select>
|
||||
<select id="getPartDetails" resultType="com.bonus.gzgqj.business.app.entity.PartApplyAppVo">
|
||||
select tpa.id,tpa.code,tpa.creator,tpa.user_name userName,
|
||||
tpa.create_time createTime,tpa.type ,
|
||||
tpa.remark,tpa.status ,tpa.updater,pu.TELPHONE phone,
|
||||
tpa.update_time updateTime,tpa.dev_id deviceId,tpa.dev_code devCode,
|
||||
tpa.dev_type devType,tpa.pro_id proId,tpa.pro_name proName,
|
||||
tpa.status_type statusType,tpa.apply_num applyNum,
|
||||
tpa.zd_user zdUser,fz_user fzUser,ck_user ckUser,zd_time zdTime,fz_time fzTime,ck_time ckTime,
|
||||
pu.SIGN_URL lyUrl, pu2.SIGN_URL zdUrl ,pu3.SIGN_URL ckUrl ,pu4.SIGN_URL shUrl
|
||||
select tpa.id,
|
||||
tpa.code,
|
||||
pu.`NAME` as creator,
|
||||
tpa.user_name userName,
|
||||
tpa.create_time createTime,
|
||||
tpa.type,
|
||||
tpa.remark,
|
||||
tpa.status,
|
||||
tpa.updater,
|
||||
pu.TELPHONE phone,
|
||||
tpa.update_time updateTime,
|
||||
tpa.dev_id deviceId,
|
||||
tpa.dev_code devCode,
|
||||
tpa.dev_type devType,
|
||||
tpa.pro_id proId,
|
||||
tpa.pro_name proName,
|
||||
tpa.status_type statusType,
|
||||
tpa.apply_num applyNum,
|
||||
pu2.`NAME` as zdUser,
|
||||
pu4.`NAME` as fzUser,
|
||||
pu3.`NAME` as ckUser,
|
||||
zd_time zdTime,
|
||||
fz_time fzTime,
|
||||
ck_time ckTime,
|
||||
pu.SIGN_URL lyUrl,
|
||||
pu2.SIGN_URL zdUrl,
|
||||
pu3.SIGN_URL ckUrl,
|
||||
pu4.SIGN_URL shUrl
|
||||
FROM t_part_apply tpa
|
||||
left join pm_user pu on tpa.creator=pu.id -- 领用人
|
||||
left join pm_user pu2 on tpa.zd_user=pu2.id -- 制单人
|
||||
left join pm_user pu3 on tpa.ck_user=pu3.id -- 出库人
|
||||
left join pm_user pu4 on tpa.fz_user=pu4.id -- 审核人
|
||||
where tpa.id=#{id}
|
||||
left join pm_user pu on tpa.creator = pu.id -- 领用人
|
||||
left join pm_user pu2 on tpa.zd_user = pu2.id -- 制单人
|
||||
left join pm_user pu3 on tpa.ck_user = pu3.id -- 出库人
|
||||
left join pm_user pu4 on tpa.fz_user = pu4.id -- 审核人
|
||||
where tpa.id = #{id}
|
||||
</select>
|
||||
<select id="getDetailsList" resultType="com.bonus.gzgqj.business.app.entity.PartApplyDetailAppVo">
|
||||
select ppd.id,ppd.apply_id applyId, ppd.part_id partId, ppd.apply_num applyNum,ppd.remark,
|
||||
select ppd.id,ppd.apply_id applyId, ppd.part_id partId, ppd.apply_num applyNum,ppd.remark,
|
||||
ppd.part_type partType, ppd.part_name partName, ppd.part_model partModel,ppd.part_unit partUnit,pt.price ,
|
||||
(pt.price*ppd.apply_num ) money
|
||||
from t_part_apply_details ppd
|
||||
(pt.price*ppd.apply_num ) money
|
||||
from t_part_apply_details ppd
|
||||
LEFT JOIN pa_type pt on pt.id=ppd.part_id
|
||||
where ppd.apply_id=#{id}
|
||||
<if test="partType!=null and partType !=''">
|
||||
and ppd.part_type like concat('%',#{partType},'%')
|
||||
</if>
|
||||
<if test="partName!=null and partName !=''">
|
||||
and ppd.part_name like concat('%',#{partName},'%')
|
||||
</if>
|
||||
<if test="partModel!=null and partModel !=''">
|
||||
and ppd.part_model like concat('%',#{partModel},'%')
|
||||
</if>
|
||||
<if test="partType!=null and partType !=''">
|
||||
and ppd.part_type like concat('%',#{partType},'%')
|
||||
</if>
|
||||
<if test="partName!=null and partName !=''">
|
||||
and ppd.part_name like concat('%',#{partName},'%')
|
||||
</if>
|
||||
<if test="partModel!=null and partModel !=''">
|
||||
and ppd.part_model like concat('%',#{partModel},'%')
|
||||
</if>
|
||||
ORDER BY
|
||||
CASE
|
||||
WHEN ppd.part_model REGEXP '^[0-9]+$' THEN 1
|
||||
ELSE 0
|
||||
END,
|
||||
CASE
|
||||
WHEN ppd.part_model REGEXP '^[0-9]+$' THEN CAST(ppd.part_model AS UNSIGNED)
|
||||
ELSE NULL
|
||||
END,
|
||||
ppd.part_model ASC
|
||||
</select>
|
||||
<!--审核状态-->
|
||||
<select id="getAuditStatus" resultType="com.bonus.gzgqj.business.app.entity.PartApplyAppVo">
|
||||
|
|
|
|||
|
|
@ -71,20 +71,30 @@
|
|||
</select>
|
||||
|
||||
<select id="getInfoDetailList" resultType="com.bonus.gzgqj.business.bases.entity.PartBackDetailsVo">
|
||||
SELECT id, back_id backId, back_num backNum,
|
||||
part_id partId, part_type partType,
|
||||
part_name partName, part_model partModel, part_unit partUnit, remark
|
||||
SELECT id, back_id backId, back_num backNum,
|
||||
part_id partId, part_type partType,
|
||||
part_name partName, part_model partModel, part_unit partUnit, remark
|
||||
FROM t_part_back_details
|
||||
WHERE back_id=#{id}
|
||||
<if test="partType!=null and partType !=''">
|
||||
and part_type like concat('%',#{partType},'%')
|
||||
</if>
|
||||
<if test="partName!=null and partName !=''">
|
||||
and part_name like concat('%',#{partName},'%')
|
||||
</if>
|
||||
<if test="partModel!=null and partModel !=''">
|
||||
and part_model like concat('%',#{partModel},'%')
|
||||
</if>
|
||||
WHERE back_id=#{id}
|
||||
<if test="partType!=null and partType !=''">
|
||||
and part_type like concat('%',#{partType},'%')
|
||||
</if>
|
||||
<if test="partName!=null and partName !=''">
|
||||
and part_name like concat('%',#{partName},'%')
|
||||
</if>
|
||||
<if test="partModel!=null and partModel !=''">
|
||||
and part_model like concat('%',#{partModel},'%')
|
||||
</if>
|
||||
ORDER BY
|
||||
CASE
|
||||
WHEN part_model REGEXP '^[0-9]+$' THEN 1
|
||||
ELSE 0
|
||||
END,
|
||||
CASE
|
||||
WHEN part_model REGEXP '^[0-9]+$' THEN CAST(part_model AS UNSIGNED)
|
||||
ELSE NULL
|
||||
END,
|
||||
part_model ASC
|
||||
</select>
|
||||
<select id="getInfoDetails" resultType="com.bonus.gzgqj.business.bases.entity.PartBackVo">
|
||||
select tpb.id, tpb.code, tpb.creator,pu.TELPHONE phone ,tpb.back_num backNum,tpb.user_name userName,
|
||||
|
|
|
|||
|
|
@ -70,7 +70,16 @@
|
|||
<if test="partModel!=null and partModel !=''">
|
||||
and pid.part_model like concat('%',#{partModel},'%')
|
||||
</if>
|
||||
|
||||
ORDER BY
|
||||
CASE
|
||||
WHEN pid.part_model REGEXP '^[0-9]+$' THEN 1
|
||||
ELSE 0
|
||||
END,
|
||||
CASE
|
||||
WHEN pid.part_model REGEXP '^[0-9]+$' THEN CAST(pid.part_model AS UNSIGNED)
|
||||
ELSE NULL
|
||||
END,
|
||||
pid.part_model ASC
|
||||
</select>
|
||||
<!--入库数量-->
|
||||
<select id="getNum" resultType="java.lang.Integer">
|
||||
|
|
|
|||
|
|
@ -42,13 +42,14 @@
|
|||
|
||||
<!--分页查询-->
|
||||
<select id="findByPage" resultType="com.bonus.gzgqj.business.bases.entity.PartInputVo">
|
||||
select tpi.id,tpi.code,tpi.creator,tpi.input_day inputDay,tpi.input_user inputUser,
|
||||
select tpi.id,tpi.code,tpi.creator,tpi.input_day inputDay,pu.`NAME` inputUser,
|
||||
tpi.input_num inputNum,tpi.all_price allPrice,tpi.remark,tpi.is_flag isFlag
|
||||
from t_part_input tpi
|
||||
LEFT JOIN pm_user pu on pu.ID=tpi.input_user
|
||||
<where>
|
||||
<if test="keyWord!=null and keyWord!=''">
|
||||
and (tpi.code like concat('%',#{keyWord},'%') or
|
||||
tpi.input_user like concat('%',#{keyWord},'%') or
|
||||
pu.`NAME` like concat('%',#{keyWord},'%') or
|
||||
tpi.input_day like concat('%',#{keyWord},'%') or
|
||||
tpi.remark like concat('%',#{keyWord},'%')
|
||||
)
|
||||
|
|
@ -71,10 +72,18 @@
|
|||
</select>
|
||||
<!--查询 入库详情-->
|
||||
<select id="getInputDetails" resultType="com.bonus.gzgqj.business.bases.entity.PartInputVo">
|
||||
select tpi.id,tpi.code,tpi.creator,tpi.input_day inputDay,tpi.input_user inputUser,
|
||||
tpi.input_num inputNum,tpi.all_price allPrice,tpi.remark,tpi.is_flag isFlag
|
||||
from t_part_input tpi
|
||||
WHERE tpi.id=#{id}
|
||||
select tpi.id,
|
||||
tpi.code,
|
||||
tpi.creator,
|
||||
tpi.input_day inputDay,
|
||||
pu.`NAME` inputUser,
|
||||
tpi.input_num inputNum,
|
||||
tpi.all_price allPrice,
|
||||
tpi.remark,
|
||||
tpi.is_flag isFlag
|
||||
from t_part_input tpi
|
||||
LEFT JOIN pm_user pu on pu.ID = tpi.input_user
|
||||
WHERE tpi.id = #{id}
|
||||
</select>
|
||||
<select id="getInfoById" resultType="java.lang.String">
|
||||
select CONCAT(part_name,":",SUM(input_num)) detail
|
||||
|
|
@ -99,6 +108,15 @@
|
|||
<if test="model!=null and model!=''">
|
||||
and ppd.part_model like concat('%',#{model},'%')
|
||||
</if>
|
||||
ORDER BY CASE
|
||||
WHEN ppd.part_model REGEXP '^[0-9]+$' THEN 1
|
||||
ELSE 0
|
||||
END,
|
||||
CASE
|
||||
WHEN ppd.part_model REGEXP '^[0-9]+$' THEN CAST(ppd.part_model AS UNSIGNED)
|
||||
ELSE NULL
|
||||
END,
|
||||
ppd.part_model ASC
|
||||
</select>
|
||||
<select id="getPzPrice" resultType="java.lang.String">
|
||||
select ROUND(IFNULL(AVG(part_price),0),2) price
|
||||
|
|
|
|||
|
|
@ -69,6 +69,16 @@
|
|||
<if test="partModel!=null and partModel !=''">
|
||||
and psd.part_model like concat('%',#{partModel},'%')
|
||||
</if>
|
||||
ORDER BY
|
||||
CASE
|
||||
WHEN psd.part_model REGEXP '^[0-9]+$' THEN 1
|
||||
ELSE 0
|
||||
END,
|
||||
CASE
|
||||
WHEN psd.part_model REGEXP '^[0-9]+$' THEN CAST(psd.part_model AS UNSIGNED)
|
||||
ELSE NULL
|
||||
END,
|
||||
psd.part_model ASC
|
||||
</select>
|
||||
<select id="getInfo" resultType="java.lang.String">
|
||||
select ANY_VALUE(CONCAT(part_name,":",SUM(scrap_num))) detail
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
</select>
|
||||
<select id="findByPage" resultType="com.bonus.gzgqj.business.bases.entity.PaTypeVo">
|
||||
select pt.id, pt.parent_id parentId,pt.name model ,pt.num,
|
||||
pt.price,pt.unit ,pt.weight,pt.is_consumables ,
|
||||
IFNULL(pt.price,0) as price,pt.unit ,pt.weight,pt.is_consumables ,
|
||||
pt.remarks,pt.is_active ,pt.level,pt.warn_num,pt1.`name` name ,pt2.name type
|
||||
FROM pa_type pt
|
||||
left join pa_type pt1 on pt.parent_id=pt1.id and pt1.`level`=2 and pt1.is_active=1
|
||||
|
|
@ -42,6 +42,16 @@
|
|||
<if test='isWarn=="2"'>
|
||||
and pt.num>0
|
||||
</if>
|
||||
ORDER BY
|
||||
CASE
|
||||
WHEN pt.name REGEXP '^[0-9]+$' THEN 1
|
||||
ELSE 0
|
||||
END,
|
||||
CASE
|
||||
WHEN pt.name REGEXP '^[0-9]+$' THEN CAST(pt.name AS UNSIGNED)
|
||||
ELSE NULL
|
||||
END,
|
||||
pt.name ASC
|
||||
</select>
|
||||
<!--工程统计领料单查询-->
|
||||
<select id="getProListPage" resultType="com.bonus.gzgqj.business.bases.entity.ProjectInfoVo">
|
||||
|
|
@ -114,4 +124,101 @@
|
|||
GROUP BY pro_id ) mm on mm.pro_id=pro.id
|
||||
where pro.id=#{proId}
|
||||
</select>
|
||||
|
||||
<select id="findListByPage" resultType="com.bonus.gzgqj.business.app.entity.MachinesVo">
|
||||
SELECT
|
||||
mm.id,
|
||||
mm.DEVICE_CODE deviceCode,
|
||||
mm.REMARK as remark,
|
||||
concat(mt3.NAME,'/',mt2.NAME,'/',mt.NAME) module
|
||||
FROM
|
||||
mm_machines mm
|
||||
LEFT JOIN mm_type mt ON mt.id = mm.TYPE
|
||||
AND mt.`LEVEL` = 4
|
||||
AND mt.IS_ACTIVE = 1
|
||||
LEFT JOIN mm_type mt2 ON mt.PARENT_ID = mt2.id
|
||||
LEFT JOIN mm_type mt3 ON mt2.PARENT_ID = mt3.id
|
||||
WHERE
|
||||
mm.BATCH_STATUS = 7
|
||||
<if test="keyWord!=null and keyWord!=''">
|
||||
and (
|
||||
mt.NAME like concat('%',#{keyWord},'%') or
|
||||
mm.DEVICE_CODE like concat('%',#{keyWord},'%') or
|
||||
mm.REMARK like concat('%',#{keyWord},'%') or
|
||||
mt2.NAME like concat('%',#{keyWord},'%') or
|
||||
mt3.NAME like concat('%',#{keyWord},'%')
|
||||
)
|
||||
</if>
|
||||
</select>
|
||||
<select id="getProNum" resultType="java.lang.String">
|
||||
SELECT COUNT(*) as num
|
||||
FROM (SELECT wir.sup_id,
|
||||
wat.AGREEMENT_ID,
|
||||
wir.id,
|
||||
pro.`NAME` proName,
|
||||
pro.id proId
|
||||
FROM wf_info_record wir
|
||||
LEFT JOIN wf_return_material_details rmd ON wir.SUP_ID = rmd.id
|
||||
LEFT JOIN wf_agreement_task wat ON rmd.TASK_ID = wat.TASK_ID
|
||||
LEFT JOIN wf_lease_agreement wla ON wat.AGREEMENT_ID = wla.id
|
||||
LEFT JOIN bm_project pro ON pro.id = wla.PROJECT
|
||||
WHERE TYPE = 4
|
||||
AND wir.MA_ID = #{id}
|
||||
GROUP BY pro.id
|
||||
ORDER BY wir.TIME DESC) a
|
||||
</select>
|
||||
|
||||
<select id="getListDetails" resultType="com.bonus.gzgqj.business.app.entity.PartApplyDetailAppVo">
|
||||
SELECT
|
||||
wir.sup_id,
|
||||
wat.AGREEMENT_ID,
|
||||
wir.id,
|
||||
pro.`NAME` proName,
|
||||
pro.id proId,
|
||||
wir.MA_ID as deviceId
|
||||
FROM
|
||||
wf_info_record wir
|
||||
LEFT JOIN wf_return_material_details rmd ON wir.SUP_ID = rmd.id
|
||||
LEFT JOIN wf_agreement_task wat ON rmd.TASK_ID = wat.TASK_ID
|
||||
LEFT JOIN wf_lease_agreement wla ON wat.AGREEMENT_ID = wla.id
|
||||
LEFT JOIN bm_project pro ON pro.id = wla.PROJECT
|
||||
WHERE
|
||||
TYPE = 4
|
||||
AND wir.MA_ID = #{id}
|
||||
<if test="keyWord!=null and keyWord!=''">
|
||||
and (
|
||||
pro.NAME like concat('%',#{keyWord},'%')
|
||||
)
|
||||
</if>
|
||||
GROUP BY
|
||||
pro.id
|
||||
ORDER BY
|
||||
wir.TIME DESC
|
||||
|
||||
</select>
|
||||
<select id="getPartList" resultType="com.bonus.gzgqj.business.app.entity.PartApplyAppVo">
|
||||
SELECT
|
||||
tpa.pro_name as proName,
|
||||
tpa.`code`,
|
||||
tpad.part_name as partName,
|
||||
tpad.part_model as partModel,
|
||||
tpad.apply_num as applyNum,
|
||||
tpa.create_time as createTime
|
||||
FROM
|
||||
t_part_apply_details tpad
|
||||
LEFT JOIN t_part_apply tpa on tpa.id=tpad.apply_id
|
||||
WHERE
|
||||
tpa.dev_id=#{deviceId}
|
||||
and tpa.pro_id=#{proId}
|
||||
<if test="keyWord!=null and keyWord!=''">
|
||||
and (
|
||||
tpa.`code` like concat('%',#{keyWord},'%') or
|
||||
tpad.part_name like concat('%',#{keyWord},'%') or
|
||||
tpad.part_model like concat('%',#{keyWord},'%')
|
||||
)
|
||||
</if>
|
||||
<if test="startDay!=null and startDay!='' and endDay!=null and endDay!='' ">
|
||||
and STR_TO_DATE(tpa.create_time, '%Y-%m-%d') between STR_TO_DATE(#{startDay} ,'%Y-%m-%d') AND STR_TO_DATE(#{endDay},'%Y-%m-%d')
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue