This commit is contained in:
parent
5b2c056697
commit
bd745ff6aa
|
|
@ -29,13 +29,13 @@ import java.util.List;
|
|||
@Slf4j
|
||||
public class PartApplyAppController {
|
||||
|
||||
@Autowired
|
||||
private PartApplyAppServiceImp service;
|
||||
/**
|
||||
* 配件申请-设备 下拉选集合
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Autowired
|
||||
private PartApplyAppServiceImp service;
|
||||
/**
|
||||
* 配件申请-设备 下拉选集合
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("getDevList")
|
||||
public ServerResponse getDevList(MachinesVo dto) {
|
||||
return service.getDevList(dto);
|
||||
|
|
|
|||
|
|
@ -42,6 +42,35 @@ public class PaTypeController {
|
|||
return service.getTypeList(dto.getData());
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询配件类型
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("getPaTypeListByPage")
|
||||
@DecryptAndVerify(decryptedClass = PaTypeVo.class)
|
||||
public PageInfo<PaTypeVo> getPaTypeListByPage(EncryptedReq<PaTypeVo> dto) {
|
||||
PageHelper.startPage(dto.getPageNum(),dto.getPageSize());
|
||||
List<PaTypeVo> list = service.getPaTypeList(dto.getData());;
|
||||
PageInfo<PaTypeVo> pageInfo = new PageInfo<>(list);
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询全部类型数据
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("getPaTypeList")
|
||||
@DecryptAndVerify(decryptedClass = PaTypeVo.class)
|
||||
public ServerResponse getPaTypeList(EncryptedReq<PaTypeVo> dto) {
|
||||
List<PaTypeVo> list = service.getPaTypeList(dto.getData());;
|
||||
return ServerResponse.createSuccess(list);
|
||||
}
|
||||
/**
|
||||
* 新增 数据頛
|
||||
* @param dto
|
||||
|
|
|
|||
|
|
@ -0,0 +1,86 @@
|
|||
package com.bonus.gzgqj.business.bases.controller;
|
||||
|
||||
import com.bonus.gzgqj.business.app.entity.PartApplyAppVo;
|
||||
import com.bonus.gzgqj.business.bases.entity.PaTypeVo;
|
||||
import com.bonus.gzgqj.business.bases.entity.PartCheckVo;
|
||||
import com.bonus.gzgqj.business.bases.entity.UserPatypeInfo;
|
||||
import com.bonus.gzgqj.business.bases.service.PartCheckService;
|
||||
import com.bonus.gzgqj.manager.annotation.DecryptAndVerify;
|
||||
import com.bonus.gzgqj.manager.core.entity.EncryptedReq;
|
||||
import com.bonus.gzgqj.manager.webResult.ServerResponse;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 库存盘点
|
||||
* @author 黑子
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/backstage/partCheck")
|
||||
@Slf4j
|
||||
public class PartCheckController {
|
||||
|
||||
@Autowired
|
||||
private PartCheckService service;
|
||||
|
||||
/**
|
||||
* 盘点记录分页拆线呢
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("findByPage")
|
||||
@DecryptAndVerify(decryptedClass = PartCheckVo.class)
|
||||
public PageInfo<PartCheckVo> findByPage(EncryptedReq<PartCheckVo> dto) {
|
||||
PageHelper.startPage(dto.getPageNum(),dto.getPageSize());
|
||||
List<PartCheckVo> list = service.findByPage(dto.getData());;
|
||||
PageInfo<PartCheckVo> pageInfo = new PageInfo<>(list);
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 盘点入库新增接口
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("insertCheckData")
|
||||
public ServerResponse insertCheckData(HttpServletRequest request, @RequestParam(value = "file[]",required = false) MultipartFile[] files) {
|
||||
return service.insertCheckData(request,files);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 盘点入库新增接口
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("getDetailsById")
|
||||
@DecryptAndVerify(decryptedClass = PartCheckVo.class)
|
||||
public ServerResponse getDetailsById(EncryptedReq<PartCheckVo> dto) {
|
||||
return service.getDetailsById(dto.getData());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
package com.bonus.gzgqj.business.bases.controller;
|
||||
|
||||
import com.bonus.gzgqj.business.bases.entity.PartCheckVo;
|
||||
import com.bonus.gzgqj.business.bases.entity.PartScrapVo;
|
||||
import com.bonus.gzgqj.business.bases.service.PartCheckService;
|
||||
import com.bonus.gzgqj.business.bases.service.PartScrapService;
|
||||
import com.bonus.gzgqj.manager.annotation.DecryptAndVerify;
|
||||
import com.bonus.gzgqj.manager.core.entity.EncryptedReq;
|
||||
import com.bonus.gzgqj.manager.webResult.ServerResponse;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import sun.dc.pr.PRError;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 配件报废
|
||||
* @author 黑子
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/backstage/partScrap")
|
||||
@Slf4j
|
||||
public class PartScrapController {
|
||||
|
||||
@Autowired
|
||||
private PartScrapService service;
|
||||
|
||||
|
||||
/**
|
||||
* 盘点记录分页拆线呢
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("findByPage")
|
||||
@DecryptAndVerify(decryptedClass = PartScrapVo.class)
|
||||
public PageInfo<PartScrapVo> findByPage(EncryptedReq<PartScrapVo> dto) {
|
||||
PageHelper.startPage(dto.getPageNum(),dto.getPageSize());
|
||||
List<PartScrapVo> list = service.findByPage(dto.getData());;
|
||||
PageInfo<PartScrapVo> pageInfo = new PageInfo<>(list);
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 盘点入库新增接口
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("insertScarpData")
|
||||
public ServerResponse insertScarpData(HttpServletRequest request, @RequestParam(value = "file[]",required = false) MultipartFile[] files) {
|
||||
return service.insertCheckData(request,files);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 盘点入库新增接口
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("getDetailsById")
|
||||
@DecryptAndVerify(decryptedClass = PartScrapVo.class)
|
||||
public ServerResponse getDetailsById(EncryptedReq<PartScrapVo> dto) {
|
||||
return service.getDetailsById(dto.getData());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -74,5 +74,10 @@ public class PaTypeVo {
|
|||
*/
|
||||
private int allNum;
|
||||
|
||||
/**
|
||||
* 总入库量
|
||||
*/
|
||||
private int bfNum;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,62 @@
|
|||
package com.bonus.gzgqj.business.bases.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author 黑子
|
||||
*/
|
||||
@Data
|
||||
public class PartCheckDetailsVo {
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* 记录id
|
||||
*/
|
||||
private String invId;
|
||||
|
||||
/**
|
||||
* 配件id
|
||||
*/
|
||||
private String partId;
|
||||
/**
|
||||
* 配件类型
|
||||
*/
|
||||
private String partType;
|
||||
/**
|
||||
* 配件名称
|
||||
*/
|
||||
private String partName;
|
||||
|
||||
/**
|
||||
* 配件类型
|
||||
*/
|
||||
private String partModel;
|
||||
|
||||
/**
|
||||
* 配件类型
|
||||
*/
|
||||
private String partUnit;
|
||||
|
||||
private String remark;
|
||||
/**
|
||||
* 盘点数量
|
||||
*/
|
||||
private int checkNum;
|
||||
/**
|
||||
* 盘点前-库存数量
|
||||
*/
|
||||
private int num;
|
||||
/**
|
||||
* 盘盈
|
||||
*/
|
||||
private int addNum;
|
||||
/**
|
||||
* 盘亏
|
||||
*/
|
||||
private int subNum;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,90 @@
|
|||
package com.bonus.gzgqj.business.bases.entity;
|
||||
|
||||
import com.bonus.gzgqj.business.plan.entity.FileUploadVo;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 库存盘点实体类
|
||||
* @author 黑子
|
||||
*/
|
||||
@Data
|
||||
public class PartCheckVo {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
private String code;
|
||||
/**
|
||||
* 盘点人id
|
||||
*/
|
||||
private String creator;
|
||||
/**
|
||||
* 盘点时间
|
||||
*/
|
||||
private String createTime;
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private String startTime;
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private String endTime;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
|
||||
private String remark;
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private String updater;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private String updateTime;
|
||||
/**
|
||||
* 使用人
|
||||
*/
|
||||
private String userName;
|
||||
/**
|
||||
* 盘盈
|
||||
*/
|
||||
private int addNum;
|
||||
/**
|
||||
* 盘亏
|
||||
*/
|
||||
private int subNum;
|
||||
|
||||
private String keyWord;
|
||||
|
||||
|
||||
/**
|
||||
* 详情集合
|
||||
*/
|
||||
private List<PartCheckDetailsVo> detailList;
|
||||
|
||||
|
||||
/**
|
||||
* 文件上传 集合
|
||||
*/
|
||||
private List<FileUploadVo> fileList;
|
||||
|
||||
/**
|
||||
* 明细
|
||||
*/
|
||||
private String infoMsg;
|
||||
/**
|
||||
* 曾家明细
|
||||
*/
|
||||
private String addMsg;
|
||||
/**
|
||||
* 减少明细
|
||||
*/
|
||||
private String subMsg;
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
package com.bonus.gzgqj.business.bases.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 配件报废
|
||||
* @author 黑子
|
||||
*/
|
||||
@Data
|
||||
public class PartScrapDetailsVo {
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* 报废单id
|
||||
*/
|
||||
private String scrapId;
|
||||
/**
|
||||
* 报废数量
|
||||
*/
|
||||
private int scrapNum;
|
||||
|
||||
|
||||
/**
|
||||
* 配件id
|
||||
*/
|
||||
private String partId;
|
||||
/**
|
||||
* 配件类型
|
||||
*/
|
||||
private String partType;
|
||||
/**
|
||||
* 配件名称
|
||||
*/
|
||||
private String partName;
|
||||
|
||||
/**
|
||||
* 配件类型
|
||||
*/
|
||||
private String partModel;
|
||||
|
||||
/**
|
||||
* 配件类型
|
||||
*/
|
||||
private String partUnit;
|
||||
|
||||
private String remark;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
package com.bonus.gzgqj.business.bases.entity;
|
||||
|
||||
import com.bonus.gzgqj.business.plan.entity.FileUploadVo;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 报废
|
||||
* @author 黑子
|
||||
*/
|
||||
@Data
|
||||
public class PartScrapVo {
|
||||
|
||||
private String id;
|
||||
|
||||
private String name;
|
||||
|
||||
private String userName;
|
||||
/**
|
||||
* 百纳后
|
||||
*/
|
||||
private String code;
|
||||
/**
|
||||
* 报废日期
|
||||
*/
|
||||
private String scrapDay;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
private String creator;
|
||||
|
||||
private String createTime;
|
||||
|
||||
private String updater;
|
||||
|
||||
private String updateTime;
|
||||
/**
|
||||
* 报废数量
|
||||
*/
|
||||
private int bfNum;
|
||||
|
||||
private String keyWord;
|
||||
|
||||
private String startDay;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String endDay;
|
||||
|
||||
|
||||
/**
|
||||
* 明细
|
||||
*/
|
||||
private String infoMsg;
|
||||
|
||||
/**
|
||||
* 详情集合
|
||||
*/
|
||||
private List<PartScrapDetailsVo> detailList;
|
||||
|
||||
|
||||
/**
|
||||
* 文件上传 集合
|
||||
*/
|
||||
private List<FileUploadVo> fileList;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -66,4 +66,29 @@ public interface PaTypeMapper {
|
|||
* @return
|
||||
*/
|
||||
List<VendVo> getVendList(VendVo data);
|
||||
|
||||
/**
|
||||
* 查询 配件 类型集合
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
List<PaTypeVo> getPaTypeList(PaTypeVo data);
|
||||
|
||||
/**
|
||||
* 依据id 查询类型详情
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
PaTypeVo getPartTypeDetailById(String id);
|
||||
|
||||
/**
|
||||
* 更新库存数量
|
||||
* @param paTypeVo
|
||||
*/
|
||||
void updateNum(PaTypeVo paTypeVo);
|
||||
/**
|
||||
* 更新报废数量
|
||||
* @param paTypeVo
|
||||
*/
|
||||
void updateBfNum(PaTypeVo paTypeVo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,69 @@
|
|||
package com.bonus.gzgqj.business.bases.mapper;
|
||||
|
||||
import com.bonus.gzgqj.business.bases.entity.PartCheckDetailsVo;
|
||||
import com.bonus.gzgqj.business.bases.entity.PartCheckVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 黑子
|
||||
* 盘点接口层
|
||||
*/
|
||||
@Repository
|
||||
public interface PartCheckMapper {
|
||||
|
||||
/**
|
||||
* 分页查询 盘点记录
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
List<PartCheckVo> findByPage(PartCheckVo data);
|
||||
|
||||
/**
|
||||
* 盘点记录存储
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
int insertCheckData(PartCheckVo vo);
|
||||
|
||||
/**
|
||||
* 插入详情数据
|
||||
* @param vo
|
||||
* @param details
|
||||
* @return
|
||||
*/
|
||||
int insertCheckDetailData(@Param("param") PartCheckVo vo,@Param("list") List<PartCheckDetailsVo> details);
|
||||
|
||||
/**
|
||||
* 拆线呢盘点列表
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
PartCheckVo getCheckDetails(PartCheckVo data);
|
||||
|
||||
/**
|
||||
* 查询盘点详情
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
List<PartCheckDetailsVo> getCheckDetailList(PartCheckVo data);
|
||||
|
||||
/**
|
||||
* 消息
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
List<String> getInfo(PartCheckVo data);
|
||||
|
||||
List<String> getAddMsg(PartCheckVo data);
|
||||
|
||||
List<String> getSubMsg(PartCheckVo data);
|
||||
|
||||
/**
|
||||
* 当日入库量
|
||||
* @return
|
||||
*/
|
||||
int getNum();
|
||||
}
|
||||
|
|
@ -64,7 +64,7 @@ public interface PartInputMapper {
|
|||
* @param data
|
||||
* @return
|
||||
*/
|
||||
String getInfoById(PartInputVo data);
|
||||
List<String> getInfoById(PartInputVo data);
|
||||
|
||||
/**
|
||||
* 查询入库详情
|
||||
|
|
|
|||
|
|
@ -0,0 +1,65 @@
|
|||
package com.bonus.gzgqj.business.bases.mapper;
|
||||
|
||||
import com.bonus.gzgqj.business.bases.entity.PartCheckVo;
|
||||
import com.bonus.gzgqj.business.bases.entity.PartScrapDetailsVo;
|
||||
import com.bonus.gzgqj.business.bases.entity.PartScrapVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 报废 数据层
|
||||
* @author 黑子
|
||||
*/
|
||||
@Repository
|
||||
public interface PartScrapMapper {
|
||||
/**
|
||||
* 分页查询报废单
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
List<PartScrapVo> findByPage(PartScrapVo data);
|
||||
|
||||
/**
|
||||
* 今日报废单
|
||||
* @return
|
||||
*/
|
||||
int getNum();
|
||||
|
||||
/**
|
||||
* 新增报废单
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
int insertScrapData(PartScrapVo vo);
|
||||
|
||||
/**
|
||||
* 插入报废详情
|
||||
* @param vo
|
||||
* @param details
|
||||
* @return
|
||||
*/
|
||||
int insertScrapDetailsData(@Param("param") PartScrapVo vo, @Param("list") List<PartScrapDetailsVo> details);
|
||||
|
||||
/**
|
||||
* 依据id 查询详情
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
PartScrapVo getDetailsById(PartScrapVo data);
|
||||
|
||||
/**
|
||||
* 依据id查询 详情集合
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
List<PartScrapDetailsVo> getDetailListById(PartScrapVo data);
|
||||
|
||||
/**
|
||||
* 查询数据
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
List<String> getInfo(PartScrapVo data);
|
||||
}
|
||||
|
|
@ -47,6 +47,11 @@ public interface PaTypeService {
|
|||
*/
|
||||
List<PaTypeVo> findByPage(PaTypeVo data);
|
||||
|
||||
/**
|
||||
* 厂家下拉选
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
ServerResponse getVendList(VendVo data);
|
||||
|
||||
/**
|
||||
|
|
@ -55,4 +60,30 @@ public interface PaTypeService {
|
|||
* @return
|
||||
*/
|
||||
ServerResponse getTypeDetails(PaTypeVo data);
|
||||
|
||||
/**
|
||||
* 拆线呢配件数据
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
List<PaTypeVo> getPaTypeList(PaTypeVo data);
|
||||
|
||||
/**
|
||||
* 查询数据心昂去
|
||||
* @param partId
|
||||
* @return
|
||||
*/
|
||||
PaTypeVo getPartTypeDetailById(String partId);
|
||||
|
||||
/**
|
||||
* 更新库存数量
|
||||
* @param paTypeVo
|
||||
*/
|
||||
void updateNum(PaTypeVo paTypeVo);
|
||||
|
||||
/**
|
||||
* 更新爆发数量
|
||||
* @param paTypeVo
|
||||
*/
|
||||
void updateBfNum(PaTypeVo paTypeVo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -185,5 +185,38 @@ public class PaTypeServiceImpl implements PaTypeService{
|
|||
return ServerResponse.createSuccess(new PaTypeVo());
|
||||
}
|
||||
|
||||
/**
|
||||
* 配件下拉选 查询
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<PaTypeVo> getPaTypeList(PaTypeVo data) {
|
||||
List<PaTypeVo> list=new ArrayList<>();
|
||||
try{
|
||||
list=mapper.getPaTypeList(data);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@Override
|
||||
public PaTypeVo getPartTypeDetailById(String id){
|
||||
return mapper.getPartTypeDetailById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新库存数量
|
||||
* @param paTypeVo
|
||||
*/
|
||||
@Override
|
||||
public void updateNum(PaTypeVo paTypeVo) {
|
||||
mapper.updateNum(paTypeVo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateBfNum(PaTypeVo paTypeVo) {
|
||||
mapper.updateBfNum(paTypeVo);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,36 @@
|
|||
package com.bonus.gzgqj.business.bases.service;
|
||||
|
||||
import com.bonus.gzgqj.business.bases.entity.PartCheckVo;
|
||||
import com.bonus.gzgqj.manager.webResult.ServerResponse;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 库存盘点接口层
|
||||
* @author 黑子
|
||||
*/
|
||||
public interface PartCheckService {
|
||||
/**
|
||||
* 盘点记录分页拆线呢
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
List<PartCheckVo> findByPage(PartCheckVo data);
|
||||
|
||||
/**
|
||||
* 盘点入库新增接口
|
||||
* @param request
|
||||
* @param files
|
||||
* @return
|
||||
*/
|
||||
ServerResponse insertCheckData(HttpServletRequest request, MultipartFile[] files);
|
||||
|
||||
/**
|
||||
* 查看详情接口
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
ServerResponse getDetailsById(PartCheckVo data);
|
||||
}
|
||||
|
|
@ -0,0 +1,169 @@
|
|||
package com.bonus.gzgqj.business.bases.service;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.bonus.gzgqj.business.bases.entity.PaTypeVo;
|
||||
import com.bonus.gzgqj.business.bases.entity.PartCheckDetailsVo;
|
||||
import com.bonus.gzgqj.business.bases.entity.PartCheckVo;
|
||||
import com.bonus.gzgqj.business.bases.entity.PartInputVo;
|
||||
import com.bonus.gzgqj.business.bases.mapper.PartApplyMapper;
|
||||
import com.bonus.gzgqj.business.bases.mapper.PartCheckMapper;
|
||||
import com.bonus.gzgqj.business.plan.entity.FileUploadVo;
|
||||
import com.bonus.gzgqj.business.utils.FileUploadService;
|
||||
import com.bonus.gzgqj.manager.common.util.DateTimeHelper;
|
||||
import com.bonus.gzgqj.manager.common.util.StringHelper;
|
||||
import com.bonus.gzgqj.manager.common.util.StringUtils;
|
||||
import com.bonus.gzgqj.manager.common.util.UserUtil;
|
||||
import com.bonus.gzgqj.manager.webResult.ServerResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 库存盘点 业务层
|
||||
* @author 黑子
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class PartCheckServiceImpl implements PartCheckService{
|
||||
|
||||
@Autowired
|
||||
private PartCheckMapper mapper;
|
||||
@Autowired
|
||||
private PaTypeService paTypeService;
|
||||
|
||||
@Autowired
|
||||
private FileUploadService uploadService;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<PartCheckVo> findByPage(PartCheckVo data) {
|
||||
List<PartCheckVo> list=new ArrayList<>();
|
||||
try{
|
||||
list=mapper.findByPage(data);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 盘点入库接口
|
||||
* @param request
|
||||
* @param files
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ServerResponse insertCheckData(HttpServletRequest request, MultipartFile[] files) {
|
||||
try {
|
||||
Long userId= Objects.requireNonNull(UserUtil.getLoginUser()).getUserId();
|
||||
String userName=UserUtil.getLoginUser().getUsername();
|
||||
|
||||
String params=request.getParameter("params");
|
||||
PartCheckVo vo= JSON.parseObject(params,PartCheckVo.class);
|
||||
vo.setCreator(userId.toString());
|
||||
vo.setUpdater(userId.toString());
|
||||
vo.setUserName(userName);
|
||||
if(StringHelper.isEmpty(vo.getCreator())){
|
||||
return ServerResponse.createErroe("盘点人不能为空");
|
||||
}
|
||||
if(StringHelper.isEmpty(vo.getStartTime())){
|
||||
return ServerResponse.createErroe("请填写盘点开始时间");
|
||||
}
|
||||
if(StringHelper.isEmpty(vo.getEndTime())){
|
||||
return ServerResponse.createErroe("请填写盘点结束时间");
|
||||
}
|
||||
List<PartCheckDetailsVo> details=vo.getDetailList();
|
||||
if(details==null || details.isEmpty()){
|
||||
return ServerResponse.createErroe("请填写盘点详情");
|
||||
}
|
||||
final int[] blNum = {0,0};
|
||||
details.forEach(dat->{
|
||||
if(dat.getCheckNum()>= dat.getNum()){
|
||||
dat.setAddNum(dat.getCheckNum()-dat.getNum());
|
||||
//盘盈
|
||||
blNum[0] = blNum[0] +dat.getCheckNum()-dat.getNum();
|
||||
}else{
|
||||
dat.setSubNum(dat.getNum()-dat.getCheckNum());
|
||||
//盘亏
|
||||
blNum[1] = blNum[1] +dat.getNum()-dat.getCheckNum();
|
||||
}
|
||||
});
|
||||
vo.setAddNum(blNum[0]);
|
||||
vo.setSubNum(blNum[1]);
|
||||
vo.setCode(getCode());
|
||||
int success=mapper.insertCheckData(vo);
|
||||
if(success>0){
|
||||
List<FileUploadVo> fileList=uploadService.uploadImage(files,vo.getId(),"t_part_inventory","盘点附件");
|
||||
if(StringUtils.isEmpty(fileList) || fileList.size()!=files.length){
|
||||
return ServerResponse.createErroe("盘点失败");
|
||||
}
|
||||
int successful=mapper.insertCheckDetailData(vo,details);
|
||||
if(successful!=details.size()){
|
||||
return ServerResponse.createErroe("盘点失败");
|
||||
}
|
||||
//更新库存数量
|
||||
details.forEach(detail->{
|
||||
PaTypeVo paTypeVo=paTypeService.getPartTypeDetailById(detail.getPartId());
|
||||
paTypeVo.setNum(detail.getCheckNum());
|
||||
paTypeService.updateNum(paTypeVo);
|
||||
});
|
||||
return ServerResponse.createErroe("盘点成功");
|
||||
}
|
||||
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return ServerResponse.createErroe("盘点失败");
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ServerResponse getDetailsById(PartCheckVo data) {
|
||||
try{
|
||||
PartCheckVo vo=mapper.getCheckDetails(data);
|
||||
List<PartCheckDetailsVo> list=mapper.getCheckDetailList(data);
|
||||
vo.setDetailList(list);
|
||||
List<FileUploadVo> flieList=uploadService.getFileList(data.getId(),"t_part_inventory",null);
|
||||
vo.setFileList(flieList);
|
||||
List<String> infoMsg=mapper.getInfo(data);
|
||||
List<String> addMsg=mapper.getAddMsg(data);
|
||||
List<String> subMsg=mapper.getSubMsg(data);
|
||||
String info = String.join(",", infoMsg);
|
||||
String add= String.join(",", addMsg);
|
||||
String sub = String.join(",", subMsg);
|
||||
vo.setInfoMsg(info);
|
||||
vo.setAddMsg(add);
|
||||
vo.setSubMsg(sub);
|
||||
return ServerResponse.createSuccess(vo);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return ServerResponse.createSuccess(new PartCheckVo());
|
||||
}
|
||||
|
||||
public String getCode( ) {
|
||||
int num =mapper.getNum();
|
||||
num++;
|
||||
String year= DateTimeHelper.getNowYMD();
|
||||
if(num<10) {
|
||||
return year+"00"+num;
|
||||
}else if(num<100) {
|
||||
return year+"0"+num;
|
||||
}
|
||||
return year+num;
|
||||
}
|
||||
}
|
||||
|
|
@ -233,7 +233,8 @@ public class PartInputServiceImpl implements PartInputService{
|
|||
public ServerResponse getInputDetails(PartInputVo data) {
|
||||
try{
|
||||
PartInputVo vo=mapper.getInputDetails(data);
|
||||
String info=mapper.getInfoById(data);
|
||||
List<String> message=mapper.getInfoById(data);
|
||||
String info = String.join(",", message);
|
||||
vo.setInfo(info);
|
||||
List<FileUploadVo> flieList=uploadService.getFileList(data.getId(),"t_part_input",null);
|
||||
vo.setFileList(flieList);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,36 @@
|
|||
package com.bonus.gzgqj.business.bases.service;
|
||||
|
||||
import com.bonus.gzgqj.business.bases.entity.PartScrapVo;
|
||||
import com.bonus.gzgqj.manager.webResult.ServerResponse;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 报废单接口层
|
||||
* @author 黑子
|
||||
*/
|
||||
public interface PartScrapService {
|
||||
/**
|
||||
* 分页查询报废单
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
List<PartScrapVo> findByPage(PartScrapVo data);
|
||||
|
||||
/**
|
||||
* 新增报废数据
|
||||
* @param request
|
||||
* @param files
|
||||
* @return
|
||||
*/
|
||||
ServerResponse insertCheckData(HttpServletRequest request, MultipartFile[] files);
|
||||
|
||||
/**
|
||||
* 查看报废单详情
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
ServerResponse getDetailsById(PartScrapVo data);
|
||||
}
|
||||
|
|
@ -0,0 +1,135 @@
|
|||
package com.bonus.gzgqj.business.bases.service;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.bonus.gzgqj.business.bases.entity.*;
|
||||
import com.bonus.gzgqj.business.bases.mapper.PartScrapMapper;
|
||||
import com.bonus.gzgqj.business.plan.entity.FileUploadVo;
|
||||
import com.bonus.gzgqj.business.utils.FileUploadService;
|
||||
import com.bonus.gzgqj.manager.common.util.DateTimeHelper;
|
||||
import com.bonus.gzgqj.manager.common.util.StringHelper;
|
||||
import com.bonus.gzgqj.manager.common.util.StringUtils;
|
||||
import com.bonus.gzgqj.manager.common.util.UserUtil;
|
||||
import com.bonus.gzgqj.manager.webResult.ServerResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
*报废业务接口层
|
||||
* @author 黑子
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class PartScrapServiceImpl implements PartScrapService{
|
||||
|
||||
|
||||
@Autowired
|
||||
private PartScrapMapper mapper;
|
||||
|
||||
@Autowired
|
||||
private PaTypeService paTypeService;
|
||||
|
||||
@Autowired
|
||||
private FileUploadService uploadService;
|
||||
|
||||
@Override
|
||||
public List<PartScrapVo> findByPage(PartScrapVo data) {
|
||||
List<PartScrapVo> list=new ArrayList<>();
|
||||
try{
|
||||
list=mapper.findByPage(data);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServerResponse insertCheckData(HttpServletRequest request, MultipartFile[] files) {
|
||||
try {
|
||||
Long userId= Objects.requireNonNull(UserUtil.getLoginUser()).getUserId();
|
||||
String userName=UserUtil.getLoginUser().getUsername();
|
||||
String params=request.getParameter("params");
|
||||
PartScrapVo vo= JSON.parseObject(params,PartScrapVo.class);
|
||||
vo.setCreator(userId.toString());
|
||||
vo.setUpdater(userId.toString());
|
||||
vo.setUserName(userName);
|
||||
if(StringHelper.isEmpty(vo.getCreator())){
|
||||
return ServerResponse.createErroe("保费人不能为空");
|
||||
}
|
||||
if(StringHelper.isEmpty(vo.getScrapDay())){
|
||||
return ServerResponse.createErroe("请填写报废时间");
|
||||
}
|
||||
|
||||
List<PartScrapDetailsVo> details=vo.getDetailList();
|
||||
final int[] blNum = {0};
|
||||
details.forEach(dat->{
|
||||
blNum[0] = blNum[0] +dat.getScrapNum();
|
||||
|
||||
});
|
||||
vo.setBfNum(blNum[0]);
|
||||
vo.setCode(getCode());
|
||||
int success=mapper.insertScrapData(vo);
|
||||
if(success>0){
|
||||
List<FileUploadVo> fileList=uploadService.uploadImage(files,vo.getId(),"t_part_scrap","报废附件");
|
||||
if(StringUtils.isEmpty(fileList) || fileList.size()!=files.length){
|
||||
return ServerResponse.createErroe("报废失败");
|
||||
}
|
||||
int successful=mapper.insertScrapDetailsData(vo,details);
|
||||
if(successful!=details.size()){
|
||||
return ServerResponse.createErroe("报废失败");
|
||||
}
|
||||
//更新库存数量
|
||||
details.forEach(detail->{
|
||||
PaTypeVo paTypeVo=paTypeService.getPartTypeDetailById(detail.getPartId());
|
||||
paTypeVo.setNum(paTypeVo.getNum()-detail.getScrapNum());
|
||||
paTypeVo.setBfNum(paTypeVo.getBfNum()+detail.getScrapNum());
|
||||
paTypeService.updateBfNum(paTypeVo);
|
||||
});
|
||||
return ServerResponse.createErroe("报废成功");
|
||||
}
|
||||
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return ServerResponse.createErroe("报废失败");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServerResponse getDetailsById(PartScrapVo data) {
|
||||
try{
|
||||
PartScrapVo vo=mapper.getDetailsById(data);
|
||||
List<PartScrapDetailsVo> list=mapper.getDetailListById(data);
|
||||
vo.setDetailList(list);
|
||||
List<FileUploadVo> flieList=uploadService.getFileList(data.getId(),"t_part_scrap",null);
|
||||
vo.setFileList(flieList);
|
||||
List<String> infoMsg=mapper.getInfo(data);
|
||||
String info = String.join(",", infoMsg);
|
||||
vo.setInfoMsg(info);
|
||||
|
||||
return ServerResponse.createSuccess(vo);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return ServerResponse.createSuccess(new PartCheckVo());
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getCode( ) {
|
||||
int num =mapper.getNum();
|
||||
num++;
|
||||
String year= DateTimeHelper.getNowYMD();
|
||||
if(num<10) {
|
||||
return year+"00"+num;
|
||||
}else if(num<100) {
|
||||
return year+"0"+num;
|
||||
}
|
||||
return year+num;
|
||||
}
|
||||
}
|
||||
|
|
@ -11,6 +11,12 @@
|
|||
<update id="deleteTypeData">
|
||||
update pa_type set is_active=0 where id=#{id}
|
||||
</update>
|
||||
<update id="updateNum">
|
||||
update pa_type set num=#{num} where id=#{id}
|
||||
</update>
|
||||
<update id="updateBfNum">
|
||||
update pa_type set num=#{num} ,bf_num=#{bfNum} where id=#{id}
|
||||
</update>
|
||||
<select id="getTypeList" resultType="com.bonus.gzgqj.business.bases.entity.PaTypeVo">
|
||||
select if(id=1,0,id) id ,parent_id parentId,name,num,
|
||||
price,unit,weight,is_consumables ,
|
||||
|
|
@ -64,4 +70,28 @@
|
|||
FROM mm_vender
|
||||
where IS_ACTIVE=1
|
||||
</select>
|
||||
<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
|
||||
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
|
||||
WHERE pt.is_active=1 and pt.`level`=3
|
||||
<if test="type!=null and type !=''">
|
||||
and pt2.name like concat('%',#{type},'%')
|
||||
</if>
|
||||
<if test="name!=null and name !=''">
|
||||
and pt1.name like concat('%',#{name},'%')
|
||||
</if>
|
||||
<if test="model!=null and model !=''">
|
||||
and pt.name like concat('%',#{model},'%')
|
||||
</if>
|
||||
|
||||
</select>
|
||||
<select id="getPartTypeDetailById" resultType="com.bonus.gzgqj.business.bases.entity.PaTypeVo">
|
||||
select id ,num,ck_num ckNum,all_num allNum,bf_num bfNum
|
||||
from pa_type where id=#{partId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
tpb.remark like('%',#{keyWord},'%')
|
||||
)
|
||||
</if>
|
||||
<if test="times!=null and times!='' and startDay!=null and endDay!=null ">
|
||||
<if test="startDay!=null and startDay!='' and endDay!=null and endDay!='' ">
|
||||
and STR_TO_DATE(tpb.create_time, '%Y-%m-%d') between STR_TO_DATE(#{startDay} ,'%Y-%m-%d') AND STR_TO_DATE(#{endDay},'%Y-%m-%d')
|
||||
</if>
|
||||
</where>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,90 @@
|
|||
<?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.gzgqj.business.bases.mapper.PartCheckMapper" >
|
||||
<insert id="insertCheckData" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into t_part_inventory(
|
||||
code,creator,create_time,start_time,end_time,remark,
|
||||
updater,update_time,user_name,add_num,sub_num
|
||||
)values (#{code},#{creator},now(),#{startTime},#{endTime},#{remark},
|
||||
#{updater},now(),#{userName},#{addNum},#{subNum} )
|
||||
</insert>
|
||||
<insert id="insertCheckDetailData">
|
||||
insert into t_part_inventory_details(
|
||||
inv_id, part_id,check_num,
|
||||
remark, num, part_type,
|
||||
part_name, part_model,
|
||||
part_unit, add_num, sub_num
|
||||
) values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{param.id},#{item.partId},#{item.checkNum},#{item.remark},
|
||||
#{item.num},#{item.partType},#{item.partName},#{item.partModel},
|
||||
#{item.partUnit},#{item.addNum},#{item.subNum})
|
||||
</foreach>
|
||||
|
||||
</insert>
|
||||
|
||||
<select id="findByPage" resultType="com.bonus.gzgqj.business.bases.entity.PartCheckVo">
|
||||
select
|
||||
id,code,
|
||||
creator,create_time createTime,
|
||||
start_time startTime,end_time endTime,
|
||||
remark,updater,update_time updateTime,
|
||||
user_name userName,add_num addNum,
|
||||
sub_num subNum
|
||||
from t_part_inventory
|
||||
<where>
|
||||
<if test="keyWord!=null and keyWord!=''">
|
||||
and (
|
||||
code like concat('%',#{keyWord},'%') or
|
||||
start_time like concat('%',#{keyWord},'%') or
|
||||
remark like concat('%',#{keyWord},'%')
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
<select id="getCheckDetails" resultType="com.bonus.gzgqj.business.bases.entity.PartCheckVo">
|
||||
select
|
||||
id,code,
|
||||
creator,create_time createTime,
|
||||
start_time startTime,end_time endTime,
|
||||
remark,updater,update_time updateTime,
|
||||
user_name userName,add_num addNum,
|
||||
sub_num subNum
|
||||
from t_part_inventory
|
||||
where id=#{id}
|
||||
</select>
|
||||
<select id="getCheckDetailList" resultType="com.bonus.gzgqj.business.bases.entity.PartCheckDetailsVo">
|
||||
select id, inv_id invId, part_id partId,
|
||||
check_num checkNum, remark, num, part_type partType, part_name partName,
|
||||
part_model partModel, part_unit partUnit, add_num addNum, sub_num subNum
|
||||
from t_part_inventory_details
|
||||
where inv_id=#{id}
|
||||
</select>
|
||||
<!--入库数量-->
|
||||
<select id="getNum" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
from t_part_inventory
|
||||
where DATE_FORMAT(create_time,'%Y-%m-%d')=CURRENT_DATE
|
||||
</select>
|
||||
|
||||
<select id="getInfo" resultType="java.lang.String">
|
||||
select CONCAT(part_name,":",SUM(check_num)) detail
|
||||
from t_part_inventory_details
|
||||
where put_id=#{id}
|
||||
GROUP BY part_name
|
||||
|
||||
</select>
|
||||
<select id="getAddMsg" resultType="java.lang.String">
|
||||
select CONCAT(part_name,":",num,"=>",check_num) detail
|
||||
from t_part_inventory_details
|
||||
where put_id=#{id} and add_num>=0
|
||||
GROUP BY part_name
|
||||
</select>
|
||||
<select id="getSubMsg" resultType="java.lang.String">
|
||||
select CONCAT(part_name,":",num,"=>",check_num) detail
|
||||
from t_part_inventory_details
|
||||
where put_id=#{id} and sub_num>0
|
||||
GROUP BY part_name
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
<?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.gzgqj.business.bases.mapper.PartScrapMapper" >
|
||||
<insert id="insertScrapData" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into t_part_scrap(
|
||||
code, creator, create_time, remark,
|
||||
updater, update_time, scrap_day,
|
||||
bf_num, user_name
|
||||
)values (#{code},#{creator},now(),#{remark},#{updater},now(),#{scrapDay},#{bfNum},#{userName})
|
||||
</insert>
|
||||
<!--插入数据详情-->
|
||||
<insert id="insertScrapDetailsData">
|
||||
insert into t_part_scrap_details(
|
||||
scrap_id, part_id,scrap_num,
|
||||
remark, num, part_type,
|
||||
part_name, part_model, part_unit
|
||||
) values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{param.id},#{item.partId},#{item.scrapNum},#{item.remark},
|
||||
#{item.num},#{item.partType},#{item.partName},#{item.partModel}, #{item.partUnit})
|
||||
</foreach>
|
||||
</insert>
|
||||
<select id="findByPage" resultType="com.bonus.gzgqj.business.bases.entity.PartScrapVo">
|
||||
select
|
||||
id,code,creator,create_time createTime,remark,updater,
|
||||
update_time updateTime,scrap_day scrapDay,bf_num bfNum,user_name userName
|
||||
from t_part_scrap tps
|
||||
<where>
|
||||
<if test="keyWord!=null and keyWord!=''">
|
||||
and (
|
||||
tps.code like('%',#{keyWord},'%') or
|
||||
tps.user_name like('%',#{keyWord},'%') or
|
||||
tps.remark like('%',#{keyWord},'%')
|
||||
)
|
||||
</if>
|
||||
<if test="startDay!=null and startDay!='' and endDay!=null and endDay!='' ">
|
||||
and STR_TO_DATE(tps.create_time, '%Y-%m-%d') between STR_TO_DATE(#{startDay} ,'%Y-%m-%d') AND STR_TO_DATE(#{endDay},'%Y-%m-%d')
|
||||
</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
<!--今日报废单-->
|
||||
<select id="getNum" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
from t_part_scrap
|
||||
where DATE_FORMAT(create_time,'%Y-%m-%d')=CURRENT_DATE
|
||||
</select>
|
||||
<!--依据id查询详情-->
|
||||
<select id="getDetailsById" resultType="com.bonus.gzgqj.business.bases.entity.PartScrapVo">
|
||||
select
|
||||
id,code,creator,create_time createTime,remark,updater,
|
||||
update_time updateTime,scrap_day scrapDay,bf_num bfNum,user_name userName
|
||||
from t_part_scrap tps
|
||||
where id=#{id}
|
||||
</select>
|
||||
<select id="getDetailListById" resultType="com.bonus.gzgqj.business.bases.entity.PartScrapDetailsVo">
|
||||
select id, scrap_id scrapId , part_id partId,
|
||||
scrap_num scrapNum, remark, part_type partType, part_name partName,
|
||||
part_model partModel, part_unit partUnit
|
||||
from t_part_scrap_details
|
||||
where scrap_id=#{id}
|
||||
</select>
|
||||
<select id="getInfo" resultType="java.lang.String">
|
||||
select CONCAT(part_name,":",SUM(scrap_num)) detail
|
||||
from t_part_scrap_details
|
||||
where put_id=#{id}
|
||||
GROUP BY part_name
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue