供应商新增营业执照附件上传,新购流程开发
This commit is contained in:
parent
c16a47c957
commit
bb4d2ebf80
|
|
@ -4,65 +4,49 @@ import java.util.List;
|
||||||
import com.bonus.material.basic.domain.BmFileInfo;
|
import com.bonus.material.basic.domain.BmFileInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 附件
|
* 附件Mapper接口
|
||||||
Mapper接口
|
|
||||||
*
|
|
||||||
* @author xsheng
|
* @author xsheng
|
||||||
* @date 2024-09-26
|
|
||||||
*/
|
*/
|
||||||
public interface BmFileInfoMapper
|
public interface BmFileInfoMapper {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 查询附件
|
* 查询附件
|
||||||
|
|
||||||
*
|
*
|
||||||
* @param id 附件
|
* @param id 附件主键
|
||||||
主键
|
|
||||||
* @return 附件
|
* @return 附件
|
||||||
|
|
||||||
*/
|
*/
|
||||||
public BmFileInfo selectBmFileInfoById(Long id);
|
BmFileInfo selectBmFileInfoById(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询附件
|
* 查询附件列表
|
||||||
列表
|
|
||||||
*
|
*
|
||||||
* @param bmFileInfo 附件
|
* @param bmFileInfo 附件
|
||||||
|
* @return 附件集合
|
||||||
* @return 附件
|
|
||||||
集合
|
|
||||||
*/
|
*/
|
||||||
public List<BmFileInfo> selectBmFileInfoList(BmFileInfo bmFileInfo);
|
List<BmFileInfo> selectBmFileInfoList(BmFileInfo bmFileInfo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增附件
|
* 新增附件
|
||||||
|
|
||||||
*
|
*
|
||||||
* @param bmFileInfo 附件
|
* @param bmFileInfo 附件
|
||||||
|
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertBmFileInfo(BmFileInfo bmFileInfo);
|
int insertBmFileInfo(BmFileInfo bmFileInfo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改附件
|
* 修改附件
|
||||||
|
|
||||||
*
|
*
|
||||||
* @param bmFileInfo 附件
|
* @param bmFileInfo 附件
|
||||||
|
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateBmFileInfo(BmFileInfo bmFileInfo);
|
int updateBmFileInfo(BmFileInfo bmFileInfo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除附件
|
* 删除附件
|
||||||
|
|
||||||
*
|
*
|
||||||
* @param id 附件
|
* @param id 附件主键
|
||||||
主键
|
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteBmFileInfoById(Long id);
|
int deleteBmFileInfoById(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除附件
|
* 批量删除附件
|
||||||
|
|
@ -71,5 +55,5 @@ public interface BmFileInfoMapper
|
||||||
* @param ids 需要删除的数据主键集合
|
* @param ids 需要删除的数据主键集合
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteBmFileInfoByIds(Long[] ids);
|
int deleteBmFileInfoByIds(Long[] ids);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ public class SupplierInfoController extends BaseController {
|
||||||
@SysLog(title = "物资厂家管理", businessType = OperaType.INSERT, module = "物资管理->新增物资厂家管理")
|
@SysLog(title = "物资厂家管理", businessType = OperaType.INSERT, module = "物资管理->新增物资厂家管理")
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody SupplierInfo supplierInfo) {
|
public AjaxResult add(@RequestBody SupplierInfo supplierInfo) {
|
||||||
return toAjax(supplierInfoService.insertSupplierInfo(supplierInfo));
|
return supplierInfoService.insertSupplierInfo(supplierInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,15 @@
|
||||||
package com.bonus.material.ma.domain;
|
package com.bonus.material.ma.domain;
|
||||||
|
|
||||||
import com.bonus.common.core.annotation.Excel;
|
import com.bonus.common.core.annotation.Excel;
|
||||||
|
import com.bonus.system.api.domain.SysFile;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import com.bonus.common.core.web.domain.BaseEntity;
|
import com.bonus.common.core.web.domain.BaseEntity;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 物资厂家管理对象 ma_supplier_info
|
* 物资厂家管理对象 ma_supplier_info
|
||||||
|
|
@ -54,8 +58,8 @@ public class SupplierInfo extends BaseEntity {
|
||||||
private String businessScope;
|
private String businessScope;
|
||||||
|
|
||||||
/** 营业执照 */
|
/** 营业执照 */
|
||||||
@Excel(name = "营业执照")
|
@Excel(name = "营业执照URL")
|
||||||
@ApiModelProperty(value = "营业执照")
|
@ApiModelProperty(value = "营业执照URL")
|
||||||
private String businessLicense;
|
private String businessLicense;
|
||||||
|
|
||||||
/** 删除标志(0代表存在 2代表删除) */
|
/** 删除标志(0代表存在 2代表删除) */
|
||||||
|
|
@ -71,5 +75,10 @@ public class SupplierInfo extends BaseEntity {
|
||||||
@ApiModelProperty(value = "状态(0开 1关)")
|
@ApiModelProperty(value = "状态(0开 1关)")
|
||||||
private Long status;
|
private Long status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 营业执照文件列表
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "营业执照文件列表")
|
||||||
|
List<SysFile> businessLicenseFileList;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
package com.bonus.material.ma.service;
|
package com.bonus.material.ma.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.material.ma.domain.SupplierInfo;
|
import com.bonus.material.ma.domain.SupplierInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -31,7 +33,7 @@ public interface ISupplierInfoService {
|
||||||
* @param supplierInfo 物资厂家管理
|
* @param supplierInfo 物资厂家管理
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
int insertSupplierInfo(SupplierInfo supplierInfo);
|
AjaxResult insertSupplierInfo(SupplierInfo supplierInfo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改物资厂家管理
|
* 修改物资厂家管理
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,13 @@
|
||||||
package com.bonus.material.ma.service.impl;
|
package com.bonus.material.ma.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
|
|
||||||
import com.bonus.common.core.utils.DateUtils;
|
import com.bonus.common.core.utils.DateUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
|
import com.bonus.material.basic.domain.BmFileInfo;
|
||||||
|
import com.bonus.material.basic.mapper.BmFileInfoMapper;
|
||||||
|
import com.bonus.system.api.RemoteFileService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.bonus.material.ma.mapper.SupplierInfoMapper;
|
import com.bonus.material.ma.mapper.SupplierInfoMapper;
|
||||||
import com.bonus.material.ma.domain.SupplierInfo;
|
import com.bonus.material.ma.domain.SupplierInfo;
|
||||||
|
|
@ -17,9 +22,17 @@ import javax.annotation.Resource;
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class SupplierInfoServiceImpl implements ISupplierInfoService {
|
public class SupplierInfoServiceImpl implements ISupplierInfoService {
|
||||||
|
public static final long MODEL_ID = 16L;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private SupplierInfoMapper supplierInfoMapper;
|
private SupplierInfoMapper supplierInfoMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private RemoteFileService remoteFileService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BmFileInfoMapper bmFileInfoMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询物资厂家管理
|
* 查询物资厂家管理
|
||||||
*
|
*
|
||||||
|
|
@ -49,9 +62,42 @@ public class SupplierInfoServiceImpl implements ISupplierInfoService {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int insertSupplierInfo(SupplierInfo supplierInfo) {
|
public AjaxResult insertSupplierInfo(SupplierInfo supplierInfo) {
|
||||||
supplierInfo.setCreateTime(DateUtils.getNowDate());
|
supplierInfo.setCreateTime(DateUtils.getNowDate());
|
||||||
return supplierInfoMapper.insertSupplierInfo(supplierInfo);
|
int insertedSupplierInfoResult = supplierInfoMapper.insertSupplierInfo(supplierInfo);
|
||||||
|
if (insertedSupplierInfoResult > 0) {
|
||||||
|
AtomicBoolean addFileInfoResult = new AtomicBoolean(false);
|
||||||
|
supplierInfo.getBusinessLicenseFileList().forEach(file -> {
|
||||||
|
BmFileInfo bmFileInfo = new BmFileInfo();
|
||||||
|
if (file.getName() != null) {
|
||||||
|
bmFileInfo.setFileName(file.getName());
|
||||||
|
}
|
||||||
|
bmFileInfo.setFileUrl(file.getUrl());
|
||||||
|
// TODO: 此处需要修改为字典表中定义的Model模块id
|
||||||
|
bmFileInfo.setModelId(MODEL_ID);
|
||||||
|
addFileInfoResult.set(bmFileInfoMapper.insertBmFileInfo(bmFileInfo) > 0);
|
||||||
|
});
|
||||||
|
return addFileInfoResult.get() ? AjaxResult.success("新增任务成功") : AjaxResult.error("新增任务失败,详情表插入0条");
|
||||||
|
} else {
|
||||||
|
return AjaxResult.error("新增任务失败,info表插入0条");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// if (insertedSupplierInfoResult > 0 && ArrayUtil.isNotEmpty(supplierInfo.getFiles())) {
|
||||||
|
// AjaxResult uploadedFilesResult = remoteFileService.uploadFile(supplierInfo.getFiles());
|
||||||
|
// if (uploadedFilesResult.isSuccess()) {
|
||||||
|
// Object uploadFilesResultData = uploadedFilesResult.get("data");
|
||||||
|
// if (uploadFilesResultData != null) {
|
||||||
|
// if (uploadFilesResultData instanceof List) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// return AjaxResult.error("新增任务失败,文件上传失败:" + uploadedFilesResult.get("msg"));
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,14 @@
|
||||||
package com.bonus.material.purchase.controller;
|
package com.bonus.material.purchase.controller;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
import com.bonus.common.log.enums.OperaType;
|
import com.bonus.common.log.enums.OperaType;
|
||||||
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||||
|
import com.bonus.material.purchase.dto.PurchaseCheckDto;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
@ -35,7 +40,7 @@ import com.bonus.common.core.web.page.TableDataInfo;
|
||||||
@RequestMapping("/purchase_check_info")
|
@RequestMapping("/purchase_check_info")
|
||||||
public class PurchaseCheckInfoController extends BaseController {
|
public class PurchaseCheckInfoController extends BaseController {
|
||||||
|
|
||||||
@Autowired
|
@Resource
|
||||||
private IPurchaseCheckInfoService purchaseCheckInfoService;
|
private IPurchaseCheckInfoService purchaseCheckInfoService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -50,19 +55,6 @@ public class PurchaseCheckInfoController extends BaseController {
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 导出新购验收任务列表
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "导出新购验收任务列表")
|
|
||||||
@PreventRepeatSubmit
|
|
||||||
@RequiresPermissions("purchase:info:export")
|
|
||||||
@SysLog(title = "新购验收任务", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出新购验收任务")
|
|
||||||
@PostMapping("/export")
|
|
||||||
public void export(HttpServletResponse response, PurchaseCheckInfo purchaseCheckInfo) {
|
|
||||||
List<PurchaseCheckInfo> list = purchaseCheckInfoService.selectPurchaseCheckInfoList(purchaseCheckInfo);
|
|
||||||
ExcelUtil<PurchaseCheckInfo> util = new ExcelUtil<PurchaseCheckInfo>(PurchaseCheckInfo.class);
|
|
||||||
util.exportExcel(response, list, "新购验收任务数据");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取新购验收任务详细信息
|
* 获取新购验收任务详细信息
|
||||||
|
|
@ -80,11 +72,11 @@ public class PurchaseCheckInfoController extends BaseController {
|
||||||
@ApiOperation(value = "新增新购验收任务")
|
@ApiOperation(value = "新增新购验收任务")
|
||||||
@PreventRepeatSubmit
|
@PreventRepeatSubmit
|
||||||
@RequiresPermissions("purchase:info:add")
|
@RequiresPermissions("purchase:info:add")
|
||||||
@SysLog(title = "新购验收任务", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增新购验收任务")
|
@SysLog(title = "新购验收任务", businessType = OperaType.INSERT, module = "仓储管理->新增新购验收任务")
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody PurchaseCheckInfo purchaseCheckInfo) {
|
public AjaxResult add(@Valid @NotNull @RequestBody PurchaseCheckDto purchaseCheckDto) {
|
||||||
try {
|
try {
|
||||||
return toAjax(purchaseCheckInfoService.insertPurchaseCheckInfo(purchaseCheckInfo));
|
return purchaseCheckInfoService.insertPurchaseCheckInfo(purchaseCheckDto);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return error("系统错误, " + e.getMessage());
|
return error("系统错误, " + e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
@ -96,7 +88,7 @@ public class PurchaseCheckInfoController extends BaseController {
|
||||||
@ApiOperation(value = "修改新购验收任务")
|
@ApiOperation(value = "修改新购验收任务")
|
||||||
@PreventRepeatSubmit
|
@PreventRepeatSubmit
|
||||||
@RequiresPermissions("purchase:info:edit")
|
@RequiresPermissions("purchase:info:edit")
|
||||||
@SysLog(title = "新购验收任务", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改新购验收任务")
|
@SysLog(title = "新购验收任务", businessType = OperaType.UPDATE, module = "仓储管理->修改新购验收任务")
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@RequestBody PurchaseCheckInfo purchaseCheckInfo) {
|
public AjaxResult edit(@RequestBody PurchaseCheckInfo purchaseCheckInfo) {
|
||||||
try {
|
try {
|
||||||
|
|
@ -112,9 +104,25 @@ public class PurchaseCheckInfoController extends BaseController {
|
||||||
@ApiOperation(value = "删除新购验收任务")
|
@ApiOperation(value = "删除新购验收任务")
|
||||||
@PreventRepeatSubmit
|
@PreventRepeatSubmit
|
||||||
@RequiresPermissions("purchase:info:remove")
|
@RequiresPermissions("purchase:info:remove")
|
||||||
@SysLog(title = "新购验收任务", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除新购验收任务")
|
@SysLog(title = "新购验收任务", businessType = OperaType.DELETE, module = "仓储管理->删除新购验收任务")
|
||||||
@DeleteMapping("/{ids}")
|
@DeleteMapping("/{ids}")
|
||||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||||
return toAjax(purchaseCheckInfoService.deletePurchaseCheckInfoByIds(ids));
|
return toAjax(purchaseCheckInfoService.deletePurchaseCheckInfoByIds(ids));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出新购验收任务列表
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "导出新购验收任务列表")
|
||||||
|
@PreventRepeatSubmit
|
||||||
|
@RequiresPermissions("purchase:info:export")
|
||||||
|
@SysLog(title = "新购验收任务", businessType = OperaType.EXPORT, module = "仓储管理->导出新购验收任务")
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, PurchaseCheckInfo purchaseCheckInfo) {
|
||||||
|
List<PurchaseCheckInfo> list = purchaseCheckInfoService.selectPurchaseCheckInfoList(purchaseCheckInfo);
|
||||||
|
ExcelUtil<PurchaseCheckInfo> util = new ExcelUtil<PurchaseCheckInfo>(PurchaseCheckInfo.class);
|
||||||
|
util.exportExcel(response, list, "新购验收任务数据");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,20 +6,19 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.bonus.common.core.annotation.Excel;
|
import com.bonus.common.core.annotation.Excel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import com.bonus.common.core.web.domain.BaseEntity;
|
import com.bonus.common.core.web.domain.BaseEntity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新购验收任务详细对象 purchase_check_details
|
* 新购验收任务详细对象 purchase_check_details
|
||||||
*
|
|
||||||
* @author xsheng
|
* @author xsheng
|
||||||
* @date 2024-10-16
|
|
||||||
*/
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@ToString
|
@ToString
|
||||||
public class PurchaseCheckDetails extends BaseEntity {
|
public class PurchaseCheckDetails extends BaseEntity {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/** 主键id */
|
/** 主键id */
|
||||||
|
|
@ -35,6 +34,12 @@ public class PurchaseCheckDetails extends BaseEntity {
|
||||||
@ApiModelProperty(value = "规格id")
|
@ApiModelProperty(value = "规格id")
|
||||||
private Long typeId;
|
private Long typeId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "规格名称")
|
||||||
|
private String typeName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "物资名称--规格parent类型")
|
||||||
|
private String maTypeName;
|
||||||
|
|
||||||
/** 采购单价 */
|
/** 采购单价 */
|
||||||
@Excel(name = "采购单价")
|
@Excel(name = "采购单价")
|
||||||
@ApiModelProperty(value = "采购单价")
|
@ApiModelProperty(value = "采购单价")
|
||||||
|
|
@ -60,11 +65,15 @@ public class PurchaseCheckDetails extends BaseEntity {
|
||||||
@ApiModelProperty(value = "验收结论")
|
@ApiModelProperty(value = "验收结论")
|
||||||
private String checkResult;
|
private String checkResult;
|
||||||
|
|
||||||
/** 供应商id */
|
/** 物资厂家id */
|
||||||
@Excel(name = "供应商id")
|
@Excel(name = "物资厂家id")
|
||||||
@ApiModelProperty(value = "供应商id")
|
@ApiModelProperty(value = "物资厂家id")
|
||||||
private Long supplierId;
|
private Long supplierId;
|
||||||
|
|
||||||
|
/** 物资厂家名称 */
|
||||||
|
@ApiModelProperty(value = "物资厂家名称")
|
||||||
|
private String supplierName;
|
||||||
|
|
||||||
/** 0-未验收,1-已验收,2-待通知,3-验收不通过,4-已入库,5-入库驳回,6-综合服务中心审核通过,7-综合服务中心不通过 */
|
/** 0-未验收,1-已验收,2-待通知,3-验收不通过,4-已入库,5-入库驳回,6-综合服务中心审核通过,7-综合服务中心不通过 */
|
||||||
@Excel(name = "0-未验收,1-已验收,2-待通知,3-验收不通过,4-已入库,5-入库驳回,6-综合服务中心审核通过,7-综合服务中心不通过")
|
@Excel(name = "0-未验收,1-已验收,2-待通知,3-验收不通过,4-已入库,5-入库驳回,6-综合服务中心审核通过,7-综合服务中心不通过")
|
||||||
@ApiModelProperty(value = "0-未验收,1-已验收,2-待通知,3-验收不通过,4-已入库,5-入库驳回,6-综合服务中心审核通过,7-综合服务中心不通过")
|
@ApiModelProperty(value = "0-未验收,1-已验收,2-待通知,3-验收不通过,4-已入库,5-入库驳回,6-综合服务中心审核通过,7-综合服务中心不通过")
|
||||||
|
|
|
||||||
|
|
@ -5,17 +5,15 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.bonus.common.core.annotation.Excel;
|
import com.bonus.common.core.annotation.Excel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import com.bonus.common.core.web.domain.BaseEntity;
|
import com.bonus.common.core.web.domain.BaseEntity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新购验收任务对象 purchase_check_info
|
* 新购验收任务对象 purchase_check_info
|
||||||
*
|
* @author syruan
|
||||||
* @author xsheng
|
|
||||||
* @date 2024-10-16
|
|
||||||
*/
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@ToString
|
@ToString
|
||||||
public class PurchaseCheckInfo extends BaseEntity {
|
public class PurchaseCheckInfo extends BaseEntity {
|
||||||
|
|
@ -29,6 +27,9 @@ public class PurchaseCheckInfo extends BaseEntity {
|
||||||
@ApiModelProperty(value = "任务ID")
|
@ApiModelProperty(value = "任务ID")
|
||||||
private Long taskId;
|
private Long taskId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "任务状态")
|
||||||
|
private String taskStatus;
|
||||||
|
|
||||||
/** 采购日期 */
|
/** 采购日期 */
|
||||||
@ApiModelProperty(value = "采购日期")
|
@ApiModelProperty(value = "采购日期")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
|
@ -51,5 +52,16 @@ public class PurchaseCheckInfo extends BaseEntity {
|
||||||
@ApiModelProperty(value = "数据所属组织")
|
@ApiModelProperty(value = "数据所属组织")
|
||||||
private Long companyId;
|
private Long companyId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 采购物资
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "采购物资--外层Table字段")
|
||||||
|
private String purchaseMaTypeName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 采购数量
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "采购数量--外层Table字段")
|
||||||
|
private String purchaseMaNumber;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
package com.bonus.material.purchase.dto;
|
||||||
|
|
||||||
|
import com.bonus.material.purchase.domain.PurchaseCheckDetails;
|
||||||
|
import com.bonus.material.purchase.domain.PurchaseCheckInfo;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author : 阮世耀
|
||||||
|
* @version : 1.0
|
||||||
|
* @PackagePath: com.bonus.material.purchase
|
||||||
|
* @CreateTime: 2024-10-18 09:52
|
||||||
|
* @Description: 新购任务新增-请求参数封装DTO
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PurchaseCheckDto {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 采购验收任务info
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "采购验收任务info")
|
||||||
|
@NotNull(message = "采购验收任务info对象不能为空")
|
||||||
|
private PurchaseCheckInfo purchaseCheckInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 采购验收任务详情集合
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "采购验收任务详情集合")
|
||||||
|
private List<PurchaseCheckDetails> purchaseCheckDetailsList;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -2,6 +2,7 @@ package com.bonus.material.purchase.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.bonus.material.purchase.domain.PurchaseCheckDetails;
|
import com.bonus.material.purchase.domain.PurchaseCheckDetails;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新购验收任务详细Mapper接口
|
* 新购验收任务详细Mapper接口
|
||||||
|
|
@ -10,6 +11,16 @@ import com.bonus.material.purchase.domain.PurchaseCheckDetails;
|
||||||
* @date 2024-10-16
|
* @date 2024-10-16
|
||||||
*/
|
*/
|
||||||
public interface PurchaseCheckDetailsMapper {
|
public interface PurchaseCheckDetailsMapper {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据任务id查询物资类型名称,1-验收,2-入库
|
||||||
|
*
|
||||||
|
* @param taskId * @param type 1-验收,2-入库
|
||||||
|
* @return String类型,多个物资类型根据逗号分割
|
||||||
|
*/
|
||||||
|
String selectMaTypeNameByTaskId(@Param("taskId") Long taskId, @Param("type") String type);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询新购验收任务详细
|
* 查询新购验收任务详细
|
||||||
*
|
*
|
||||||
|
|
@ -24,7 +35,7 @@ public interface PurchaseCheckDetailsMapper {
|
||||||
* @param purchaseCheckDetails 新购验收任务详细
|
* @param purchaseCheckDetails 新购验收任务详细
|
||||||
* @return 新购验收任务详细集合
|
* @return 新购验收任务详细集合
|
||||||
*/
|
*/
|
||||||
public List<PurchaseCheckDetails> selectPurchaseCheckDetailsList(PurchaseCheckDetails purchaseCheckDetails);
|
List<PurchaseCheckDetails> selectPurchaseCheckDetailsList(PurchaseCheckDetails purchaseCheckDetails);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增新购验收任务详细
|
* 新增新购验收任务详细
|
||||||
|
|
@ -32,7 +43,13 @@ public interface PurchaseCheckDetailsMapper {
|
||||||
* @param purchaseCheckDetails 新购验收任务详细
|
* @param purchaseCheckDetails 新购验收任务详细
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertPurchaseCheckDetails(PurchaseCheckDetails purchaseCheckDetails);
|
int insertPurchaseCheckDetails(PurchaseCheckDetails purchaseCheckDetails);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量新增新购验收任务详细
|
||||||
|
* @param purchaseCheckDetailsList 新购验收任务详细集合
|
||||||
|
*/
|
||||||
|
int insertPurchaseCheckDetailsList(List<PurchaseCheckDetails> purchaseCheckDetailsList);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改新购验收任务详细
|
* 修改新购验收任务详细
|
||||||
|
|
@ -40,7 +57,7 @@ public interface PurchaseCheckDetailsMapper {
|
||||||
* @param purchaseCheckDetails 新购验收任务详细
|
* @param purchaseCheckDetails 新购验收任务详细
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updatePurchaseCheckDetails(PurchaseCheckDetails purchaseCheckDetails);
|
int updatePurchaseCheckDetails(PurchaseCheckDetails purchaseCheckDetails);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除新购验收任务详细
|
* 删除新购验收任务详细
|
||||||
|
|
@ -48,7 +65,7 @@ public interface PurchaseCheckDetailsMapper {
|
||||||
* @param id 新购验收任务详细主键
|
* @param id 新购验收任务详细主键
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deletePurchaseCheckDetailsById(Long id);
|
int deletePurchaseCheckDetailsById(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除新购验收任务详细
|
* 批量删除新购验收任务详细
|
||||||
|
|
@ -56,5 +73,5 @@ public interface PurchaseCheckDetailsMapper {
|
||||||
* @param ids 需要删除的数据主键集合
|
* @param ids 需要删除的数据主键集合
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deletePurchaseCheckDetailsByIds(Long[] ids);
|
int deletePurchaseCheckDetailsByIds(Long[] ids);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,15 +16,24 @@ public interface PurchaseCheckInfoMapper {
|
||||||
* @param id 新购验收任务主键
|
* @param id 新购验收任务主键
|
||||||
* @return 新购验收任务
|
* @return 新购验收任务
|
||||||
*/
|
*/
|
||||||
public PurchaseCheckInfo selectPurchaseCheckInfoById(Long id);
|
PurchaseCheckInfo selectPurchaseCheckInfoById(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询新购验收任务列表
|
* 查询新购验收任务列表--单表基础查询
|
||||||
*
|
*
|
||||||
* @param purchaseCheckInfo 新购验收任务
|
* @param purchaseCheckInfo 新购验收任务
|
||||||
* @return 新购验收任务集合
|
* @return 新购验收任务集合
|
||||||
*/
|
*/
|
||||||
public List<PurchaseCheckInfo> selectPurchaseCheckInfoList(PurchaseCheckInfo purchaseCheckInfo);
|
List<PurchaseCheckInfo> selectPurchaseCheckInfoList(PurchaseCheckInfo purchaseCheckInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询新购验收任务列表--多表关联查询
|
||||||
|
*
|
||||||
|
* @param purchaseCheckInfo 新购验收任务
|
||||||
|
* @return 新购验收任务集合
|
||||||
|
*/
|
||||||
|
List<PurchaseCheckInfo> selectPurchaseCheckInfoJoinList(PurchaseCheckInfo purchaseCheckInfo);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增新购验收任务
|
* 新增新购验收任务
|
||||||
|
|
@ -32,7 +41,7 @@ public interface PurchaseCheckInfoMapper {
|
||||||
* @param purchaseCheckInfo 新购验收任务
|
* @param purchaseCheckInfo 新购验收任务
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertPurchaseCheckInfo(PurchaseCheckInfo purchaseCheckInfo);
|
int insertPurchaseCheckInfo(PurchaseCheckInfo purchaseCheckInfo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改新购验收任务
|
* 修改新购验收任务
|
||||||
|
|
@ -40,7 +49,7 @@ public interface PurchaseCheckInfoMapper {
|
||||||
* @param purchaseCheckInfo 新购验收任务
|
* @param purchaseCheckInfo 新购验收任务
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updatePurchaseCheckInfo(PurchaseCheckInfo purchaseCheckInfo);
|
int updatePurchaseCheckInfo(PurchaseCheckInfo purchaseCheckInfo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除新购验收任务
|
* 删除新购验收任务
|
||||||
|
|
@ -48,7 +57,7 @@ public interface PurchaseCheckInfoMapper {
|
||||||
* @param id 新购验收任务主键
|
* @param id 新购验收任务主键
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deletePurchaseCheckInfoById(Long id);
|
int deletePurchaseCheckInfoById(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除新购验收任务
|
* 批量删除新购验收任务
|
||||||
|
|
@ -56,5 +65,5 @@ public interface PurchaseCheckInfoMapper {
|
||||||
* @param ids 需要删除的数据主键集合
|
* @param ids 需要删除的数据主键集合
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deletePurchaseCheckInfoByIds(Long[] ids);
|
int deletePurchaseCheckInfoByIds(Long[] ids);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,10 @@
|
||||||
package com.bonus.material.purchase.service;
|
package com.bonus.material.purchase.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.material.purchase.domain.PurchaseCheckInfo;
|
import com.bonus.material.purchase.domain.PurchaseCheckInfo;
|
||||||
|
import com.bonus.material.purchase.dto.PurchaseCheckDto;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新购验收任务Service接口
|
* 新购验收任务Service接口
|
||||||
|
|
@ -28,10 +31,10 @@ public interface IPurchaseCheckInfoService {
|
||||||
/**
|
/**
|
||||||
* 新增新购验收任务
|
* 新增新购验收任务
|
||||||
*
|
*
|
||||||
* @param purchaseCheckInfo 新购验收任务
|
* @param purchaseCheckDto 新购验收任务dto
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
int insertPurchaseCheckInfo(PurchaseCheckInfo purchaseCheckInfo);
|
AjaxResult insertPurchaseCheckInfo(PurchaseCheckDto purchaseCheckDto);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改新购验收任务
|
* 修改新购验收任务
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,11 @@ package com.bonus.material.purchase.service.impl;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.bonus.common.core.exception.ServiceException;
|
import com.bonus.common.core.exception.ServiceException;
|
||||||
import com.bonus.common.core.utils.DateUtils;
|
import com.bonus.common.core.utils.DateUtils;
|
||||||
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
|
import com.bonus.material.purchase.dto.PurchaseCheckDto;
|
||||||
|
import com.bonus.material.purchase.mapper.PurchaseCheckDetailsMapper;
|
||||||
|
import com.bonus.material.task.domain.TmTask;
|
||||||
|
import com.bonus.material.task.mapper.TmTaskMapper;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.bonus.material.purchase.mapper.PurchaseCheckInfoMapper;
|
import com.bonus.material.purchase.mapper.PurchaseCheckInfoMapper;
|
||||||
|
|
@ -10,6 +15,7 @@ import com.bonus.material.purchase.domain.PurchaseCheckInfo;
|
||||||
import com.bonus.material.purchase.service.IPurchaseCheckInfoService;
|
import com.bonus.material.purchase.service.IPurchaseCheckInfoService;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新购验收任务Service业务层处理
|
* 新购验收任务Service业务层处理
|
||||||
|
|
@ -22,6 +28,12 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService {
|
||||||
@Resource
|
@Resource
|
||||||
private PurchaseCheckInfoMapper purchaseCheckInfoMapper;
|
private PurchaseCheckInfoMapper purchaseCheckInfoMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private PurchaseCheckDetailsMapper purchaseCheckDetailsMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private TmTaskMapper tmTaskMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询新购验收任务
|
* 查询新购验收任务
|
||||||
*
|
*
|
||||||
|
|
@ -36,12 +48,22 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService {
|
||||||
/**
|
/**
|
||||||
* 查询新购验收任务列表
|
* 查询新购验收任务列表
|
||||||
*
|
*
|
||||||
* @param purchaseCheckInfo 新购验收任务
|
* @param purchaseCheckInfoDto 新购验收任务请求参数
|
||||||
* @return 新购验收任务
|
* @return 新购验收任务
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<PurchaseCheckInfo> selectPurchaseCheckInfoList(PurchaseCheckInfo purchaseCheckInfo) {
|
public List<PurchaseCheckInfo> selectPurchaseCheckInfoList(PurchaseCheckInfo purchaseCheckInfoDto) {
|
||||||
return purchaseCheckInfoMapper.selectPurchaseCheckInfoList(purchaseCheckInfo);
|
// 查询新购info列表
|
||||||
|
List<PurchaseCheckInfo> purchaseCheckInfos = purchaseCheckInfoMapper.selectPurchaseCheckInfoList(purchaseCheckInfoDto);
|
||||||
|
// 过滤info列表中空的对象
|
||||||
|
purchaseCheckInfos.removeIf(purchaseCheckInfo -> purchaseCheckInfo.getTaskId() == null);
|
||||||
|
|
||||||
|
// 查询details表,获取详细的采购物资名称
|
||||||
|
for (PurchaseCheckInfo purchaseCheckInfo : purchaseCheckInfos) {
|
||||||
|
String purchaseMaName = purchaseCheckDetailsMapper.selectMaTypeNameByTaskId(purchaseCheckInfo.getTaskId(), null);
|
||||||
|
purchaseCheckInfo.setPurchaseMaTypeName(purchaseMaName != null ? purchaseMaName : "");
|
||||||
|
}
|
||||||
|
return purchaseCheckInfos;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -51,12 +73,49 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int insertPurchaseCheckInfo(PurchaseCheckInfo purchaseCheckInfo) {
|
public AjaxResult insertPurchaseCheckInfo(PurchaseCheckDto purchaseCheckInfo) {
|
||||||
purchaseCheckInfo.setCreateTime(DateUtils.getNowDate());
|
// 赋值创建时间
|
||||||
|
purchaseCheckInfo.getPurchaseCheckInfo().setCreateTime(DateUtils.getNowDate());
|
||||||
try {
|
try {
|
||||||
return purchaseCheckInfoMapper.insertPurchaseCheckInfo(purchaseCheckInfo);
|
// TODO: 任务类型、XG 待完善,先定义死,后期修改至配置中心
|
||||||
|
|
||||||
|
// 查询新购任务当月最大单号
|
||||||
|
Integer thisMonthMaxOrder = tmTaskMapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth(), 16L);
|
||||||
|
// 查询出的单号值,进行必要性校正
|
||||||
|
if (thisMonthMaxOrder == null || thisMonthMaxOrder == 0) {
|
||||||
|
thisMonthMaxOrder = 1;
|
||||||
|
} else {
|
||||||
|
thisMonthMaxOrder = thisMonthMaxOrder + 1;
|
||||||
|
}
|
||||||
|
// 生成单号
|
||||||
|
String taskCode = "XG" + DateUtils.getCurrentYear() + DateUtils.getCurrentMonth() + String.format("%06d", thisMonthMaxOrder);
|
||||||
|
|
||||||
|
// 先往tm_task任务表中创建任务
|
||||||
|
TmTask tmTask = new TmTask(null, 16L, 55L, taskCode, purchaseCheckInfo.getPurchaseCheckInfo().getCompanyId(), "1", thisMonthMaxOrder + 1);
|
||||||
|
Long taskId = 0L;
|
||||||
|
if (tmTaskMapper.insertTmTask(tmTask) > 0) {
|
||||||
|
taskId = tmTask.getTaskId();
|
||||||
|
} else {
|
||||||
|
return AjaxResult.error("新增任务失败_task表插入0条");
|
||||||
|
}
|
||||||
|
|
||||||
|
// tm_task 插入成功后,再往新购验收info表中插入数据
|
||||||
|
purchaseCheckInfo.getPurchaseCheckInfo().setTaskId(taskId);
|
||||||
|
if (purchaseCheckInfoMapper.insertPurchaseCheckInfo(purchaseCheckInfo.getPurchaseCheckInfo()) > 0) {
|
||||||
|
Long finalTaskId = taskId;
|
||||||
|
purchaseCheckInfo.getPurchaseCheckDetailsList().forEach(
|
||||||
|
details -> {
|
||||||
|
details.setTaskId(finalTaskId);
|
||||||
|
details.setInputStatus("0");
|
||||||
|
});
|
||||||
|
// 批量插入详情数据
|
||||||
|
boolean purchaseCheckDetailsListAddResult = purchaseCheckDetailsMapper.insertPurchaseCheckDetailsList(purchaseCheckInfo.getPurchaseCheckDetailsList()) > 0;
|
||||||
|
return purchaseCheckDetailsListAddResult ? AjaxResult.success("新增任务成功") : AjaxResult.error("新增任务失败,详情表插入0条");
|
||||||
|
} else {
|
||||||
|
return AjaxResult.error("新增任务失败,info表插入0条");
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new ServiceException("错误信息描述");
|
return AjaxResult.error("新增任务失败:" + e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,20 +3,19 @@ package com.bonus.material.task.domain;
|
||||||
import com.bonus.common.core.annotation.Excel;
|
import com.bonus.common.core.annotation.Excel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import com.bonus.common.core.web.domain.BaseEntity;
|
import com.bonus.common.core.web.domain.BaseEntity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 任务对象 tm_task
|
* 任务对象 tm_task
|
||||||
*
|
* @author syruan
|
||||||
* @author xsheng
|
|
||||||
* @date 2024-10-16
|
|
||||||
*/
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@ToString
|
@ToString
|
||||||
public class TmTask extends BaseEntity {
|
public class TmTask extends BaseEntity {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/** 任务ID */
|
/** 任务ID */
|
||||||
|
|
@ -47,5 +46,18 @@ public class TmTask extends BaseEntity {
|
||||||
@ApiModelProperty(value = "0不启用 1启用")
|
@ApiModelProperty(value = "0不启用 1启用")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "任务当月序号 例如:1 插入及查询时请携带任务类型")
|
||||||
|
private Integer monthOrder;
|
||||||
|
|
||||||
|
public TmTask(Long taskId, Long taskType, Long taskStatus, String code, Long companyId, String status, Integer monthOrder) {
|
||||||
|
this.taskId = taskId;
|
||||||
|
this.taskType = taskType;
|
||||||
|
this.taskStatus = taskStatus;
|
||||||
|
this.code = code;
|
||||||
|
this.companyId = companyId;
|
||||||
|
this.status = status;
|
||||||
|
this.monthOrder = monthOrder;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TmTask() {}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.bonus.material.task.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.bonus.material.task.domain.TmTask;
|
import com.bonus.material.task.domain.TmTask;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 任务Mapper接口
|
* 任务Mapper接口
|
||||||
|
|
@ -16,7 +17,15 @@ public interface TmTaskMapper {
|
||||||
* @param taskId 任务主键
|
* @param taskId 任务主键
|
||||||
* @return 任务
|
* @return 任务
|
||||||
*/
|
*/
|
||||||
public TmTask selectTmTaskByTaskId(Long taskId);
|
TmTask selectTmTaskByTaskId(Long taskId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询当年当月最大任务序号,用于生成任务编号 by 分类型查询
|
||||||
|
* @param year 年
|
||||||
|
* @param month 月
|
||||||
|
* @param type 任务类型(字典表中获取,例如新购是:16)
|
||||||
|
*/
|
||||||
|
Integer getMonthMaxOrderByDate(@Param("year") String year, @Param("month") String month, @Param("type") Long type);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询任务列表
|
* 查询任务列表
|
||||||
|
|
@ -24,7 +33,7 @@ public interface TmTaskMapper {
|
||||||
* @param tmTask 任务
|
* @param tmTask 任务
|
||||||
* @return 任务集合
|
* @return 任务集合
|
||||||
*/
|
*/
|
||||||
public List<TmTask> selectTmTaskList(TmTask tmTask);
|
List<TmTask> selectTmTaskList(TmTask tmTask);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增任务
|
* 新增任务
|
||||||
|
|
@ -32,7 +41,7 @@ public interface TmTaskMapper {
|
||||||
* @param tmTask 任务
|
* @param tmTask 任务
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertTmTask(TmTask tmTask);
|
int insertTmTask(TmTask tmTask);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改任务
|
* 修改任务
|
||||||
|
|
@ -40,7 +49,7 @@ public interface TmTaskMapper {
|
||||||
* @param tmTask 任务
|
* @param tmTask 任务
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateTmTask(TmTask tmTask);
|
int updateTmTask(TmTask tmTask);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除任务
|
* 删除任务
|
||||||
|
|
@ -48,7 +57,7 @@ public interface TmTaskMapper {
|
||||||
* @param taskId 任务主键
|
* @param taskId 任务主键
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteTmTaskByTaskId(Long taskId);
|
int deleteTmTaskByTaskId(Long taskId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除任务
|
* 批量删除任务
|
||||||
|
|
@ -56,5 +65,5 @@ public interface TmTaskMapper {
|
||||||
* @param taskIds 需要删除的数据主键集合
|
* @param taskIds 需要删除的数据主键集合
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteTmTaskByTaskIds(Long[] taskIds);
|
int deleteTmTaskByTaskIds(Long[] taskIds);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -157,4 +157,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<select id="selectMaTypeNameByTaskId" resultType="java.lang.String">
|
||||||
|
select
|
||||||
|
GROUP_CONCAT(type_name) typeName
|
||||||
|
from
|
||||||
|
(
|
||||||
|
select
|
||||||
|
distinct pcd.task_id, mt1.type_name
|
||||||
|
from
|
||||||
|
purchase_check_details pcd
|
||||||
|
left join
|
||||||
|
ma_type mt on pcd.type_id = mt.type_id
|
||||||
|
left join
|
||||||
|
ma_type mt1 on mt.parent_id = mt1.type_id
|
||||||
|
where
|
||||||
|
pcd.task_id = #{taskId}
|
||||||
|
) t
|
||||||
|
GROUP BY task_id
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertPurchaseCheckDetailsList">
|
||||||
|
<foreach collection="list" item="item" separator=";">
|
||||||
|
insert into purchase_check_details(task_id,type_id,purchase_price,purchase_num,check_num,bind_num,check_result,supplier_id,status,production_time,create_by,create_time,update_by,update_time,remark,check_url_name,check_url,input_num,input_status,input_time,file_name,file_url,company_id)
|
||||||
|
values(#{item.taskId},#{item.typeId},#{item.purchasePrice},#{item.purchaseNum},#{item.checkNum},#{item.bindNum},#{item.checkResult},#{item.supplierId},#{item.status},#{item.productionTime},#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},#{item.remark},#{item.checkUrlName},#{item.checkUrl},#{item.inputNum},#{item.inputStatus},#{item.inputTime},#{item.fileName},#{item.fileUrl},#{item.companyId})
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
@ -15,6 +15,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<result property="updateTime" column="update_time" />
|
<result property="updateTime" column="update_time" />
|
||||||
<result property="remark" column="remark" />
|
<result property="remark" column="remark" />
|
||||||
<result property="companyId" column="company_id" />
|
<result property="companyId" column="company_id" />
|
||||||
|
<result property="taskStatus" column="task_status" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectPurchaseCheckInfoBaseSQL">
|
<sql id="selectPurchaseCheckInfoBaseSQL">
|
||||||
|
|
@ -28,9 +29,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<sql id="selectPurchaseCheckInfoJoinSQL">
|
<sql id="selectPurchaseCheckInfoJoinSQL">
|
||||||
select
|
select
|
||||||
pci.id, pci.task_id, pci.purchase_time, pci.arrival_time, pci.purchaser, pci.create_by,
|
pci.id, pci.task_id, pci.purchase_time, pci.arrival_time, pci.purchaser, pci.create_by,
|
||||||
pci.create_time, pci.update_by, pci.update_time, pci.remark, pci.company_id
|
pci.create_time, pci.update_by, pci.update_time, pci.remark, pci.company_id,
|
||||||
|
t.task_status, t.task_type
|
||||||
from
|
from
|
||||||
purchase_check_info pci
|
purchase_check_info pci
|
||||||
|
left join tm_task t on t.task_id = pci.task_id
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectPurchaseCheckInfoList" parameterType="com.bonus.material.purchase.domain.PurchaseCheckInfo" resultMap="PurchaseCheckInfoResult">
|
<select id="selectPurchaseCheckInfoList" parameterType="com.bonus.material.purchase.domain.PurchaseCheckInfo" resultMap="PurchaseCheckInfoResult">
|
||||||
|
|
@ -104,4 +107,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<select id="selectPurchaseCheckInfoJoinList" resultMap="PurchaseCheckInfoResult">
|
||||||
|
<include refid="selectPurchaseCheckInfoJoinSQL"/>
|
||||||
|
<where>
|
||||||
|
<if test="taskId != null "> and pci.task_id = #{taskId}</if>
|
||||||
|
<if test="purchaseTime != null "> and pci.purchase_time = #{purchaseTime}</if>
|
||||||
|
<if test="arrivalTime != null "> and pci.arrival_time = #{arrivalTime}</if>
|
||||||
|
<if test="purchaser != null "> and pci.purchaser = #{purchaser}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
@ -15,10 +15,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<result property="remark" column="remark" />
|
<result property="remark" column="remark" />
|
||||||
<result property="companyId" column="company_id" />
|
<result property="companyId" column="company_id" />
|
||||||
<result property="status" column="status" />
|
<result property="status" column="status" />
|
||||||
|
<result property="monthOrder" column="month_order" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectTmTaskVo">
|
<sql id="selectTmTaskVo">
|
||||||
select task_id, task_type, task_status, code, create_by, create_time, update_by, update_time, remark, company_id, status from tm_task
|
select task_id, task_type, task_status, code, create_by, create_time,
|
||||||
|
update_by, update_time, remark, company_id, status , month_order
|
||||||
|
from tm_task
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectTmTaskList" parameterType="com.bonus.material.task.domain.TmTask" resultMap="TmTaskResult">
|
<select id="selectTmTaskList" parameterType="com.bonus.material.task.domain.TmTask" resultMap="TmTaskResult">
|
||||||
|
|
@ -42,14 +45,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
<if test="taskType != null">task_type,</if>
|
<if test="taskType != null">task_type,</if>
|
||||||
<if test="taskStatus != null">task_status,</if>
|
<if test="taskStatus != null">task_status,</if>
|
||||||
<if test="code != null">code,</if>
|
<if test="code != null">`code`,</if>
|
||||||
<if test="createBy != null">create_by,</if>
|
<if test="createBy != null">create_by,</if>
|
||||||
<if test="createTime != null">create_time,</if>
|
<if test="createTime != null">create_time,</if>
|
||||||
<if test="updateBy != null">update_by,</if>
|
<if test="updateBy != null">update_by,</if>
|
||||||
<if test="updateTime != null">update_time,</if>
|
<if test="updateTime != null">update_time,</if>
|
||||||
<if test="remark != null">remark,</if>
|
<if test="remark != null">remark,</if>
|
||||||
<if test="companyId != null">company_id,</if>
|
<if test="companyId != null">company_id,</if>
|
||||||
<if test="status != null">status,</if>
|
<if test="status != null">`status`,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="taskType != null">#{taskType},</if>
|
<if test="taskType != null">#{taskType},</if>
|
||||||
|
|
@ -77,7 +80,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
<if test="remark != null">remark = #{remark},</if>
|
<if test="remark != null">remark = #{remark},</if>
|
||||||
<if test="companyId != null">company_id = #{companyId},</if>
|
<if test="companyId != null">company_id = #{companyId},</if>
|
||||||
<if test="status != null">status = #{status},</if>
|
<if test="status != null">`status` = #{status},</if>
|
||||||
</trim>
|
</trim>
|
||||||
where task_id = #{taskId}
|
where task_id = #{taskId}
|
||||||
</update>
|
</update>
|
||||||
|
|
@ -92,4 +95,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
#{taskId}
|
#{taskId}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<select id="getMonthMaxOrderByDate" resultType="java.lang.Integer">
|
||||||
|
select max(month_order) from tm_task
|
||||||
|
where
|
||||||
|
month(create_time) = #{month} and year(create_time) = #{year}
|
||||||
|
<if test="type != null and type !=''">
|
||||||
|
and task_type = #{type}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue