4c25f6fd 康伟

kangwei : 药剂入库、物料验收单代码

1 个父辈 b3fb43c6
正在显示 35 个修改的文件 包含 902 行增加461 行删除
......@@ -138,9 +138,9 @@ public class DistributContractController {
@AutoLog(value = "erp分销合同-通过id查询")
@ApiOperation(value="erp分销合同-通过id查询", notes="erp分销合同-通过id查询")
@GetMapping(value = "/queryById")
public Result<DistributContract> queryById(@RequestParam(name="id",required=true) String id) {
Result<DistributContract> result = new Result<DistributContract>();
DistributContract distributContract = distributContractService.getById(id);
public Result<DistributContractVO> queryById(@RequestParam(name="id",required=true) String id) {
Result<DistributContractVO> result = new Result<DistributContractVO>();
DistributContractVO distributContract = distributContractService.queryById(id);
if(distributContract==null) {
result.error500("未找到对应实体");
}else {
......
......@@ -13,6 +13,7 @@ import com.skua.modules.erp.entity.PurchaseMaterial;
import com.skua.modules.erp.service.IDistributMaterialService;
import com.skua.modules.erp.service.IPurchaseMaterialService;
import com.skua.modules.erp.vo.MaterialSearchVO;
import com.skua.modules.erp.vo.PurchaseMaterialVO;
import com.skua.modules.supplies.entity.EquipmentSparepartSupplies;
import com.skua.modules.supplies.service.IEquipmentSparepartSuppliesService;
import com.skua.modules.system.entity.SysUser;
......@@ -23,10 +24,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
@Slf4j
@Api(tags="ert通用方法")
@RestController("rrpCommonController")
@RestController("erpCommonController")
@RequestMapping("/web/erp/common")
public class ErpCommonController {
@Autowired
......@@ -71,6 +73,21 @@ public class ErpCommonController {
}
@AutoLog(value = "ERP-采购合同--物料清单(药剂入库使用)")
@ApiOperation(value = "ERP-采购合同--物料清单药剂入库使用()", notes = "ERP-采购合同--物料清单(药剂入库使用)")
@RequestMapping(value = "/queryPurchaseMaterialListByIn", method = RequestMethod.GET)
public Result<IPage<PurchaseMaterialVO>> queryPurchaseMaterialListByIn(
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
Result<IPage<PurchaseMaterialVO>> result = new Result<IPage<PurchaseMaterialVO>>();
Page<PurchaseMaterialVO> page = new Page<PurchaseMaterialVO>(pageNo, pageSize);
String departId = BaseContextHandler.getRealDepartId();//当前部门编号
IPage<PurchaseMaterialVO> pageList = purchaseMaterialService.queryPurchaseMaterialListByIn(page,departId);
result.setSuccess(true);
result.setResult(pageList);
return result;
}
/* @AutoLog(value = "ERP-采购合同--物料清单")
@ApiOperation(value = "ERP-采购合同--物料清单", notes = "ERP-采购合同--物料清单")
@RequestMapping(value = "/distributMaterialList", method = RequestMethod.GET)
......
package com.skua.modules.erp.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.skua.core.api.vo.Result;
import com.skua.core.aspect.annotation.AutoLog;
import com.skua.core.context.BaseContextHandler;
import com.skua.core.query.QueryGenerator;
import com.skua.core.service.ISequenceService;
import com.skua.core.util.ConvertUtils;
import com.skua.modules.erp.entity.MaterialIN;
import com.skua.modules.erp.service.IMaterialINService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
/**
* <pre>
* 物料(药剂)入库
* </pre>
* @author 开发者姓名
* @version V0.1, 开发时间
*/
@Slf4j
@Api(tags="物料(药剂)入库")
@RestController("webMaterialINController")
@RequestMapping("/web/erp/materialIN")
public class MaterialINController {
@Autowired
private IMaterialINService materialINService;
/**
* <pre>
* 分页列表查询
* </pre>
* @param materialIN
* @param pageNo
* @param pageSize
* @param req
* @return
* @author 开发者姓名, 开发时间
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
@AutoLog(value = "物料(药剂)入库-分页列表查询")
@ApiOperation(value="物料(药剂)入库-分页列表查询", notes="物料(药剂)入库-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<MaterialIN>> queryPageList(MaterialIN materialIN,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
Result<IPage<MaterialIN>> result = new Result<IPage<MaterialIN>>();
QueryWrapper<MaterialIN> queryWrapper = QueryGenerator.initQueryWrapper(materialIN, req.getParameterMap());
Page<MaterialIN> page = new Page<MaterialIN>(pageNo, pageSize);
IPage<MaterialIN> pageList = materialINService.page(page, queryWrapper);
result.setSuccess(true);
result.setResult(pageList);
return result;
}
/**
* <pre>
* 添加
* </pre>
* @param materialIN
* @return
* @author 开发者姓名, 开发时间
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
@AutoLog(value = "物料(药剂)入库-添加")
@ApiOperation(value="物料(药剂)入库-添加", notes="物料(药剂)入库-添加")
@PostMapping(value = "/add")
public Result<MaterialIN> add(@RequestBody MaterialIN materialIN) {
Result<MaterialIN> result = new Result<MaterialIN>();
try {
materialINService.save(materialIN);
result.success("添加成功!");
} catch (Exception e) {
log.error(e.getMessage(),e);
result.error500("操作失败");
}
return result;
}
/**
* <pre>
* 编辑
* </pre>
* @param materialIN
* @return
* @author 开发者姓名, 开发时间
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
@AutoLog(value = "物料(药剂)入库-编辑")
@ApiOperation(value="物料(药剂)入库-编辑", notes="物料(药剂)入库-编辑")
@PutMapping(value = "/edit")
public Result<MaterialIN> edit(@RequestBody MaterialIN materialIN) {
Result<MaterialIN> result = new Result<MaterialIN>();
MaterialIN materialINEntity = materialINService.getById(materialIN.getId());
if(materialINEntity==null) {
result.error500("未找到对应实体");
}else {
boolean ok = materialINService.updateById(materialIN);
//TODO 返回false说明什么?
if(ok) {
result.success("修改成功!");
}
}
return result;
}
/**
* <pre>
* 通过id删除
* </pre>
* @param id
* @return
* @author 开发者姓名, 开发时间
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
@AutoLog(value = "物料(药剂)入库-通过id删除")
@ApiOperation(value="物料(药剂)入库-通过id删除", notes="物料(药剂)入库-通过id删除")
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
try {
materialINService.removeById(id);
} catch (Exception e) {
log.error("删除失败",e.getMessage());
return Result.error("删除失败!");
}
return Result.ok("删除成功!");
}
/**
* <pre>
* 批量删除
* </pre>
* @param ids
* @return
* @author 开发者姓名, 开发时间
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
@AutoLog(value = "物料(药剂)入库-批量删除")
@ApiOperation(value="物料(药剂)入库-批量删除", notes="物料(药剂)入库-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<MaterialIN> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
Result<MaterialIN> result = new Result<MaterialIN>();
if(ids==null || "".equals(ids.trim())) {
result.error500("参数不识别!");
}else {
this.materialINService.removeByIds(Arrays.asList(ids.split(",")));
result.success("删除成功!");
}
return result;
}
/**
* <pre>
* 通过id查询
* </pre>
* @param id
* @return
* @author 开发者姓名, 开发时间
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
@AutoLog(value = "物料(药剂)入库-通过id查询")
@ApiOperation(value="物料(药剂)入库-通过id查询", notes="物料(药剂)入库-通过id查询")
@GetMapping(value = "/queryById")
public Result<MaterialIN> queryById(@RequestParam(name="id",required=true) String id) {
Result<MaterialIN> result = new Result<MaterialIN>();
MaterialIN materialIN = materialINService.getById(id);
if(materialIN==null) {
result.error500("未找到对应实体");
}else {
result.setResult(materialIN);
result.setSuccess(true);
}
return result;
}
/**
* <pre>
* 导出excel
* </pre>
* @param request
* @param response
* @return
* @author 开发者姓名, 开发时间
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
// Step.1 组装查询条件
QueryWrapper<MaterialIN> queryWrapper = null;
try {
String paramsStr = request.getParameter("paramsStr");
if (ConvertUtils.isNotEmpty(paramsStr)) {
String deString = URLDecoder.decode(paramsStr, "UTF-8");
MaterialIN materialIN = JSON.parseObject(deString, MaterialIN.class);
queryWrapper = QueryGenerator.initQueryWrapper(materialIN, request.getParameterMap());
}
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
//Step.2 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
List<MaterialIN> pageList = materialINService.list(queryWrapper);
//导出文件名称
mv.addObject(NormalExcelConstants.FILE_NAME, "物料(药剂)入库列表");
mv.addObject(NormalExcelConstants.CLASS, MaterialIN.class);
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("物料(药剂)入库列表数据", "导出人:Jeecg", "导出信息"));
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
return mv;
}
/**
* <pre>
* 通过excel导入数据
* </pre>
* @param request
* @param response
* @return
* @author 开发者姓名, 开发时间
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
MultipartFile file = entity.getValue();// 获取上传文件对象
ImportParams params = new ImportParams();
params.setTitleRows(2);
params.setHeadRows(1);
params.setNeedSave(true);
try {
List<MaterialIN> listMaterialINs = ExcelImportUtil.importExcel(file.getInputStream(), MaterialIN.class, params);
materialINService.saveBatch(listMaterialINs);
return Result.ok("文件导入成功!数据行数:" + listMaterialINs.size());
} catch (Exception e) {
log.error(e.getMessage(),e);
return Result.error("文件导入失败:"+e.getMessage());
} finally {
try {
file.getInputStream().close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return Result.ok("文件导入失败!");
}
}
package com.skua.modules.erp.controller;
import java.util.Arrays;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.skua.core.api.vo.Result;
import com.skua.core.aspect.annotation.AutoLog;
import com.skua.core.context.BaseContextHandler;
import com.skua.core.query.QueryGenerator;
import com.skua.modules.erp.entity.ERPPurchaseContract;
import com.skua.modules.erp.service.IEROPurchaseContractService;
......@@ -52,14 +54,34 @@ public class PurchaseContractController {
}
@AutoLog(value = "erp采购合同-有权限的采购合同集合")
@ApiOperation(value="erp采购合同-有权限的采购合同集合", notes="erp采购合同-有权限的采购合同集合")
@GetMapping(value = "/purchaseContractList")
public Result<List<ERPPurchaseContract>> purchaseContractList() {
Result<List<ERPPurchaseContract>> result = new Result<List<ERPPurchaseContract>>();
QueryWrapper<ERPPurchaseContract> queryWrapper = new QueryWrapper<ERPPurchaseContract> (); // QueryGenerator.initQueryWrapper(ERPPurchaseContract, req.getParameterMap());
queryWrapper.like("departs", BaseContextHandler.getRealDepartId());
queryWrapper.orderByDesc("create_time");
// 需要添加条件判断
List<ERPPurchaseContract> pageList = purchaseContractService.list( queryWrapper);
result.setSuccess(true);
result.setResult(pageList);
return result;
}
@AutoLog(value = "erp采购合同-添加")
@ApiOperation(value="erp采购合同-添加", notes="erp采购合同-添加")
@PostMapping(value = "/add")
public Result<ERPPurchaseContract> add(@RequestBody PurchaseContractVO purchaseContract) {
public Result<ERPPurchaseContract> add(@RequestBody PurchaseContractVO purchaseContractVO) {
Result<ERPPurchaseContract> result = new Result<ERPPurchaseContract>();
try {
purchaseContractService.savePurchaseContract(purchaseContract);
result.success("添加成功!");
String errorGoodsCode = purchaseContractService.checkGoodCode(purchaseContractVO ,0 );
if(errorGoodsCode != null ){
result.error500("校验失败,货号[ "+errorGoodsCode+" ]已经存在!");
}else{
purchaseContractService.savePurchaseContract(purchaseContractVO);
result.success("添加成功!");
}
} catch (Exception e) {
log.error(e.getMessage(),e);
result.error500("操作失败");
......@@ -70,16 +92,18 @@ public class PurchaseContractController {
@AutoLog(value = "erp采购合同-编辑")
@ApiOperation(value="erp采购合同-编辑", notes="erp采购合同-编辑")
@PutMapping(value = "/edit")
public Result<ERPPurchaseContract> edit(@RequestBody PurchaseContractVO purchaseContract) {
public Result<ERPPurchaseContract> edit(@RequestBody PurchaseContractVO purchaseContractVO) {
Result<ERPPurchaseContract> result = new Result<ERPPurchaseContract>();
ERPPurchaseContract ERPPurchaseContractEntity = purchaseContractService.getById(purchaseContract.getId());
ERPPurchaseContract ERPPurchaseContractEntity = purchaseContractService.getById(purchaseContractVO.getId());
if(ERPPurchaseContractEntity ==null) {
result.error500("未找到对应实体");
}else {
boolean ok = purchaseContractService.updatePurchaseContract(purchaseContract);
//TODO 返回false说明什么?
if(ok) {
result.success("修改成功!");
String errorGoodsCode = purchaseContractService.checkGoodCode(purchaseContractVO ,1 );
if(errorGoodsCode != null ){
result.error500("校验失败,货号[ "+errorGoodsCode+" ]已经存在!");
}else{
purchaseContractService.updatePurchaseContract(purchaseContractVO);
result.success("修改成功!");
}
}
......
package com.skua.modules.erp.controller.web;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.skua.core.api.vo.Result;
import com.skua.core.aspect.annotation.AutoLog;
import com.skua.core.context.BaseContextHandler;
import com.skua.core.query.QueryGenerator;
import com.skua.core.service.ISequenceService;
import com.skua.core.util.ConvertUtils;
import com.skua.modules.erp.entity.Warehousing;
import com.skua.modules.erp.service.IWarehousingService;
import java.util.Date;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
/**
* <pre>
* 采购入库
* </pre>
* @author 开发者姓名
* @version V0.1, 开发时间
*/
@Slf4j
@Api(tags="采购入库")
@RestController("webWarehousingController")
@RequestMapping("/web/erp/warehousing")
public class WarehousingController {
@Autowired
private IWarehousingService warehousingService;
@AutoLog(value = "采购入库-分页列表查询")
@ApiOperation(value="采购入库-分页列表查询", notes="采购入库-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<Warehousing>> queryPageList(Warehousing warehousing,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
Result<IPage<Warehousing>> result = new Result<IPage<Warehousing>>();
QueryWrapper<Warehousing> queryWrapper = QueryGenerator.initQueryWrapper(warehousing, req.getParameterMap());
Page<Warehousing> page = new Page<Warehousing>(pageNo, pageSize);
IPage<Warehousing> pageList = warehousingService.page(page, queryWrapper);
result.setSuccess(true);
result.setResult(pageList);
return result;
}
@AutoLog(value = "采购入库-添加")
@ApiOperation(value="采购入库-添加", notes="采购入库-添加")
@PostMapping(value = "/add")
public Result<Warehousing> add(@RequestBody Warehousing warehousing) {
Result<Warehousing> result = new Result<Warehousing>();
try {
warehousingService.save(warehousing);
result.success("添加成功!");
} catch (Exception e) {
log.error(e.getMessage(),e);
result.error500("操作失败");
}
return result;
}
@AutoLog(value = "采购入库-编辑")
@ApiOperation(value="采购入库-编辑", notes="采购入库-编辑")
@PutMapping(value = "/edit")
public Result<Warehousing> edit(@RequestBody Warehousing warehousing) {
Result<Warehousing> result = new Result<Warehousing>();
Warehousing warehousingEntity = warehousingService.getById(warehousing.getId());
if(warehousingEntity==null) {
result.error500("未找到对应实体");
}else {
boolean ok = warehousingService.updateById(warehousing);
//TODO 返回false说明什么?
if(ok) {
result.success("修改成功!");
}
}
return result;
}
@AutoLog(value = "采购入库-通过id删除")
@ApiOperation(value="采购入库-通过id删除", notes="采购入库-通过id删除")
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
try {
warehousingService.removeById(id);
} catch (Exception e) {
log.error("删除失败",e.getMessage());
return Result.error("删除失败!");
}
return Result.ok("删除成功!");
}
@AutoLog(value = "采购入库-批量删除")
@ApiOperation(value="采购入库-批量删除", notes="采购入库-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<Warehousing> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
Result<Warehousing> result = new Result<Warehousing>();
if(ids==null || "".equals(ids.trim())) {
result.error500("参数不识别!");
}else {
this.warehousingService.removeByIds(Arrays.asList(ids.split(",")));
result.success("删除成功!");
}
return result;
}
@AutoLog(value = "采购入库-通过id查询")
@ApiOperation(value="采购入库-通过id查询", notes="采购入库-通过id查询")
@GetMapping(value = "/queryById")
public Result<Warehousing> queryById(@RequestParam(name="id",required=true) String id) {
Result<Warehousing> result = new Result<Warehousing>();
Warehousing warehousing = warehousingService.getById(id);
if(warehousing==null) {
result.error500("未找到对应实体");
}else {
result.setResult(warehousing);
result.setSuccess(true);
}
return result;
}
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
// Step.1 组装查询条件
QueryWrapper<Warehousing> queryWrapper = null;
try {
String paramsStr = request.getParameter("paramsStr");
if (ConvertUtils.isNotEmpty(paramsStr)) {
String deString = URLDecoder.decode(paramsStr, "UTF-8");
Warehousing warehousing = JSON.parseObject(deString, Warehousing.class);
queryWrapper = QueryGenerator.initQueryWrapper(warehousing, request.getParameterMap());
}
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
//Step.2 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
List<Warehousing> pageList = warehousingService.list(queryWrapper);
//导出文件名称
mv.addObject(NormalExcelConstants.FILE_NAME, "采购入库列表");
mv.addObject(NormalExcelConstants.CLASS, Warehousing.class);
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("采购入库列表数据", "导出人:Jeecg", "导出信息"));
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
return mv;
}
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
MultipartFile file = entity.getValue();// 获取上传文件对象
ImportParams params = new ImportParams();
params.setTitleRows(2);
params.setHeadRows(1);
params.setNeedSave(true);
try {
List<Warehousing> listWarehousings = ExcelImportUtil.importExcel(file.getInputStream(), Warehousing.class, params);
warehousingService.saveBatch(listWarehousings);
return Result.ok("文件导入成功!数据行数:" + listWarehousings.size());
} catch (Exception e) {
log.error(e.getMessage(),e);
return Result.error("文件导入失败:"+e.getMessage());
} finally {
try {
file.getInputStream().close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return Result.ok("文件导入失败!");
}
}
......@@ -33,6 +33,7 @@ public class DistributContract {
/**所属机构*/
@Excel(name = "所属机构", width = 15)
@ApiModelProperty(value = "所属机构")
@Dict(dictTable = "sys_depart", dicCode="id", dicText = "depart_name")
private String departId;
/**合同名称*/
@Excel(name = "合同名称", width = 15)
......@@ -53,6 +54,7 @@ public class DistributContract {
/**申请状态:0 未发布 1 已发布(待审核)2 审核驳回 3 审核通过*/
@Excel(name = "申请状态:0 未发布 1 已发布(待审核)2 审核驳回 3 审核通过", width = 15)
@ApiModelProperty(value = "申请状态:0 未发布 1 已发布(待审核)2 审核驳回 3 审核通过")
@Dict( dicCode="purchase_plan_status")
private String status;
/**合同附件*/
@Excel(name = "合同附件", width = 15)
......@@ -63,7 +65,6 @@ public class DistributContract {
@ApiModelProperty(value = "备注")
private String remarks;
/**申请人*/
@Excel(name = "申请人", width = 15)
@ApiModelProperty(value = "申请人")
......@@ -74,8 +75,6 @@ public class DistributContract {
@ApiModelProperty(value = "申请时间")
private String applyTime;
/**创建人id*/
@Excel(name = "创建人id", width = 15)
@ApiModelProperty(value = "创建人id")
......
......@@ -24,7 +24,6 @@ import org.jeecgframework.poi.excel.annotation.Excel;
@Accessors(chain = true)
@ApiModel(value="erp_distribut_material对象", description="erp分销物料")
public class DistributMaterial {
/**主键*/
@TableId(type = IdType.ID_WORKER_STR)
@ApiModelProperty(value = "主键")
......@@ -40,23 +39,23 @@ public class DistributMaterial {
/**货号*/
@Excel(name = "货号", width = 15)
@ApiModelProperty(value = "货号")
private String goodNum;
private String goodCode;
/**计量单位*/
@Excel(name = "计量单位", width = 15)
@ApiModelProperty(value = "计量单位")
private String unit;
private String measuringUnit;
/**物料数量*/
@Excel(name = "物料数量", width = 15)
@ApiModelProperty(value = "物料数量")
private String materialNum;
/**单价*/
@Excel(name = "单价", width = 15)
@ApiModelProperty(value = "单价")
private String unitPrice;
@Excel(name = "分销单价", width = 15)
@ApiModelProperty(value = "分销单价")
private String distributPrice;
/**总价*/
@Excel(name = "总价", width = 15)
@ApiModelProperty(value = "总价")
private String totalPrice;
@Excel(name = "分销总价", width = 15)
@ApiModelProperty(value = "分销总价")
private String distributTotalPrice;
/**备注*/
@Excel(name = "备注", width = 15)
@ApiModelProperty(value = "备注")
......
......@@ -55,6 +55,7 @@ public class ERPPurchaseContract {
/**申请状态:0 未发布 1 已发布(待审核)2 审核驳回 3 审核通过*/
@Excel(name = "申请状态:0 未发布 1 已发布(待审核)2 审核驳回 3 审核通过", width = 15)
@ApiModelProperty(value = "申请状态:0 未发布 1 已发布(待审核)2 审核驳回 3 审核通过")
@Dict( dicCode="purchase_plan_status")
private java.lang.String status;
/**采购金额*/
@Excel(name = "采购金额", width = 15)
......
package com.skua.modules.erp.entity;
import java.io.Serializable;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import com.skua.core.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
/**
* 物料验收单
*/
@Data
@TableName("erp_material_acceptance_form")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="erp_material_acceptance_form对象", description="物料验收单")
public class MaterialAcceptanceForm {
/**主键*/
@TableId(type = IdType.ID_WORKER_STR)
@ApiModelProperty(value = "主键")
private String id;
/**入库单号*/
@Excel(name = "入库单号", width = 15)
@ApiModelProperty(value = "入库单号")
private String materialInId;
/**入库单号*/
@Excel(name = "入库单号", width = 15)
@ApiModelProperty(value = "入库单号")
private String inOrder;
/**外观情况*/
@Excel(name = "外观情况", width = 15)
@ApiModelProperty(value = "外观情况")
private String appearanceInfo;
/**货物与合同清单匹配情况*/
@Excel(name = "货物与合同清单匹配情况", width = 15)
@ApiModelProperty(value = "货物与合同清单匹配情况")
private String matchedInfo;
/**处理意见*/
@Excel(name = "处理意见", width = 15)
@ApiModelProperty(value = "处理意见")
private String handleMsg;
/**送货/供方人员签字*/
@Excel(name = "送货/供方人员签字", width = 15)
@ApiModelProperty(value = "送货/供方人员签字")
private String senderSign;
/**收货人员签字*/
@Excel(name = "收货人员签字", width = 15)
@ApiModelProperty(value = "收货人员签字")
private String receiverSign;
/**确认状态 0 未确认、1 部分确认、2全部确认*/
@Excel(name = "确认状态 0 未确认、1 部分确认、2全部确认", width = 15)
@ApiModelProperty(value = "确认状态 0 未确认、1 部分确认、2全部确认")
@Dict( dicCode="purchase_confirm_status")
private String confirmStatus;
/**分享地址*/
@Excel(name = "分享地址", width = 15)
@ApiModelProperty(value = "分享地址")
private String shareUrl;
/**创建时间*/
@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建时间")
private Date createTime;
/**修改时间*/
@Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "修改时间")
private Date updateTime;
/**备注*/
@Excel(name = "备注", width = 15)
@ApiModelProperty(value = "备注")
private String remark;
}
package com.skua.modules.erp.entity;
import java.io.Serializable;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import com.skua.core.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
/**
* 物料(药剂)入库
*/
@Data
@TableName("erp_material_in")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="erp_material_in对象", description="物料(药剂)入库")
public class MaterialIN {
/**id*/
@TableId(type = IdType.ID_WORKER_STR)
@ApiModelProperty(value = "id")
private String id;
/**所属机构*/
@Excel(name = "所属机构", width = 15)
@ApiModelProperty(value = "所属机构")
@Dict(dictTable = "sys_depart", dicCode="id", dicText = "depart_name")
private String departId;
/**项目名称*/
@Excel(name = "项目名称", width = 15)
@ApiModelProperty(value = "项目名称")
private String projectName;
/**入库单号*/
@Excel(name = "入库单号", width = 15)
@ApiModelProperty(value = "入库单号")
private String inOrder;
/**采购合同*/
@Excel(name = "采购合同", width = 15)
@ApiModelProperty(value = "采购合同")
private String purchaseContractId;
/**分销合同*/
@Excel(name = "分销合同", width = 15)
@ApiModelProperty(value = "分销合同")
private String distributContractId;
/**到货时间*/
@Excel(name = "到货时间", width = 15)
@ApiModelProperty(value = "到货时间")
private String arriveTime;
/**收货人*/
@Excel(name = "收货人", width = 15)
@ApiModelProperty(value = "收货人")
private String receiver;
/**物料编号*/
@Excel(name = "物料编号", width = 15)
@ApiModelProperty(value = "物料编号")
private String sparepartId;
/**药剂(物料)名称*/
@Excel(name = "药剂(物料)名称", width = 15)
@ApiModelProperty(value = "药剂(物料)名称")
private String sparepartName;
/**规格型号*/
@Excel(name = "规格型号", width = 15)
@ApiModelProperty(value = "规格型号")
private String specification;
/**计量单位*/
@Excel(name = "计量单位", width = 15)
@ApiModelProperty(value = "计量单位")
private String measuringUnit;
/**数量*/
@Excel(name = "数量", width = 15)
@ApiModelProperty(value = "数量")
private String materialNum;
/**供应商编号*/
@Excel(name = "供应商编号", width = 15)
@ApiModelProperty(value = "供应商编号")
private String supplierId;
/**货号*/
@Excel(name = "货号", width = 15)
@ApiModelProperty(value = "货号")
private String goodCode;
/**采购单价*/
@Excel(name = "采购单价", width = 15)
@ApiModelProperty(value = "采购单价")
private String purchasePrice;
/**分销单价*/
@Excel(name = "分销单价", width = 15)
@ApiModelProperty(value = "分销单价")
private String distributPrice;
/**采购总价*/
@Excel(name = "采购总价", width = 15)
@ApiModelProperty(value = "采购总价")
private String purchaseTotalPrice;
/**分销总价*/
@Excel(name = "分销总价", width = 15)
@ApiModelProperty(value = "分销总价")
private String distributTotalPrice;
/**税额*/
@Excel(name = "税额", width = 15)
@ApiModelProperty(value = "税额")
private String taxAmount;
/**价税合计*/
@Excel(name = "价税合计", width = 15)
@ApiModelProperty(value = "价税合计")
private String totalPriceTax;
/**分享地址*/
@Excel(name = "分享地址", width = 15)
@ApiModelProperty(value = "分享地址")
private String shareUrl;
/**确认状态:0 未确认 1 部分确认 2 全部确认*/
@Excel(name = "确认状态:0 未确认 1 部分确认 2 全部确认", width = 15)
@ApiModelProperty(value = "确认状态:0 未确认 1 部分确认 2 全部确认")
@Dict( dicCode="purchase_confirm_status")
private String confirmStatus;
/**审批状态:0 未发布 1 已发布(待审核)2 审核驳回 3 审核通过*/
@Excel(name = "审批状态:0 未发布 1 已发布(待审核)2 审核驳回 3 审核通过", width = 15)
@ApiModelProperty(value = "审批状态:0 未发布 1 已发布(待审核)2 审核驳回 3 审核通过")
@Dict( dicCode="purchase_plan_status")
private String auditStatus;
/**入库类型*/
@Excel(name = "入库类型", width = 15)
@ApiModelProperty(value = "入库类型")
private String inType;
/**备注*/
@Excel(name = "备注", width = 15)
@ApiModelProperty(value = "备注")
private String remark;
/**创建人id*/
@Excel(name = "创建人id", width = 15)
@ApiModelProperty(value = "创建人id")
private String createBy;
/**创建时间*/
@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建时间")
private Date createTime;
/**修改人id*/
@Excel(name = "修改人id", width = 15)
@ApiModelProperty(value = "修改人id")
private String updateBy;
/**修改时间*/
@Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "修改时间")
private Date updateTime;
/**所属部门*/
@Excel(name = "所属部门", width = 15)
@ApiModelProperty(value = "所属部门")
private String createDept;
/**所属公司*/
@Excel(name = "所属公司", width = 15)
@ApiModelProperty(value = "所属公司")
private String createCmpy;
/**删除标识,0:正常,1:删除*/
@Excel(name = "删除标识,0:正常,1:删除", width = 15)
@ApiModelProperty(value = "删除标识,0:正常,1:删除")
private Integer delFlag;
}
......@@ -99,6 +99,14 @@ public class PurchaseMaterial {
@TableField(exist=false)
@ApiModelProperty(value = "扩展:采购物料数量")
private String materialNum;
/**单价*/
@Excel(name = "分销单价", width = 15)
@ApiModelProperty(value = "扩展:分销单价")
private String distributPrice;
/**总价*/
@Excel(name = "分销总价", width = 15)
@ApiModelProperty(value = "扩展:分销总价")
private String distributTotalPrice;
}
......
package com.skua.modules.erp.entity;
import java.io.Serializable;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
/**
* 采购入库
*/
@Data
@TableName("erp_warehousing")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="erp_warehousing对象", description="采购入库")
public class Warehousing {
/**主键*/
@TableId(type = IdType.ID_WORKER_STR)
@ApiModelProperty(value = "主键")
private java.lang.String id;
/**厂站*/
@Excel(name = "厂站", width = 15)
@ApiModelProperty(value = "厂站")
private java.lang.String departId;
/**入库类型*/
@Excel(name = "入库类型", width = 15)
@ApiModelProperty(value = "入库类型")
private java.lang.String inType;
/**收货人*/
@Excel(name = "收货人", width = 15)
@ApiModelProperty(value = "收货人")
private java.lang.String receiver;
/**入库时间*/
@Excel(name = "入库时间", width = 15)
@ApiModelProperty(value = "入库时间")
private java.lang.String inDate;
/**物料类别编号*/
@Excel(name = "物料类别编号", width = 15)
@ApiModelProperty(value = "物料类别编号")
private java.lang.String sparepartType;
/**物料编号*/
@Excel(name = "物料编号", width = 15)
@ApiModelProperty(value = "物料编号")
private java.lang.String sparepartId;
/**物料编号*/
@Excel(name = "物料编号", width = 15)
@ApiModelProperty(value = "物料编号")
private java.lang.String goodNum;
/**供应商id*/
@Excel(name = "供应商id", width = 15)
@ApiModelProperty(value = "供应商id")
private java.lang.String supplierId;
/**规格型号*/
@Excel(name = "规格型号", width = 15)
@ApiModelProperty(value = "规格型号")
private java.lang.String specification;
/**计量单位*/
@Excel(name = "计量单位", width = 15)
@ApiModelProperty(value = "计量单位")
private java.lang.String measuringUnit;
/**计划采购数量*/
@Excel(name = "计划采购数量", width = 15)
@ApiModelProperty(value = "计划采购数量")
private java.lang.String materialNum;
/**到货日期*/
@Excel(name = "到货日期", width = 15)
@ApiModelProperty(value = "到货日期")
private java.lang.String arrivalDate;
/**外观情况*/
@Excel(name = "外观情况", width = 15)
@ApiModelProperty(value = "外观情况")
private java.lang.String appearanceInfo;
/**货物与合同清单匹配情况*/
@Excel(name = "货物与合同清单匹配情况", width = 15)
@ApiModelProperty(value = "货物与合同清单匹配情况")
private java.lang.String matchedInfo;
/**处理意见*/
@Excel(name = "处理意见", width = 15)
@ApiModelProperty(value = "处理意见")
private java.lang.String handleMsg;
/**送货/供方人员签字*/
@Excel(name = "送货/供方人员签字", width = 15)
@ApiModelProperty(value = "送货/供方人员签字")
private java.lang.String senderSign;
/**收货人员签字*/
@Excel(name = "收货人员签字", width = 15)
@ApiModelProperty(value = "收货人员签字")
private java.lang.String receiverSign;
/**确认状态 0 未确认、1 部分确认、2全部确认*/
@Excel(name = "确认状态 0 未确认、1 部分确认、2全部确认", width = 15)
@ApiModelProperty(value = "确认状态 0 未确认、1 部分确认、2全部确认")
private java.lang.String confirmStatus;
/**分享地址*/
@Excel(name = "分享地址", width = 15)
@ApiModelProperty(value = "分享地址")
private java.lang.String shareUrl;
/**分销合同*/
@Excel(name = "分销合同", width = 15)
@ApiModelProperty(value = "分销合同")
private java.lang.String distributContract;
/**采购合同*/
@Excel(name = "采购合同", width = 15)
@ApiModelProperty(value = "采购合同")
private java.lang.String purchaseContract;
/**采购单价*/
@Excel(name = "采购单价", width = 15)
@ApiModelProperty(value = "采购单价")
private java.lang.String purchasePrice;
/**分销单价*/
@Excel(name = "分销单价", width = 15)
@ApiModelProperty(value = "分销单价")
private java.lang.String distributPrice;
/**采购总价*/
@Excel(name = "采购总价", width = 15)
@ApiModelProperty(value = "采购总价")
private java.lang.String purchaseTotalPrice;
/**分销总价*/
@Excel(name = "分销总价", width = 15)
@ApiModelProperty(value = "分销总价")
private java.lang.String distributTotalPrice;
/**到货验收时间*/
@Excel(name = "到货验收时间", width = 15)
@ApiModelProperty(value = "到货验收时间")
private java.lang.String acceptancesTime;
/**申请人*/
@Excel(name = "申请人", width = 15)
@ApiModelProperty(value = "申请人")
private java.lang.String applyUser;
/**申请时间*/
@Excel(name = "申请时间", width = 15)
@ApiModelProperty(value = "申请时间")
private java.lang.String applyTime;
/**审批人*/
@Excel(name = "审批人", width = 15)
@ApiModelProperty(value = "审批人")
private java.lang.String approveUser;
/**审批时间*/
@Excel(name = "审批时间", width = 15)
@ApiModelProperty(value = "审批时间")
private java.lang.String approveTime;
/**审批意见*/
@Excel(name = "审批意见", width = 15)
@ApiModelProperty(value = "审批意见")
private java.lang.String approveMessage;
/**审核状态*/
@Excel(name = "审核状态", width = 15)
@ApiModelProperty(value = "审核状态")
private java.lang.String approveState;
/**备注*/
@Excel(name = "备注", width = 15)
@ApiModelProperty(value = "备注")
private java.lang.String remark;
/**创建人id*/
@Excel(name = "创建人id", width = 15)
@ApiModelProperty(value = "创建人id")
private java.lang.String createBy;
/**创建时间*/
@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建时间")
private java.util.Date createTime;
/**修改人id*/
@Excel(name = "修改人id", width = 15)
@ApiModelProperty(value = "修改人id")
private java.lang.String updateBy;
/**修改时间*/
@Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "修改时间")
private java.util.Date updateTime;
/**所属部门*/
@Excel(name = "所属部门", width = 15)
@ApiModelProperty(value = "所属部门")
private java.lang.String createDept;
/**所属公司*/
@Excel(name = "所属公司", width = 15)
@ApiModelProperty(value = "所属公司")
private java.lang.String createCmpy;
/**删除标识,0:有效,1:删除*/
@Excel(name = "删除标识,0:有效,1:删除", width = 15)
@ApiModelProperty(value = "删除标识,0:有效,1:删除")
private java.lang.Integer delFlag;
}
......@@ -15,5 +15,11 @@ public interface DistributMaterialMapper extends BaseMapper<DistributMaterial> {
List<DistributMaterial> queryListByContractId( @Param("contractId") String contractId);
/***
* 根据id或code校验货号是否唯一
* @param id
* @param goodCode
* @return
*/
public int checkGoodCode(@Param("id")String id,@Param("goodCode") String goodCode);
}
......
package com.skua.modules.erp.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.skua.modules.erp.entity.MaterialAcceptanceForm;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 物料验收单
*/
public interface MaterialAcceptanceFormMapper extends BaseMapper<MaterialAcceptanceForm> {
}
......@@ -3,12 +3,12 @@ package com.skua.modules.erp.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.skua.modules.erp.entity.Warehousing;
import com.skua.modules.erp.entity.MaterialIN;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 采购入库
* 物料(药剂)入库
*/
public interface WarehousingMapper extends BaseMapper<Warehousing> {
public interface MaterialINMapper extends BaseMapper<MaterialIN> {
}
......
......@@ -5,6 +5,7 @@ import java.util.List;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.skua.modules.erp.entity.DistributContract;
import com.skua.modules.erp.vo.PurchaseMaterialVO;
import com.skua.modules.erp.vo.PurchasePlanSearchVO;
import org.apache.ibatis.annotations.Param;
import com.skua.modules.erp.entity.PurchaseMaterial;
......@@ -47,12 +48,20 @@ public interface PurchaseMaterialMapper extends BaseMapper<PurchaseMaterial> {
*/
List<PurchaseMaterial> queryByList( @Param("goodCode")String goodCode, @Param("departId")String departId);
/***
* 查询某一物料的的采购计划物料清单
* @param page
* @param sparepartId
* @param departs
* 根据id或code校验货号是否唯一
* @param id
* @param goodCode
* @return
*/
public int checkGoodCode(@Param("id")String id,@Param("goodCode") String goodCode);
/**
* 药剂入库查询结果:物料清单
* @param departId
* @return
*/
IPage<PurchaseMaterial> statisticsPageBySparepartId(@Param("page")Page<PurchaseMaterial> page, @Param("sparepartId")Integer sparepartId, @Param("departs")String departs);
public IPage<PurchaseMaterialVO> queryPurchaseMaterialListByIn(Page<PurchaseMaterialVO> page,@Param("departId")String departId);
}
......
......@@ -13,4 +13,12 @@
select m.* from erp_distribut_material m
where m.contract_id = #{contractId}
</select>
<!-- 校验货号是否唯一 -->
<select id="checkGoodCode" resultType="java.lang.Integer">
select count(1) from erp_distribut_material
where good_code = #{goodCode}
<if test="id != null and id !=''">and id = #{id}</if>
</select>
</mapper>
\ No newline at end of file
......
<?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.skua.modules.erp.mapper.WarehousingMapper">
<mapper namespace="com.skua.modules.erp.mapper.MaterialAcceptanceFormMapper">
</mapper>
\ No newline at end of file
......
<?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.skua.modules.erp.mapper.MaterialINMapper">
</mapper>
\ No newline at end of file
......@@ -54,4 +54,23 @@
</select>
<!-- 校验货号是否唯一 -->
<select id="checkGoodCode" resultType="java.lang.Integer">
select count(1) from erp_purchase_material
where good_code = #{goodCode}
<if test="id != null and id !=''">and id = #{id}</if>
</select>
<!-- 药剂入库查询结果:物料清单-->
<select id="queryPurchaseMaterialListByIn" resultType="com.skua.modules.erp.vo.PurchaseMaterialVO">
select dm.distribut_price ,dm.distribut_total_price ,aaa.* from (
select pm.*
from erp_purchase_material pm , erp_purchase_contract pc
where pm.contract_id =pc.id
and pc.departs like concat('%', #{departId}, '%')
)aaa
left join erp_distribut_material dm on aaa.good_code = dm.good_code
</select>
</mapper>
\ No newline at end of file
......
......@@ -7,7 +7,9 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.skua.modules.erp.entity.PurchaseMaterial;
import com.skua.modules.erp.entity.PurchasePlanItem;
import com.skua.modules.erp.vo.PurchaseContractVO;
import com.skua.modules.erp.vo.PurchaseMaterialVO;
import com.skua.modules.erp.vo.PurchasePlanSearchVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
......@@ -15,7 +17,13 @@ import java.util.List;
* 采购合同
*/
public interface IEROPurchaseContractService extends IService<ERPPurchaseContract> {
/***
* 校验方法:校验是否唯一
* @param purchaseContractVO
* @param checkCount 新增= 0 ,修改checkCount=1
* @return 返回有问题的货号
*/
public String checkGoodCode(PurchaseContractVO purchaseContractVO,int checkCount );
/***
* 新增purchaseContractVO
* @param purchaseContractVO
......@@ -62,4 +70,7 @@ public interface IEROPurchaseContractService extends IService<ERPPurchaseContrac
*/
public int syncEquipmentIn(PurchaseContractVO purchaseContractVO)throws Exception;
}
......
package com.skua.modules.erp.service;
import com.skua.modules.erp.entity.MaterialAcceptanceForm;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 物料验收单
*/
public interface IMaterialAcceptanceFormService extends IService<MaterialAcceptanceForm> {
}
package com.skua.modules.erp.service;
import com.skua.modules.erp.entity.Warehousing;
import com.skua.modules.erp.entity.MaterialIN;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 采购入库
* 物料(药剂)入库
*/
public interface IWarehousingService extends IService<Warehousing> {
public interface IMaterialINService extends IService<MaterialIN> {
}
......
......@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.skua.modules.erp.entity.DistributContract;
import com.skua.modules.erp.entity.PurchaseMaterial;
import com.baomidou.mybatisplus.extension.service.IService;
import com.skua.modules.erp.vo.PurchaseMaterialVO;
import com.skua.modules.erp.vo.PurchasePlanSearchVO;
import java.util.List;
......@@ -31,5 +32,10 @@ public interface IPurchaseMaterialService extends IService<PurchaseMaterial> {
*/
List<PurchaseMaterial> queryMaterialByGoodCode(String goodCode, String departId);
/**
* 药剂入库查询结果:采购物料清单+分销单价+分销总价
* @param departId
* @return
*/
public IPage<PurchaseMaterialVO> queryPurchaseMaterialListByIn(Page<PurchaseMaterialVO> page,String departId);
}
......
package com.skua.modules.erp.service.impl;
import com.skua.core.context.BaseContextHandler;
import com.skua.core.util.DateUtils;
import com.skua.modules.equipment.dto.EquipmentInDTO;
import com.skua.modules.equipment.entity.EquipmentIn;
import com.skua.modules.equipment.entity.EquipmentInChild;
import com.skua.modules.equipment.service.IEquipmentInService;
import com.skua.modules.equipment.vo.EquipmentInExcel;
import com.skua.modules.erp.entity.*;
import com.skua.modules.erp.mapper.ApproveRecordMapper;
import com.skua.modules.erp.mapper.ERPPurchaseContractMapper;
import com.skua.modules.erp.mapper.PurchaseMaterialMapper;
import com.skua.modules.erp.service.IEROPurchaseContractService;
import com.skua.modules.erp.vo.PurchaseContractVO;
import com.skua.modules.erp.vo.PurchaseMaterialVO;
import com.skua.modules.guest.util.DateUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -25,8 +23,6 @@ import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.UUID;
/**
* 采购合同
*/
......@@ -34,7 +30,7 @@ import java.util.UUID;
public class ERPPurchaseContractServiceImpl extends ServiceImpl<ERPPurchaseContractMapper, ERPPurchaseContract> implements IEROPurchaseContractService {
@Resource
private PurchaseMaterialMapper materialMapper;//物料清单
private PurchaseMaterialMapper purchaseMaterialMapper;//物料清单
@Resource
private ApproveRecordMapper recordMapper;
......@@ -42,6 +38,28 @@ public class ERPPurchaseContractServiceImpl extends ServiceImpl<ERPPurchaseContr
@Autowired
private IEquipmentInService equipmentInService;
/***
* 校验方法:校验是否唯一
* @param purchaseContractVO
* @param checkCount 新增= 0 ,修改checkCount=1
* @return 返回有问题的货号
*/
public String checkGoodCode(PurchaseContractVO purchaseContractVO,int checkCount ){
String result = null;
int count = 0;
if( purchaseContractVO.getMaterialList()!= null && !purchaseContractVO.getMaterialList().isEmpty()){
for(PurchaseMaterial purchaseMaterial : purchaseContractVO.getMaterialList()){
count = purchaseMaterialMapper.checkGoodCode(purchaseMaterial.getId(),purchaseMaterial.getGoodCode());
if(count > checkCount ){
result = purchaseMaterial.getGoodCode();
break;
}
}
}
return result;
}
/***
* 新增purchaseContractVO
* @param purchaseContractVO
......@@ -51,27 +69,28 @@ public class ERPPurchaseContractServiceImpl extends ServiceImpl<ERPPurchaseContr
if(count > 0 && purchaseContractVO.getMaterialList() != null && !purchaseContractVO.getMaterialList().isEmpty()){
for(PurchaseMaterial material : purchaseContractVO.getMaterialList()){
material.setContractId( purchaseContractVO.getId() );
materialMapper.insert( material );
purchaseMaterialMapper.insert( material );
}
}
}
/**
* 修改purchaseContractVO
* @param purchaseContractVO
* @return
*/
@Transactional
public boolean updatePurchaseContract(PurchaseContractVO purchaseContractVO){
int count = this.baseMapper.updateById( purchaseContractVO );
// ge根据计划编号删除清单集合
materialMapper.delByContractId(purchaseContractVO.getId() ) ;
purchaseMaterialMapper.delByContractId(purchaseContractVO.getId() ) ;
if(count > 0 && purchaseContractVO.getMaterialList() != null && !purchaseContractVO.getMaterialList().isEmpty()){
for(PurchaseMaterial material : purchaseContractVO.getMaterialList()){
material.setContractId( purchaseContractVO.getId() );
materialMapper.insert( material );
purchaseMaterialMapper.insert( material );
}
}
return count > 0 ? true :false;
......@@ -84,9 +103,8 @@ public class ERPPurchaseContractServiceImpl extends ServiceImpl<ERPPurchaseContr
public void delById(String contractId){
int count = this.baseMapper.deleteById( contractId );
// ge根据计划编号删除清单集合
materialMapper.delByContractId( contractId ) ;
purchaseMaterialMapper.delByContractId( contractId ) ;
}
/***
* 根据id查询purchaseContractVO
* @param contractId
......@@ -98,10 +116,9 @@ public class ERPPurchaseContractServiceImpl extends ServiceImpl<ERPPurchaseContr
if(ERPPurchaseContract != null ){
BeanUtils.copyProperties(ERPPurchaseContract,purchaseContractVO);
List<PurchaseMaterial> materialList = materialMapper.queryListByContractId( contractId );
List<PurchaseMaterial> materialList = purchaseMaterialMapper.queryListByContractId( contractId );
purchaseContractVO.setMaterialList( materialList );
}
return purchaseContractVO;
}
......@@ -111,7 +128,7 @@ public class ERPPurchaseContractServiceImpl extends ServiceImpl<ERPPurchaseContr
* @return
*/
public List<PurchaseMaterial> queryListByContractId(String contractId){
List<PurchaseMaterial> planItemList = materialMapper.queryListByContractId( contractId );
List<PurchaseMaterial> planItemList = purchaseMaterialMapper.queryListByContractId( contractId );
return planItemList;
}
/***
......@@ -133,12 +150,12 @@ public class ERPPurchaseContractServiceImpl extends ServiceImpl<ERPPurchaseContr
this.baseMapper.updateById( purchaseContractVO ) ;
// ge根据计划编号删除清单集合
materialMapper.delByContractId(purchaseContractVO.getId() ) ;
purchaseMaterialMapper.delByContractId(purchaseContractVO.getId() ) ;
if( purchaseContractVO.getMaterialList() != null && !purchaseContractVO.getMaterialList().isEmpty()){
for(PurchaseMaterial material : purchaseContractVO.getMaterialList()){
material.setContractId( purchaseContractVO.getId() );
materialMapper.insert( material );
purchaseMaterialMapper.insert( material );
}
}
//审批记录
......@@ -154,8 +171,6 @@ public class ERPPurchaseContractServiceImpl extends ServiceImpl<ERPPurchaseContr
}
}
}
/***
* 同步入库
* @param purchaseContractVO
......@@ -198,4 +213,6 @@ public class ERPPurchaseContractServiceImpl extends ServiceImpl<ERPPurchaseContr
return 1;
}
}
......
package com.skua.modules.erp.service.impl;
import com.skua.modules.erp.entity.MaterialAcceptanceForm;
import com.skua.modules.erp.mapper.MaterialAcceptanceFormMapper;
import com.skua.modules.erp.service.IMaterialAcceptanceFormService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* 物料验收单
*/
@Service
public class MaterialAcceptanceFormServiceImpl extends ServiceImpl<MaterialAcceptanceFormMapper, MaterialAcceptanceForm> implements IMaterialAcceptanceFormService {
}
package com.skua.modules.erp.service.impl;
import com.skua.modules.erp.entity.Warehousing;
import com.skua.modules.erp.mapper.WarehousingMapper;
import com.skua.modules.erp.service.IWarehousingService;
import com.skua.modules.erp.entity.MaterialIN;
import com.skua.modules.erp.mapper.MaterialINMapper;
import com.skua.modules.erp.service.IMaterialINService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* 采购入库
* 物料(药剂)入库
*/
@Service
public class WarehousingServiceImpl extends ServiceImpl<WarehousingMapper, Warehousing> implements IWarehousingService {
public class MaterialINServiceImpl extends ServiceImpl<MaterialINMapper, MaterialIN> implements IMaterialINService {
}
......
......@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.skua.modules.erp.entity.PurchaseMaterial;
import com.skua.modules.erp.mapper.PurchaseMaterialMapper;
import com.skua.modules.erp.service.IPurchaseMaterialService;
import com.skua.modules.erp.vo.PurchaseMaterialVO;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
......@@ -36,6 +37,13 @@ public class PurchaseMaterialServiceImpl extends ServiceImpl<PurchaseMaterialMap
public List<PurchaseMaterial> queryMaterialByGoodCode(String goodCode, String departId){
return this.baseMapper.queryByList(goodCode,departId);
}
/**
* 药剂入库查询结果:采购物料清单+分销单价+分销总价
* @param departId
* @return
*/
public IPage<PurchaseMaterialVO> queryPurchaseMaterialListByIn(Page<PurchaseMaterialVO> page,String departId){
return this.baseMapper.queryPurchaseMaterialListByIn(page ,departId ) ;
}
}
......
package com.skua.modules.erp.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="PurchaseMaterialVO采购物料清单查询对象", description="PurchaseMaterialVO采购物料清单查询对象")
public class PurchaseMaterialVO {
/**主键*/
@ApiModelProperty(value = "主键")
private java.lang.String id;
/**采购计划编号*/
@Excel(name = "采购合同编号", width = 15)
@ApiModelProperty(value = "采购合同编号")
private java.lang.String contractId;
/**物料类别编号*/
@Excel(name = "物料类别编号", width = 15)
@ApiModelProperty(value = "物料类别编号")
private java.lang.String sparepartType;
/**物料编号*/
@Excel(name = "物料编号", width = 15)
@ApiModelProperty(value = "物料编号")
private java.lang.String sparepartId;
/**物料编号*/
@Excel(name = "货号", width = 15)
@ApiModelProperty(value = "货号")
private java.lang.String goodCode;
/**供应商id*/
@Excel(name = "供应商id", width = 15)
@ApiModelProperty(value = "供应商id")
private java.lang.String supplierId;
/**规格型号*/
@Excel(name = "规格型号", width = 15)
@ApiModelProperty(value = "规格型号")
private java.lang.String specification;
/**计量单位*/
@Excel(name = "计量单位", width = 15)
@ApiModelProperty(value = "计量单位")
private java.lang.String measuringUnit;
/**计划采购数量*/
@Excel(name = "计划采购数量", width = 15)
@ApiModelProperty(value = "计划采购数量")
private java.lang.String purchaseNum;
/**单价*/
@Excel(name = "单价", width = 15)
@ApiModelProperty(value = "单价")
private java.lang.String unitPrice;
@Excel(name = "总价", width = 15)
@ApiModelProperty(value = "总价")
private String totalPrice;
@Excel(name = "物料数量", width = 15)
@ApiModelProperty(value = "物料数量")
private String materialNum;
/**单价*/
@Excel(name = "分销单价", width = 15)
@ApiModelProperty(value = "分销单价")
private String distributPrice;
/**总价*/
@Excel(name = "分销总价", width = 15)
@ApiModelProperty(value = "分销总价")
private String distributTotalPrice;
/**备注*/
@Excel(name = "备注", width = 15)
@ApiModelProperty(value = "备注")
private java.lang.String remarks;
@TableField(exist=false)
@ApiModelProperty(value = "物料类别名称")
private String sparepartCode;
@TableField(exist=false)
@ApiModelProperty(value = "物料类别名称")
private String sparepartTypeName;
@TableField(exist=false)
@ApiModelProperty(value = "物料名称")
private String sparepartName;
@TableField(exist=false)
@ApiModelProperty(value = "供应商名称")
private String supplierName;
@TableField(exist=false)
@ApiModelProperty(value = "厂站名称")
private String departName;
}
......@@ -5,6 +5,8 @@ import java.util.List;
import com.skua.core.api.vo.Result;
import com.skua.core.aspect.annotation.AutoLog;
import com.skua.core.context.BaseContextHandler;
import com.skua.modules.equipment.entity.EquipmentInfo;
import com.skua.modules.equipment.service.IEquipmentInfoService;
import com.skua.modules.guest.util.DateUtil;
import com.skua.modules.safe.entity.*;
import com.skua.modules.safe.mapper.DangerInspectionItemMapper;
......@@ -43,6 +45,8 @@ public class APPDangerInspectionController {
@Autowired
private IDangerInspectionItemService inspectionItemService ;//巡检对象,检查项
@Autowired
private IEquipmentInfoService equipmentInfoService;
/**
* <pre>
* 扫描二维码进入:风险点详情
......@@ -61,6 +65,10 @@ public class APPDangerInspectionController {
DangerLevelManageVO dangerLevelManageVO = new DangerLevelManageVO();// dangerInspection ;
BeanUtils.copyProperties(dangerInspection , dangerLevelManageVO);
if(dangerInspection.getEquipInfoId() != null && dangerInspection.getEquipInfoId().length()> 0){
EquipmentInfo equipmentInfo = equipmentInfoService.getById(dangerInspection.getEquipInfoId());
dangerLevelManageVO.setEquipmentName(equipmentInfo.getEquipmentName() );
}
//查询:上次巡检时间(查询还有未完成的巡检记录)
DangerInspectionRecord inspectionRecord = inspectionRecordService.queryOneByDangerId( id,"1" ,BaseContextHandler.getUserId());//根据分线点编号,获取巡检最后一条记录
if(inspectionRecord == null ){//查询完成的数据
......
......@@ -59,6 +59,14 @@ public class APPDangerInspectionRecordController {
Result<IPage<DangerInspectionRecord>> result = new Result<IPage<DangerInspectionRecord>>();
QueryWrapper<DangerInspectionRecord> queryWrapper = new QueryWrapper<DangerInspectionRecord>();// QueryGenerator.initQueryWrapper(dangerInspectionRecord, req.getParameterMap());
Page<DangerInspectionRecord> page = new Page<DangerInspectionRecord>(pageNo, pageSize);
if(dangerInspectionRecord.getDepartId() != null && dangerInspectionRecord.getDepartId().length() > 0 ){
queryWrapper.eq("depart_id", dangerInspectionRecord.getDepartId());
}
if(dangerInspectionRecord.getEquipInfoId() != null && dangerInspectionRecord.getEquipInfoId().length() > 0 ){
queryWrapper.eq("equip_info_id", dangerInspectionRecord.getEquipInfoId());
}
if(dangerInspectionRecord.getDangerId() != null && dangerInspectionRecord.getDangerId().length() > 0 ){
queryWrapper.eq("danger_id", dangerInspectionRecord.getDangerId());
}
......
......@@ -45,6 +45,10 @@ public class DangerInspectionRecord {
@ApiModelProperty(value = "风险等级名称")
private String dangerName;
@Excel(name = "关联设备", width = 15)
@ApiModelProperty(value = "关联设备")
@Dict(dicCode = "id",dicText = "equipment_name",dictTable = "equipment_info")
private String equipInfoId;
/**风险点类型*/
@Excel(name = "风险点类型", width = 15)
@ApiModelProperty(value = "风险点类型")
......
......@@ -75,6 +75,7 @@ public class DangerInspectionRecordServiceImpl extends ServiceImpl<DangerInspect
dangerInspectionRecord.setDangerName(dangerLevelManage.getDangerName() );//风险等级名称
dangerInspectionRecord.setDangerType( dangerLevelManage.getDangerType() );//风险类型
dangerInspectionRecord.setDangerId( dangerId );
dangerInspectionRecord.setEquipInfoId( dangerLevelManage.getEquipInfoId());
dangerInspectionRecord.setStatus( status);
dangerInspectionRecord.setReportUser( userId );
dangerInspectionRecord.setReportDate(DateUtil.formatDate(new Date(),"yyyy-MM-dd HH:mm:ss"));
......
......@@ -2,6 +2,7 @@ package com.skua.modules.safe.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.skua.core.aspect.annotation.Dict;
import com.skua.modules.safe.entity.DangerInspectionInfo;
import com.skua.modules.safe.entity.DangerInspectionRecord;
import io.swagger.annotations.ApiModel;
......@@ -22,11 +23,19 @@ import java.util.List;
@ApiModel(value="DangerInspectionRecord隐患风险查询对象", description="检查内容对象")
public class DangerInspectionRecordVO {
@ApiModelProperty(value = "所属厂站")
private String departId;
/**风险等级编号*/
@Excel(name = "风险等级编号", width = 15)
@ApiModelProperty(value = "风险等级编号")
private String dangerId;
@Excel(name = "关联设备", width = 15)
@ApiModelProperty(value = "关联设备")
private String equipInfoId;
@ApiModelProperty(value = "巡检记录编号")
private String inspectionRecord;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!