解决合并冲突

This commit is contained in:
mashuai 2024-10-21 09:53:19 +08:00
commit 1d47b4aea4
54 changed files with 1320 additions and 201 deletions

View File

@ -1,10 +1,14 @@
package com.bonus.common.biz.constant;
/**
* 仓储站点配置项
* 机具站点配置项
*
* @author bonus
*/
public class BmConfigItems {
public static final String LEASE_TASK_AUDIT_ROLE_KEYS = "LeaseTaskAuditRoleKeys";
public static final String BACK_TASK_AUDIT_ROLE_KEYS = "BackTaskAuditRoleKeys";
}

View File

@ -5,20 +5,27 @@ package com.bonus.common.biz.constant;
*
* @author bonus
*/
public class MaterialConstants
{
private MaterialConstants(){}
public class MaterialConstants {
private MaterialConstants() {
}
/**
* UTF-8 字符集
*/
public static final String UTF8 = "UTF-8";
/**
<<<<<<< HEAD
* 领料任务类型
*/
public static final Long LEASE_TASK_TYPE = 2L;
/**
* 退料任务类型
*/
public static final Long BACK_TASK_TYPE = 3L;
/**
* XLS
*/

View File

@ -45,7 +45,7 @@ public class BmUnitController extends BaseController
* 查询往来单位管理列表
*/
@ApiOperation(value = "查询往来单位管理列表")
@RequiresPermissions("basic:unit:list")
//@RequiresPermissions("basic:unit:list")
@GetMapping("/list")
public TableDataInfo list(BmUnit bmUnit)
{

View File

@ -4,65 +4,49 @@ import java.util.List;
import com.bonus.material.basic.domain.BmFileInfo;
/**
* 附件
Mapper接口
*
* 附件Mapper接口
* @author xsheng
* @date 2024-09-26
*/
public interface BmFileInfoMapper
{
public interface BmFileInfoMapper {
/**
* 查询附件
*
* @param id 附件
主键
*
* @param id 附件主键
* @return 附件
*/
public BmFileInfo selectBmFileInfoById(Long id);
BmFileInfo selectBmFileInfoById(Long id);
/**
* 查询附件
列表
*
* 查询附件列表
*
* @param bmFileInfo 附件
* @return 附件
集合
* @return 附件集合
*/
public List<BmFileInfo> selectBmFileInfoList(BmFileInfo bmFileInfo);
List<BmFileInfo> selectBmFileInfoList(BmFileInfo bmFileInfo);
/**
* 新增附件
*
*
* @param bmFileInfo 附件
* @return 结果
*/
public int insertBmFileInfo(BmFileInfo bmFileInfo);
int insertBmFileInfo(BmFileInfo bmFileInfo);
/**
* 修改附件
*
*
* @param bmFileInfo 附件
* @return 结果
*/
public int updateBmFileInfo(BmFileInfo bmFileInfo);
int updateBmFileInfo(BmFileInfo bmFileInfo);
/**
* 删除附件
*
* @param id 附件
主键
*
* @param id 附件主键
* @return 结果
*/
public int deleteBmFileInfoById(Long id);
int deleteBmFileInfoById(Long id);
/**
* 批量删除附件
@ -71,5 +55,5 @@ public interface BmFileInfoMapper
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteBmFileInfoByIds(Long[] ids);
int deleteBmFileInfoByIds(Long[] ids);
}

View File

@ -69,4 +69,6 @@ public interface IBmConfigService
public int deleteBmConfigById(Long id);
public List<String> getLeaseTaskAuditRoleKeys();
public List<String> getBackTaskAuditRoleKeys();
}

View File

@ -131,4 +131,16 @@ public class BmConfigServiceImpl implements IBmConfigService
}
return list;
}
public List<String> getBackTaskAuditRoleKeys() {
List<String> list = new ArrayList();
BmConfig bmConfig = bmConfigMapper.selectBmConfigByItemName(BmConfigItems.BACK_TASK_AUDIT_ROLE_KEYS);
if (Objects.nonNull(bmConfig)) {
String value = getValueWithDefault(bmConfig.getItemValue(), "");
if (StringUtils.isNotEmpty(value)) {
list = Arrays.asList(value.split(","));
}
}
return list;
}
}

View File

@ -98,7 +98,7 @@ public class BmUnitServiceImpl implements IBmUnitService
}
}
} catch (Exception e) {
log.error("远程调用查询失败:", e.getMessage());
log.error("远程服务调用查询失败:", e.getMessage());
}
}

View File

@ -0,0 +1,51 @@
package com.bonus.material.ma;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import javax.validation.constraints.NotNull;
/**
* @author : 阮世耀
* @version : 1.0
* @PackagePath: com.bonus.material.ma
* @CreateTime: 2024-10-16 15:50
* @Description: 物资类型配置请求封装DTO
*/
@Data
@ToString
public class MaTypeConfigDto implements java.io.Serializable {
/**
* 配置id
*/
private Long id;
/**
* 物资类型id
*/
@NotNull(message = "物资类型id不能为空")
private Long typeId;
/**
* 左侧Tree层级用户id
*/
@NotNull(message = "用户id不能为空")
private Long userId;
/**
* 绑定标识 1:绑定 2:解绑
*/
@ApiModelProperty(value = "绑定标识 1:绑定, 2:解绑")
@NotNull(message = "绑定标识不能为空")
private Integer bindFlag;
/**
* 绑定角色类型: 1:库管员2:维修员
*/
@ApiModelProperty(value = "绑定角色类型: 1:库管员2:维修员")
@NotNull(message = "绑定角色类型不能为空")
private Integer bindRoleType;
}

View File

@ -0,0 +1,124 @@
package com.bonus.material.ma.controller;
import com.bonus.common.biz.domain.TreeSelect;
import com.bonus.common.core.web.controller.BaseController;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.common.security.annotation.PreventRepeatSubmit;
import com.bonus.common.security.annotation.RequiresPermissions;
import com.bonus.material.ma.MaTypeConfigDto;
import com.bonus.material.ma.domain.Type;
import com.bonus.material.ma.domain.TypeKeeper;
import com.bonus.material.ma.domain.TypeRepair;
import com.bonus.material.ma.service.ITypeKeeperService;
import com.bonus.material.ma.service.ITypeRepairService;
import com.bonus.material.ma.service.ITypeService;
import com.bonus.material.ma.service.MaTypeConfigService;
import com.bonus.material.ma.vo.MaTypeConfigVo;
import com.google.common.collect.ImmutableList;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.*;
/**
* @author : 阮世耀
* @version : 1.0
* @PackagePath: com.bonus.material.ma.controller
* @CreateTime: 2024-10-16 10:52
* @Description: 物资类型配置API
*/
@Api(tags = "物资类型配置API")
@RestController
@RequestMapping("/ma_type_config")
public class MaTypeConfigController extends BaseController {
@Resource
private MaTypeConfigService maTypeConfigService;
@ApiOperation(value = "配置物资类型绑定信息")
@PreventRepeatSubmit
@RequiresPermissions("ma:typeConfig:edit")
@PostMapping("/updateMaTypeBindInfo")
public AjaxResult updateMaTypeBindInfo(@RequestBody @Valid @NotNull MaTypeConfigDto maTypeConfigDto) {
// -------------------- 数据校验开始 ---------------------
// 1.判断绑定标识是否为空
if (maTypeConfigDto.getBindFlag() == null) {
return error("绑定标识不能为空");
}
// 2.判断绑定角色类型是否为空
if (maTypeConfigDto.getBindRoleType() == null) {
return error("绑定角色类型不能为空");
}
// 3.判断用户id是否为空
if (maTypeConfigDto.getUserId() == null) {
return error("用户id不能为空");
}
// ---------------- 数据校验结束 ---------------------
// 执行业务逻辑
return maTypeConfigService.updateMaTypeBindInfo(maTypeConfigDto);
}
/**
* 查询物资类型配置右侧列表
*/
@ApiOperation(value = "查询物资类型配置右侧列表")
@RequiresPermissions("ma:typeConfig:list")
@GetMapping("/getMaTypeConfigList")
public AjaxResult getMaTypeConfigList(MaTypeConfigDto maTypeConfigDto) {
// 调用service处理业务逻辑
return maTypeConfigService.getMaTypeConfigList(maTypeConfigDto);
}
/**
* 查询物资配置左侧组织人员树-tree
*/
@ApiOperation(value = "查询物资配置左侧组织人员树")
@RequiresPermissions("ma:typeConfig:list")
@GetMapping("/getDeptUserTree")
public AjaxResult getDeptUserTree() {
// ---------- 模拟人员Tree数据 ---------------
// 1.创建一个TreeSelect集合用于外层放组织部门--公司级
List<TreeSelect> treeSelectList1 = new ArrayList<>();
TreeSelect treeSelect1 = new TreeSelect(1L, "机具设备分公司", 1, null);
TreeSelect treeSelect2 = new TreeSelect(2L, "输电分公司", 1, null);
TreeSelect treeSelect3 = new TreeSelect(5L, "变电分公司", 1, null);
// 2. 给公司级部门添加子部门 创建TreeSelect集合存放组织部门--部门级
TreeSelect treeSelect01 = new TreeSelect(11L, "物流库管一班", 2, 1L);
TreeSelect treeSelect02 = new TreeSelect(12L, "物流库管二班", 2, 1L);
TreeSelect treeSelect03 = new TreeSelect(13L, "宏源库管一班", 2, 5L);
// 3. 创建部门人员
TreeSelect treeSelect001 = new TreeSelect(117L, "袁泷", 3, 11L);
TreeSelect treeSelect002 = new TreeSelect(133L, "喵喵喵", 3, 11L);
TreeSelect treeSelect003 = new TreeSelect(129L, "村上春树", 3, 12L);
// 4. 把子部门人员添加到子部门中
treeSelect01.setChildren(Arrays.asList(treeSelect001, treeSelect002));
treeSelect1.setChildren(Arrays.asList(treeSelect01, treeSelect02));
treeSelect03.setChildren(ImmutableList.of(treeSelect003));
treeSelect3.setChildren(Collections.singletonList(treeSelect03));
// 3.把根节点添加到集合中
treeSelectList1.add(treeSelect1);
treeSelectList1.add(treeSelect2);
treeSelectList1.add(treeSelect3);
// -------------- 模拟人员Tree数据结束 ------------------
return success(treeSelectList1);
}
}

View File

@ -82,7 +82,7 @@ public class SupplierInfoController extends BaseController {
@SysLog(title = "物资厂家管理", businessType = OperaType.INSERT, module = "物资管理->新增物资厂家管理")
@PostMapping
public AjaxResult add(@RequestBody SupplierInfo supplierInfo) {
return toAjax(supplierInfoService.insertSupplierInfo(supplierInfo));
return supplierInfoService.insertSupplierInfo(supplierInfo);
}
/**

View File

@ -48,7 +48,7 @@ public class TypeController extends BaseController {
@GetMapping("/list")
public TableDataInfo list(MaTypeListVo type) {
startPage();
List<MaTypeListVo> list = typeService.selectTypeListAndParent(type);
List<MaTypeListVo> list = typeService.selectTypeListAndParentInfo(type);
return getDataTable(list);
}

View File

@ -28,7 +28,7 @@ import com.bonus.common.core.web.page.TableDataInfo;
* 库管员配置Controller
* @author bonus
*/
@Api(tags = "库管员配置接口")
@Api(tags = "库管员配置API")
@RestController
@RequestMapping("/ma_type_keeper")
public class TypeKeeperController extends BaseController {
@ -54,7 +54,7 @@ public class TypeKeeperController extends BaseController {
@ApiOperation(value = "导出库管员配置列表")
@PreventRepeatSubmit
@RequiresPermissions("ma:keeper:export")
@SysLog(title = "库管员配置", businessType = OperaType.EXPORT, module = "仓储管理->导出库管员配置")
@SysLog(title = "库管员配置", businessType = OperaType.EXPORT, module = "物资管理->导出库管员配置")
@PostMapping("/export")
public void export(HttpServletResponse response, TypeKeeper typeKeeper) {
List<TypeKeeper> list = typeKeeperService.selectTypeKeeperList(typeKeeper);
@ -78,7 +78,7 @@ public class TypeKeeperController extends BaseController {
@ApiOperation(value = "新增库管员配置")
@PreventRepeatSubmit
@RequiresPermissions("ma:keeper:add")
@SysLog(title = "库管员配置", businessType = OperaType.INSERT, module = "仓储管理->新增库管员配置")
@SysLog(title = "库管员配置", businessType = OperaType.INSERT, module = "物资管理->新增库管员配置")
@PostMapping
public AjaxResult add(@RequestBody TypeKeeper typeKeeper) {
return toAjax(typeKeeperService.insertTypeKeeper(typeKeeper));
@ -90,22 +90,35 @@ public class TypeKeeperController extends BaseController {
@ApiOperation(value = "修改库管员配置")
@PreventRepeatSubmit
@RequiresPermissions("ma:keeper:edit")
@SysLog(title = "库管员配置", businessType = OperaType.UPDATE, module = "仓储管理->修改库管员配置")
@SysLog(title = "库管员配置", businessType = OperaType.UPDATE, module = "物资管理->修改库管员配置")
@PutMapping
public AjaxResult edit(@RequestBody TypeKeeper typeKeeper) {
return toAjax(typeKeeperService.updateTypeKeeper(typeKeeper));
}
/**
* 删除库管员配置
* 批量删除库管员配置
*/
@ApiOperation(value = "删除库管员配置")
@ApiOperation(value = "批量删除库管员配置")
@PreventRepeatSubmit
@RequiresPermissions("ma:keeper:remove")
@SysLog(title = "库管员配置", businessType = OperaType.DELETE, module = "仓储管理->删除库管员配置")
@SysLog(title = "库管员配置", businessType = OperaType.DELETE, module = "物资管理->批量删除库管员配置")
@DeleteMapping("/{IDs}")
public AjaxResult remove(@PathVariable Long[] IDs)
{
return toAjax(typeKeeperService.deleteTypeKeeperByIDs(IDs));
}
/**
* 删除单个库管员配置
*/
@ApiOperation(value = "删除单个库管员配置")
@PreventRepeatSubmit
@RequiresPermissions("ma:keeper:remove")
@SysLog(title = "库管员配置", businessType = OperaType.DELETE, logType = 1,module = "物资管理->删除单个库管员配置")
@DeleteMapping
public AjaxResult remove(@RequestBody TypeKeeper typeKeeper)
{
return toAjax(typeKeeperService.deleteTypeKeeperByUserIdAndTypeId(typeKeeper));
}
}

View File

@ -104,15 +104,28 @@ public class TypeRepairController extends BaseController
}
/**
* 删除维修班机具配置
* 批量删除维修班机具配置
*/
@ApiOperation(value = "删除维修班机具配置")
@ApiOperation(value = "批量删除维修班机具配置")
@PreventRepeatSubmit
@RequiresPermissions("ma:repair:remove")
@SysLog(title = "维修班机具配置", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除维修班机具配置")
@SysLog(title = "维修班机具配置", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->批量删除维修班机具配置")
@DeleteMapping("/{IDs}")
public AjaxResult remove(@PathVariable Long[] IDs)
{
return toAjax(typeRepairService.deleteTypeRepairByIDs(IDs));
}
/**
* 删除单个维修班机具配置
*/
@ApiOperation(value = "删除单个维修班机具配置")
@PreventRepeatSubmit
@RequiresPermissions("ma:repair:remove")
@SysLog(title = "维修班机具配置", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除单个维修班机具配置")
@DeleteMapping
public AjaxResult remove(@RequestBody TypeRepair typeRepair)
{
return toAjax(typeRepairService.deleteTypeRepairByUserIdAndTypeId(typeRepair));
}
}

View File

@ -1,11 +1,15 @@
package com.bonus.material.ma.domain;
import com.bonus.common.core.annotation.Excel;
import com.bonus.system.api.domain.SysFile;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import com.bonus.common.core.web.domain.BaseEntity;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
/**
* 物资厂家管理对象 ma_supplier_info
@ -54,8 +58,8 @@ public class SupplierInfo extends BaseEntity {
private String businessScope;
/** 营业执照 */
@Excel(name = "营业执照")
@ApiModelProperty(value = "营业执照")
@Excel(name = "营业执照URL")
@ApiModelProperty(value = "营业执照URL")
private String businessLicense;
/** 删除标志0代表存在 2代表删除 */
@ -71,5 +75,10 @@ public class SupplierInfo extends BaseEntity {
@ApiModelProperty(value = "状态(0开 1关)")
private Long status;
/**
* 营业执照文件列表
*/
@ApiModelProperty(value = "营业执照文件列表")
List<SysFile> businessLicenseFileList;
}

View File

@ -33,6 +33,10 @@ public class Type extends BaseEntity {
@ApiModelProperty(value = "类型名称")
private String typeName;
/** 仓库名称 */
@ApiModelProperty(value = "物资仓库名称")
private String houseName;
/** 上级ID */
@Excel(name = "上级ID")
@ApiModelProperty(value = "上级ID")
@ -41,7 +45,15 @@ public class Type extends BaseEntity {
/** 实时库存 */
@Excel(name = "实时库存")
@ApiModelProperty(value = "实时库存")
private Long storageNum;
private Long storageNum = 0L;
/** 是否扣费 */
@ApiModelProperty(value = "是否扣费,0:扣费, 1:不扣费")
private Byte isCharging = 1;
/** 检验周期 */
@ApiModelProperty(value = "检验周期,单位:月")
private Integer testCycle = 0;
/** 类型编号 */
@Excel(name = "类型编号")
@ -58,6 +70,10 @@ public class Type extends BaseEntity {
@ApiModelProperty(value = "计量单位ID")
private Long unitId;
/** 计量单位名称 */
@ApiModelProperty(value = "计量单位名称")
private String unitName;
/** 管理方式(0编号 1计数) */
@Excel(name = "管理方式(0编号 1计数)")
@ApiModelProperty(value = "管理方式(0编号 1计数)")
@ -89,6 +105,14 @@ public class Type extends BaseEntity {
@ApiModelProperty(value = "丢失赔偿比率")
private BigDecimal payRatio;
/** 丢失赔偿价 */
@ApiModelProperty(value = "丢失赔偿价")
private BigDecimal payPrice;
/** 税率 */
@ApiModelProperty(value = "税率")
private BigDecimal taxRatio;
/** 层级 */
@Excel(name = "层级")
@ApiModelProperty(value = "层级")

View File

@ -41,5 +41,10 @@ public class TypeKeeper extends BaseEntity {
@ApiModelProperty(value = "数据所属组织")
private String companyId;
public TypeKeeper(Long typeId, Long userId) {
this.typeId = typeId;
this.userId = userId;
}
public TypeKeeper() {}
}

View File

@ -3,21 +3,20 @@ package com.bonus.material.ma.domain;
import com.bonus.common.core.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import com.bonus.common.core.web.domain.BaseEntity;
/**
* 维修班机具配置对象 ma_type_repair
*
* @author xsheng
* @date 2024-09-27
*
* @author syruan
*/
@EqualsAndHashCode(callSuper = false)
@Data
@ToString
public class TypeRepair extends BaseEntity
{
public class TypeRepair extends BaseEntity {
private static final long serialVersionUID = 1L;
/** ID */
@ -31,10 +30,19 @@ public class TypeRepair extends BaseEntity
@ApiModelProperty(value = "用户")
private Long userId;
@ApiModelProperty(value = "用户姓名")
private String userName;
/** 数据所属组织 */
@Excel(name = "数据所属组织")
@ApiModelProperty(value = "数据所属组织")
private Long companyId;
public TypeRepair() {}
public TypeRepair(Long typeId, Long userId) {
this.typeId = typeId;
this.userId = userId;
}
}

View File

@ -17,6 +17,11 @@ public interface TypeKeeperMapper {
*/
TypeKeeper selectTypeKeeperByID(Long ID);
/**
* 根据用户ID和物资类型ID查询库管员配置
*/
TypeKeeper selectTypeKeeperByUserIdAndTypeId(TypeKeeper typeKeeper);
/**
* 查询库管员配置列表
*
@ -25,6 +30,11 @@ public interface TypeKeeperMapper {
*/
List<TypeKeeper> selectTypeKeeperList(TypeKeeper typeKeeper);
/**
* 查询库管员配置列表-并关联查询用户名称
*/
List<TypeKeeper> selectTypeKeeperListAndUserName(TypeKeeper typeKeeper);
/**
* 新增库管员配置
*
@ -49,6 +59,11 @@ public interface TypeKeeperMapper {
*/
int deleteTypeKeeperByID(Long ID);
/**
* 根据用户ID和物资类型ID删除库管员配置
*/
int deleteTypeKeeperByUserIdAndTypeId(TypeKeeper typeKeeper);
/**
* 批量删除库管员配置
*

View File

@ -2,6 +2,7 @@ package com.bonus.material.ma.mapper;
import java.util.List;
import com.bonus.material.ma.domain.Type;
import com.bonus.material.ma.vo.MaTypeConfigVo;
import com.bonus.material.ma.vo.MaTypeListVo;
import com.bonus.material.ma.vo.MaTypeSelectVo;
import org.apache.ibatis.annotations.Mapper;
@ -66,6 +67,20 @@ public interface TypeMapper {
List<MaTypeListVo> selectTypeListAndParent(Type typeListVo);
/**
* 查询四级物资类型列表 -- 并且查询当前节点的父级节点名称
* @param type
* @return
*/
List<MaTypeConfigVo> selectFourLevelTypeListAndParent(Type type);
/**
* 查询三级物资类型列表 -- 并且查询当前节点的父级节点名称
* @param type
* @return
*/
List<MaTypeConfigVo> selectThreeLevelTypeListAndParent(Type type);
/**
* 新增物资类型
*

View File

@ -9,15 +9,14 @@ import com.bonus.material.ma.domain.TypeRepair;
* @author xsheng
* @date 2024-09-27
*/
public interface TypeRepairMapper
{
public interface TypeRepairMapper {
/**
* 查询维修班机具配置
*
* @param ID 维修班机具配置主键
* @return 维修班机具配置
*/
public TypeRepair selectTypeRepairByID(Long ID);
TypeRepair selectTypeRepairByID(Long ID);
/**
* 查询维修班机具配置列表
@ -25,7 +24,12 @@ public interface TypeRepairMapper
* @param typeRepair 维修班机具配置
* @return 维修班机具配置集合
*/
public List<TypeRepair> selectTypeRepairList(TypeRepair typeRepair);
List<TypeRepair> selectTypeRepairList(TypeRepair typeRepair);
/**
* 查询配置列表并关联查询用户姓名
*/
List<TypeRepair> selectTypeRepairListAndUserName(TypeRepair typeRepair);
/**
* 新增维修班机具配置
@ -33,7 +37,7 @@ public interface TypeRepairMapper
* @param typeRepair 维修班机具配置
* @return 结果
*/
public int insertTypeRepair(TypeRepair typeRepair);
int insertTypeRepair(TypeRepair typeRepair);
/**
* 修改维修班机具配置
@ -41,7 +45,7 @@ public interface TypeRepairMapper
* @param typeRepair 维修班机具配置
* @return 结果
*/
public int updateTypeRepair(TypeRepair typeRepair);
int updateTypeRepair(TypeRepair typeRepair);
/**
* 删除维修班机具配置
@ -49,7 +53,7 @@ public interface TypeRepairMapper
* @param ID 维修班机具配置主键
* @return 结果
*/
public int deleteTypeRepairByID(Long ID);
int deleteTypeRepairByID(Long ID);
/**
* 批量删除维修班机具配置
@ -57,5 +61,12 @@ public interface TypeRepairMapper
* @param IDs 需要删除的数据主键集合
* @return 结果
*/
public int deleteTypeRepairByIDs(Long[] IDs);
int deleteTypeRepairByIDs(Long[] IDs);
/**
* 根据用户id和类型id删除配置记录
* @param typeRepair
* @return
*/
int deleteTypeRepairByUserIdAndTypeId(TypeRepair typeRepair);
}

View File

@ -1,6 +1,8 @@
package com.bonus.material.ma.service;
import java.util.List;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.material.ma.domain.SupplierInfo;
/**
@ -31,7 +33,7 @@ public interface ISupplierInfoService {
* @param supplierInfo 物资厂家管理
* @return 结果
*/
int insertSupplierInfo(SupplierInfo supplierInfo);
AjaxResult insertSupplierInfo(SupplierInfo supplierInfo);
/**
* 修改物资厂家管理

View File

@ -23,6 +23,11 @@ public interface ITypeKeeperService {
*/
List<TypeKeeper> selectTypeKeeperList(TypeKeeper typeKeeper);
/**
* 查询库管员配置列表-并关联查询用户名称
*/
List<TypeKeeper> selectTypeKeeperListAndUserName(TypeKeeper typeKeeper);
/**
* 新增库管员配置
*
@ -54,4 +59,12 @@ public interface ITypeKeeperService {
* @return 结果
*/
int deleteTypeKeeperByID(Long ID);
/**
* 根据用户ID和物资类型ID删除库管员配置信息
*
* @param typeKeeper
* @return
*/
int deleteTypeKeeperByUserIdAndTypeId(TypeKeeper typeKeeper);
}

View File

@ -9,8 +9,7 @@ import com.bonus.material.ma.domain.TypeRepair;
* @author xsheng
* @date 2024-09-27
*/
public interface ITypeRepairService
{
public interface ITypeRepairService {
/**
* 查询维修班机具配置
*
@ -27,6 +26,11 @@ public interface ITypeRepairService
*/
public List<TypeRepair> selectTypeRepairList(TypeRepair typeRepair);
/**
* 查询配置列表并关联查询用户姓名
*/
List<TypeRepair> selectTypeRepairListAndUserName(TypeRepair typeRepair);
/**
* 新增维修班机具配置
*
@ -58,4 +62,9 @@ public interface ITypeRepairService
* @return 结果
*/
public int deleteTypeRepairByID(Long ID);
/**
* 根据用户id和类型id删除配置信息
*/
int deleteTypeRepairByUserIdAndTypeId(TypeRepair typeRepair);
}

View File

@ -4,6 +4,7 @@ import java.util.List;
import com.bonus.common.biz.domain.TreeSelect;
import com.bonus.material.ma.domain.Type;
import com.bonus.material.ma.vo.MaTypeConfigVo;
import com.bonus.material.ma.vo.MaTypeListVo;
import com.bonus.material.ma.vo.MaTypeSelectVo;
@ -40,7 +41,14 @@ public interface ITypeService {
*/
List<Type> selectTypeList(Type type);
List<MaTypeListVo> selectTypeListAndParent(Type type);
List<MaTypeListVo> selectTypeListAndParentInfo(Type type);
/**
* 查询4级加3级的所有物资类型携带父级信息
* @param type 参数
*/
List<MaTypeConfigVo> selectThreeFourLevelTypeListAndParent(Type type);
/**
* 新增物资类型

View File

@ -0,0 +1,18 @@
package com.bonus.material.ma.service;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.material.ma.MaTypeConfigDto;
/**
* @author : 阮世耀
* @version : 1.0
* @PackagePath: com.bonus.material.ma.service
* @CreateTime: 2024-10-16 18:50
* @Description: 物资类型配置Service
*/
public interface MaTypeConfigService{
AjaxResult updateMaTypeBindInfo(MaTypeConfigDto maTypeConfigDto);
AjaxResult getMaTypeConfigList(MaTypeConfigDto maTypeConfigDto);
}

View File

@ -0,0 +1,187 @@
package com.bonus.material.ma.service.impl;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.material.ma.MaTypeConfigDto;
import com.bonus.material.ma.domain.Type;
import com.bonus.material.ma.domain.TypeKeeper;
import com.bonus.material.ma.domain.TypeRepair;
import com.bonus.material.ma.service.ITypeKeeperService;
import com.bonus.material.ma.service.ITypeRepairService;
import com.bonus.material.ma.service.ITypeService;
import com.bonus.material.ma.service.MaTypeConfigService;
import com.bonus.material.ma.vo.MaTypeConfigVo;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
/**
* @author : 阮世耀
* @version : 1.0
* @PackagePath: com.bonus.material.ma.service.impl
* @CreateTime: 2024-10-16 18:50
* @Description: 描述
*/
@Service
public class MaTypeConfigServiceImpl implements MaTypeConfigService {
/**
* 物资类型库管员配置Service
*/
@Resource
private ITypeKeeperService typeKeeperService;
/**
* 物资类型维修员配置Service
*/
@Resource
private ITypeRepairService typeRepairService;
// 物资类型Service
@Resource
private ITypeService typeService;
@Override
public AjaxResult updateMaTypeBindInfo(MaTypeConfigDto maTypeConfigDto) {
int result;
switch (maTypeConfigDto.getBindFlag()) {
case 1:
result = handleBind(maTypeConfigDto.getBindRoleType(), maTypeConfigDto.getTypeId(), maTypeConfigDto.getUserId());
return result == 1 ? AjaxResult.success("绑定成功") : AjaxResult.error("绑定失败");
case 2:
result = handleUnBind(maTypeConfigDto.getBindRoleType(), maTypeConfigDto.getTypeId(), maTypeConfigDto.getUserId());
return result == 1 ? AjaxResult.success("解绑成功") : AjaxResult.error("解绑失败");
default:
// 处理其他情况或抛出异常
return AjaxResult.error("输入值不合法 bindFlag: " + maTypeConfigDto.getBindFlag());
}
}
@Override
public AjaxResult getMaTypeConfigList(MaTypeConfigDto maTypeConfigDto) {
// 1.把所有物资类型查出来
List<MaTypeConfigVo> list = typeService.selectThreeFourLevelTypeListAndParent(new Type());
// 2.把维修配置信息查出来
List<TypeRepair> typeRepairList = typeRepairService.selectTypeRepairListAndUserName(new TypeRepair());
// 3.把库管配置信息查出来
List<TypeKeeper> typeKeeperList = typeKeeperService.selectTypeKeeperListAndUserName(new TypeKeeper());
// ------------------- 开启数据处理 ---------------------
// 4.循环所有物资类型,重型数据集合保障只循环一次减少性能损失
for (MaTypeConfigVo typeConfigVo1 : list) {
// 1.外层 先对比维修班组
for (TypeRepair typeRepair : typeRepairList) {
// 2.判断当前维修配置信息中的物资类型id是否等于当前物资类型配置信息中的物资类型id
if (typeRepair.getTypeId().equals(typeConfigVo1.getTypeId())) {
// 3.如果相等把维修员信息设置到物资类型配置信息中
typeConfigVo1.setRepairUserId(typeRepair.getUserId());
typeConfigVo1.setRepairUserName(typeRepair.getUserName());
break;
}
}
// 1.外层 再对比库管班组
for (TypeKeeper typeKeeper : typeKeeperList) {
// 2.判断当前库管配置信息中的物资类型id是否等于当前物资类型配置信息中的物资类型id
if (typeKeeper.getTypeId().equals(typeConfigVo1.getTypeId())) {
// 3.如果相等把库管员信息设置到物资类型配置信息中
typeConfigVo1.setKeeperUserId(typeKeeper.getUserId());
typeConfigVo1.setKeeperUserName(typeKeeper.getUserName());
}
}
// 5.判断当前物资类型配置信息是否有子节点
if (typeConfigVo1.getChildren() != null) {
// 6.有子节点继续循环子节点判断子节点是否有维修配置信息
for (MaTypeConfigVo typeConfigVo2 : typeConfigVo1.getChildren()) {
// 7.有维修配置信息把维修员信息设置到子节点中
for (TypeRepair typeRepair : typeRepairList) {
if (typeRepair.getTypeId().equals(typeConfigVo2.getTypeId())) {
typeConfigVo2.setRepairUserId(typeRepair.getUserId());
typeConfigVo2.setRepairUserName(typeRepair.getUserName());
}
}
}
// 8.有子节点继续循环子节点
for (MaTypeConfigVo typeConfigVo3 : typeConfigVo1.getChildren()) {
// 9.判断子节点是否有库管配置信息
for (TypeKeeper typeKeeper : typeKeeperList) {
if (typeKeeper.getTypeId().equals(typeConfigVo3.getTypeId())) {
typeConfigVo3.setKeeperUserId(typeKeeper.getUserId());
typeConfigVo3.setKeeperUserName(typeKeeper.getUserName());
}
}
}
}
}
// -------------------- 数据处理结束 ---------------------
// TODO: 先暂时取消后续过滤流程
if (true) {
return AjaxResult.success(list);
}
// ------------------- 数据过滤开始 ---------------------
if (maTypeConfigDto == null || maTypeConfigDto.getUserId() == null || maTypeConfigDto.getUserId() == 0L) {
// 如果参数无效则返回原始列表
return AjaxResult.success(list);
}
List<MaTypeConfigVo> filteredList = new ArrayList<>();
for (MaTypeConfigVo maTypeConfigVo : list) {
if (
maTypeConfigVo.getKeeperUserId().equals(maTypeConfigDto.getUserId()) ||
maTypeConfigVo.getRepairUserId().equals(maTypeConfigDto.getUserId())
)
{
filteredList.add(maTypeConfigVo);
}
}
// ------------------- 数据过滤结束 ---------------------
// 返回前端
return AjaxResult.success(filteredList);
}
private int handleBind(int bindRoleType, Long typeId, Long userId) {
switch (bindRoleType) {
case 1:
// 处理 bindFlag 1:绑定 bindRoleType 1:库管员 的情况
// TODO: 实现具体逻辑
return typeKeeperService.insertTypeKeeper(new TypeKeeper(typeId, userId));
case 2:
// 处理 bindFlag 1:绑定 bindRoleType 2:维修员 的情况
// TODO: 实现具体逻辑
return typeRepairService.insertTypeRepair(new TypeRepair(typeId, userId));
default:
// 处理其他情况或抛出异常
throw new IllegalArgumentException("Unsupported bindRoleType: " + bindRoleType);
}
}
private int handleUnBind(int bindRoleType, Long typeId, Long userId) {
switch (bindRoleType) {
case 1:
// 处理 bindFlag 2:解绑 bindRoleType 1:库管员 的情况
// TODO: 实现具体逻辑
return typeKeeperService.deleteTypeKeeperByUserIdAndTypeId(new TypeKeeper(typeId, userId));
case 2:
// 处理 bindFlag 2:解绑 bindRoleType 2:维修员 的情况
// TODO: 实现具体逻辑
return typeRepairService.deleteTypeRepairByUserIdAndTypeId(new TypeRepair(typeId, userId));
default:
// 处理其他情况或抛出异常
throw new IllegalArgumentException("Unsupported bindRoleType: " + bindRoleType);
}
}
}

View File

@ -1,8 +1,13 @@
package com.bonus.material.ma.service.impl;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
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 com.bonus.material.ma.mapper.SupplierInfoMapper;
import com.bonus.material.ma.domain.SupplierInfo;
@ -17,9 +22,17 @@ import javax.annotation.Resource;
*/
@Service
public class SupplierInfoServiceImpl implements ISupplierInfoService {
public static final long MODEL_ID = 16L;
@Resource
private SupplierInfoMapper supplierInfoMapper;
@Resource
private RemoteFileService remoteFileService;
@Resource
private BmFileInfoMapper bmFileInfoMapper;
/**
* 查询物资厂家管理
*
@ -49,9 +62,45 @@ public class SupplierInfoServiceImpl implements ISupplierInfoService {
* @return 结果
*/
@Override
public int insertSupplierInfo(SupplierInfo supplierInfo) {
public AjaxResult insertSupplierInfo(SupplierInfo supplierInfo) {
supplierInfo.setCreateTime(DateUtils.getNowDate());
return supplierInfoMapper.insertSupplierInfo(supplierInfo);
int insertedSupplierInfoResult = supplierInfoMapper.insertSupplierInfo(supplierInfo);
if (insertedSupplierInfoResult > 0) {
if (supplierInfo.getBusinessLicenseFileList() == null) {
return AjaxResult.success("新增任务成功,无营业执照附件");
}
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"));
// }
// }
}
/**

View File

@ -11,8 +11,7 @@ import com.bonus.material.ma.service.ITypeKeeperService;
/**
* 库管员配置Service业务层处理
*
* @author xsheng
* @date 2024-09-27
* @author syruan
*/
@Service
public class TypeKeeperServiceImpl implements ITypeKeeperService {
@ -42,6 +41,16 @@ public class TypeKeeperServiceImpl implements ITypeKeeperService {
return typeKeeperMapper.selectTypeKeeperList(typeKeeper);
}
/**
* 查询库管员配置列表-并关联查询用户名称
*
* @param typeKeeper 查询条件
*/
@Override
public List<TypeKeeper> selectTypeKeeperListAndUserName(TypeKeeper typeKeeper) {
return typeKeeperMapper.selectTypeKeeperListAndUserName(typeKeeper);
}
/**
* 新增库管员配置
*
@ -78,7 +87,7 @@ public class TypeKeeperServiceImpl implements ITypeKeeperService {
}
/**
* 删除库管员配置信息
* 根据主键id删除库管员配置信息
*
* @param ID 库管员配置主键
* @return 结果
@ -88,4 +97,15 @@ public class TypeKeeperServiceImpl implements ITypeKeeperService {
{
return typeKeeperMapper.deleteTypeKeeperByID(ID);
}
/**
* 根据用户ID和物资类型ID删除库管员配置信息
*
* @param typeKeeper
* @return
*/
@Override
public int deleteTypeKeeperByUserIdAndTypeId(TypeKeeper typeKeeper) {
return typeKeeperMapper.deleteTypeKeeperByUserIdAndTypeId(typeKeeper);
}
}

View File

@ -15,8 +15,8 @@ import com.bonus.material.ma.service.ITypeRepairService;
* @date 2024-09-27
*/
@Service
public class TypeRepairServiceImpl implements ITypeRepairService
{
public class TypeRepairServiceImpl implements ITypeRepairService {
@Autowired
private TypeRepairMapper typeRepairMapper;
@ -44,6 +44,16 @@ public class TypeRepairServiceImpl implements ITypeRepairService
return typeRepairMapper.selectTypeRepairList(typeRepair);
}
/**
* 查询配置列表并关联查询用户姓名
*
* @param typeRepair
*/
@Override
public List<TypeRepair> selectTypeRepairListAndUserName(TypeRepair typeRepair) {
return typeRepairMapper.selectTypeRepairListAndUserName(typeRepair);
}
/**
* 新增维修班机具配置
*
@ -93,4 +103,14 @@ public class TypeRepairServiceImpl implements ITypeRepairService
{
return typeRepairMapper.deleteTypeRepairByID(ID);
}
/**
* 根据用户id和类型id删除配置信息
*
* @param typeRepair
*/
@Override
public int deleteTypeRepairByUserIdAndTypeId(TypeRepair typeRepair) {
return typeRepairMapper.deleteTypeRepairByUserIdAndTypeId(typeRepair);
}
}

View File

@ -1,14 +1,14 @@
package com.bonus.material.ma.service.impl;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.*;
import java.util.stream.Collectors;
import cn.hutool.core.util.ArrayUtil;
import com.bonus.common.biz.domain.TreeSelect;
import com.bonus.common.biz.enums.DataCodeEnum;
import com.bonus.common.core.utils.DateUtils;
import com.bonus.common.core.utils.StringUtils;
import com.bonus.material.ma.vo.MaTypeConfigVo;
import com.bonus.material.ma.vo.MaTypeListVo;
import com.bonus.material.ma.vo.MaTypeSelectVo;
import org.springframework.stereotype.Service;
@ -97,7 +97,7 @@ public class TypeServiceImpl implements ITypeService {
* @return 物资类型管理
*/
@Override
public List<MaTypeListVo> selectTypeListAndParent(Type type) {
public List<MaTypeListVo> selectTypeListAndParentInfo(Type type) {
// 如果是顶级节点则查询所有子节点
if (type != null && type.getLevel() != null && "0".equals(type.getLevel())) {
type.setLevel(null);
@ -156,6 +156,47 @@ public class TypeServiceImpl implements ITypeService {
return maTypeListVos;
}
/**
* 查询4级加3级的所有物资类型携带父级信息
*
* @param type 参数
*/
@Override
public List<MaTypeConfigVo> selectThreeFourLevelTypeListAndParent(Type type) {
// 查询四级节点列表
List<MaTypeConfigVo> fourLevelTypeList = typeMapper.selectFourLevelTypeListAndParent(type);
List<MaTypeConfigVo> threeLevelTypeList = null;
if (ArrayUtil.isNotEmpty(fourLevelTypeList)) {
// 查询三级节点列表
threeLevelTypeList = typeMapper.selectThreeLevelTypeListAndParent(type);
if (ArrayUtil.isNotEmpty(threeLevelTypeList)) {
// 使用 HashMap 存储三级节点以便快速查找
Map<Long, MaTypeConfigVo> threeLevelTypeMap = new HashMap<>();
for (MaTypeConfigVo threeLevelType : threeLevelTypeList) {
threeLevelTypeMap.put(threeLevelType.getTypeId(), threeLevelType);
}
// 外层循环四级节点列表
for (MaTypeConfigVo fourLevelType : fourLevelTypeList) {
// 对4级节点进行必要性检查
if (fourLevelType == null || fourLevelType.getParentId() == null) {
continue;
}
// 拿到4级节点的父级id
Long fourLevelTypeParentId = fourLevelType.getParentId();
// 查找对应的三级节点
MaTypeConfigVo threeLevelType = threeLevelTypeMap.get(fourLevelTypeParentId);
if (threeLevelType != null) {
threeLevelType.getChildren().add(fourLevelType);
}
}
}
}
return threeLevelTypeList;
}
/**
* 新增物资类型管理
*

View File

@ -0,0 +1,72 @@
package com.bonus.material.ma.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import java.util.ArrayList;
import java.util.List;
/**
* @author : 阮世耀
* @version : 1.0
* @PackagePath: com.bonus.material.ma.vo
* @CreateTime: 2024-10-16 10:57
* @Description: 物资类型配置vo
*/
@Data
@ToString
public class MaTypeConfigVo implements java.io.Serializable {
@ApiModelProperty(value = "配置id")
private Long id;
@ApiModelProperty(value = "物资类型id")
private Long typeId;
@ApiModelProperty(value = "物资类型名称")
private String typeName;
@ApiModelProperty(value = "父级id")
private Long parentId;
@ApiModelProperty(value = "物资仓库id")
private Long houseId;
@ApiModelProperty(value = "物资仓库名称")
private String houseName;
@ApiModelProperty(value = "库管员id")
private Long keeperUserId;
@ApiModelProperty(value = "库管员姓名")
private String keeperUserName;
@ApiModelProperty(value = "维修员id")
private Long repairUserId;
@ApiModelProperty(value = "维修员姓名")
private String repairUserName;
private String parentOneLevelName;
private String parentTwoLevelName;
private String parentThreeLevelName;
private String parentFourLevelName;
@ApiModelProperty(value = "请求API时调用参数--左侧Tree用户ID")
private Long userId;
@ApiModelProperty(value = "请求API时调用参数--左侧Tree层级")
private String level;
@ApiModelProperty(value = "是否选中")
private Boolean isCheck = false;
@ApiModelProperty(value = "子节点")
private List<MaTypeConfigVo> children = new ArrayList<>();
}

View File

@ -95,7 +95,7 @@ public class PurchaseCheckDetailsController extends BaseController {
@ApiOperation(value = "修改新购验收任务详细")
@PreventRepeatSubmit
@RequiresPermissions("purchase:details:edit")
@SysLog(title = "新购验收任务详细", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改新购验收任务详细")
@SysLog(title = "新购验收任务详细", businessType = OperaType.UPDATE, module = "仓储管理->修改新购验收任务详细")
@PutMapping
public AjaxResult edit(@RequestBody PurchaseCheckDetails purchaseCheckDetails) {
try {

View File

@ -1,9 +1,14 @@
package com.bonus.material.purchase.controller;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import com.bonus.common.log.enums.OperaType;
import com.bonus.material.common.annotation.PreventRepeatSubmit;
import com.bonus.material.purchase.dto.PurchaseCheckDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
@ -34,7 +39,8 @@ import com.bonus.common.core.web.page.TableDataInfo;
@RestController
@RequestMapping("/purchase_check_info")
public class PurchaseCheckInfoController extends BaseController {
@Autowired
@Resource
private IPurchaseCheckInfoService purchaseCheckInfoService;
/**
@ -49,19 +55,6 @@ public class PurchaseCheckInfoController extends BaseController {
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, "新购验收任务数据");
}
/**
* 获取新购验收任务详细信息
@ -79,11 +72,11 @@ public class PurchaseCheckInfoController extends BaseController {
@ApiOperation(value = "新增新购验收任务")
@PreventRepeatSubmit
@RequiresPermissions("purchase:info:add")
@SysLog(title = "新购验收任务", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增新购验收任务")
@SysLog(title = "新购验收任务", businessType = OperaType.INSERT, module = "仓储管理->新增新购验收任务")
@PostMapping
public AjaxResult add(@RequestBody PurchaseCheckInfo purchaseCheckInfo) {
public AjaxResult add(@Valid @NotNull @RequestBody PurchaseCheckDto purchaseCheckDto) {
try {
return toAjax(purchaseCheckInfoService.insertPurchaseCheckInfo(purchaseCheckInfo));
return purchaseCheckInfoService.insertPurchaseCheckInfo(purchaseCheckDto);
} catch (Exception e) {
return error("系统错误, " + e.getMessage());
}
@ -95,7 +88,7 @@ public class PurchaseCheckInfoController extends BaseController {
@ApiOperation(value = "修改新购验收任务")
@PreventRepeatSubmit
@RequiresPermissions("purchase:info:edit")
@SysLog(title = "新购验收任务", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改新购验收任务")
@SysLog(title = "新购验收任务", businessType = OperaType.UPDATE, module = "仓储管理->修改新购验收任务")
@PutMapping
public AjaxResult edit(@RequestBody PurchaseCheckInfo purchaseCheckInfo) {
try {
@ -111,9 +104,25 @@ public class PurchaseCheckInfoController extends BaseController {
@ApiOperation(value = "删除新购验收任务")
@PreventRepeatSubmit
@RequiresPermissions("purchase:info:remove")
@SysLog(title = "新购验收任务", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除新购验收任务")
@SysLog(title = "新购验收任务", businessType = OperaType.DELETE, module = "仓储管理->删除新购验收任务")
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] 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, "新购验收任务数据");
}
}

View File

@ -3,6 +3,7 @@ package com.bonus.material.purchase.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.bonus.common.log.enums.OperaType;
import com.bonus.common.security.annotation.RequiresPermissions;
import com.bonus.material.common.annotation.PreventRepeatSubmit;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -16,7 +17,6 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.bonus.common.log.annotation.SysLog;
import com.bonus.common.security.annotation.RequiresPermissions;
import com.bonus.material.purchase.domain.PurchaseMacodeInfo;
import com.bonus.material.purchase.service.IPurchaseMacodeInfoService;
import com.bonus.common.core.web.controller.BaseController;
@ -34,6 +34,7 @@ import com.bonus.common.core.web.page.TableDataInfo;
@RestController
@RequestMapping("/purchase_macode_info")
public class PurchaseMacodeInfoController extends BaseController {
@Autowired
private IPurchaseMacodeInfoService purchaseMacodeInfoService;

View File

@ -6,20 +6,19 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import com.bonus.common.core.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import com.bonus.common.core.web.domain.BaseEntity;
/**
* 新购验收任务详细对象 purchase_check_details
*
* @author xsheng
* @date 2024-10-16
*/
@EqualsAndHashCode(callSuper = false)
@Data
@ToString
public class PurchaseCheckDetails extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 主键id */
@ -35,6 +34,12 @@ public class PurchaseCheckDetails extends BaseEntity {
@ApiModelProperty(value = "规格id")
private Long typeId;
@ApiModelProperty(value = "规格名称")
private String typeName;
@ApiModelProperty(value = "物资名称--规格parent类型")
private String maTypeName;
/** 采购单价 */
@Excel(name = "采购单价")
@ApiModelProperty(value = "采购单价")
@ -60,11 +65,15 @@ public class PurchaseCheckDetails extends BaseEntity {
@ApiModelProperty(value = "验收结论")
private String checkResult;
/** 供应商id */
@Excel(name = "供应商id")
@ApiModelProperty(value = "供应商id")
/** 物资厂家id */
@Excel(name = "物资厂家id")
@ApiModelProperty(value = "物资厂家id")
private Long supplierId;
/** 物资厂家名称 */
@ApiModelProperty(value = "物资厂家名称")
private String supplierName;
/** 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-综合服务中心不通过")

View File

@ -5,17 +5,15 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import com.bonus.common.core.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import com.bonus.common.core.web.domain.BaseEntity;
/**
* 新购验收任务对象 purchase_check_info
*
* @author xsheng
* @date 2024-10-16
* @author syruan
*/
@EqualsAndHashCode(callSuper = false)
@Data
@ToString
public class PurchaseCheckInfo extends BaseEntity {
@ -29,6 +27,9 @@ public class PurchaseCheckInfo extends BaseEntity {
@ApiModelProperty(value = "任务ID")
private Long taskId;
@ApiModelProperty(value = "任务状态")
private String taskStatus;
/** 采购日期 */
@ApiModelProperty(value = "采购日期")
@JsonFormat(pattern = "yyyy-MM-dd")
@ -51,5 +52,16 @@ public class PurchaseCheckInfo extends BaseEntity {
@ApiModelProperty(value = "数据所属组织")
private Long companyId;
/**
* 采购物资
*/
@ApiModelProperty(value = "采购物资--外层Table字段")
private String purchaseMaTypeName;
/**
* 采购数量
*/
@ApiModelProperty(value = "采购数量--外层Table字段")
private String purchaseMaNumber;
}

View File

@ -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;
}

View File

@ -2,6 +2,7 @@ package com.bonus.material.purchase.mapper;
import java.util.List;
import com.bonus.material.purchase.domain.PurchaseCheckDetails;
import org.apache.ibatis.annotations.Param;
/**
* 新购验收任务详细Mapper接口
@ -10,13 +11,29 @@ import com.bonus.material.purchase.domain.PurchaseCheckDetails;
* @date 2024-10-16
*/
public interface PurchaseCheckDetailsMapper {
/**
* 根据任务id查询物资类型名称1-验收2-入库
*
* @param taskId * @param type 1-验收2-入库
* @return String类型多个物资类型根据逗号分割
*/
String selectMaTypeNameByTaskId(@Param("taskId") Long taskId, @Param("type") String type);
/**
* 查询新购验收任务详细
*
* @param id 新购验收任务详细主键
* @return 新购验收任务详细
*/
public PurchaseCheckDetails selectPurchaseCheckDetailsById(Long id);
PurchaseCheckDetails selectPurchaseCheckDetailsById(Long id);
/**
* 根据任务id查询新购验收任务详细列表--Join查询
* @param taskId 任务id
*/
List<PurchaseCheckDetails> selectPurchaseCheckDetailsListByTaskId(Long taskId);
/**
* 查询新购验收任务详细列表
@ -24,7 +41,7 @@ public interface PurchaseCheckDetailsMapper {
* @param purchaseCheckDetails 新购验收任务详细
* @return 新购验收任务详细集合
*/
public List<PurchaseCheckDetails> selectPurchaseCheckDetailsList(PurchaseCheckDetails purchaseCheckDetails);
List<PurchaseCheckDetails> selectPurchaseCheckDetailsList(PurchaseCheckDetails purchaseCheckDetails);
/**
* 新增新购验收任务详细
@ -32,7 +49,13 @@ public interface PurchaseCheckDetailsMapper {
* @param purchaseCheckDetails 新购验收任务详细
* @return 结果
*/
public int insertPurchaseCheckDetails(PurchaseCheckDetails purchaseCheckDetails);
int insertPurchaseCheckDetails(PurchaseCheckDetails purchaseCheckDetails);
/**
* 批量新增新购验收任务详细
* @param purchaseCheckDetailsList 新购验收任务详细集合
*/
int insertPurchaseCheckDetailsList(List<PurchaseCheckDetails> purchaseCheckDetailsList);
/**
* 修改新购验收任务详细
@ -40,7 +63,7 @@ public interface PurchaseCheckDetailsMapper {
* @param purchaseCheckDetails 新购验收任务详细
* @return 结果
*/
public int updatePurchaseCheckDetails(PurchaseCheckDetails purchaseCheckDetails);
int updatePurchaseCheckDetails(PurchaseCheckDetails purchaseCheckDetails);
/**
* 删除新购验收任务详细
@ -48,7 +71,7 @@ public interface PurchaseCheckDetailsMapper {
* @param id 新购验收任务详细主键
* @return 结果
*/
public int deletePurchaseCheckDetailsById(Long id);
int deletePurchaseCheckDetailsById(Long id);
/**
* 批量删除新购验收任务详细
@ -56,5 +79,5 @@ public interface PurchaseCheckDetailsMapper {
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deletePurchaseCheckDetailsByIds(Long[] ids);
int deletePurchaseCheckDetailsByIds(Long[] ids);
}

View File

@ -16,15 +16,24 @@ public interface PurchaseCheckInfoMapper {
* @param id 新购验收任务主键
* @return 新购验收任务
*/
public PurchaseCheckInfo selectPurchaseCheckInfoById(Long id);
PurchaseCheckInfo selectPurchaseCheckInfoById(Long id);
/**
* 查询新购验收任务列表
* 查询新购验收任务列表--单表基础查询
*
* @param purchaseCheckInfo 新购验收任务
* @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 新购验收任务
* @return 结果
*/
public int insertPurchaseCheckInfo(PurchaseCheckInfo purchaseCheckInfo);
int insertPurchaseCheckInfo(PurchaseCheckInfo purchaseCheckInfo);
/**
* 修改新购验收任务
@ -40,7 +49,7 @@ public interface PurchaseCheckInfoMapper {
* @param purchaseCheckInfo 新购验收任务
* @return 结果
*/
public int updatePurchaseCheckInfo(PurchaseCheckInfo purchaseCheckInfo);
int updatePurchaseCheckInfo(PurchaseCheckInfo purchaseCheckInfo);
/**
* 删除新购验收任务
@ -48,7 +57,7 @@ public interface PurchaseCheckInfoMapper {
* @param id 新购验收任务主键
* @return 结果
*/
public int deletePurchaseCheckInfoById(Long id);
int deletePurchaseCheckInfoById(Long id);
/**
* 批量删除新购验收任务
@ -56,5 +65,5 @@ public interface PurchaseCheckInfoMapper {
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deletePurchaseCheckInfoByIds(Long[] ids);
int deletePurchaseCheckInfoByIds(Long[] ids);
}

View File

@ -1,13 +1,15 @@
package com.bonus.material.purchase.service;
import java.util.List;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.material.purchase.domain.PurchaseCheckInfo;
import com.bonus.material.purchase.dto.PurchaseCheckDto;
/**
* 新购验收任务Service接口
*
* @author xsheng
* @date 2024-10-16
* @author syruan
*/
public interface IPurchaseCheckInfoService {
/**
@ -16,7 +18,7 @@ public interface IPurchaseCheckInfoService {
* @param id 新购验收任务主键
* @return 新购验收任务
*/
public PurchaseCheckInfo selectPurchaseCheckInfoById(Long id);
PurchaseCheckDto selectPurchaseCheckInfoById(Long id);
/**
* 查询新购验收任务列表
@ -24,15 +26,15 @@ public interface IPurchaseCheckInfoService {
* @param purchaseCheckInfo 新购验收任务
* @return 新购验收任务集合
*/
public List<PurchaseCheckInfo> selectPurchaseCheckInfoList(PurchaseCheckInfo purchaseCheckInfo);
List<PurchaseCheckInfo> selectPurchaseCheckInfoList(PurchaseCheckInfo purchaseCheckInfo);
/**
* 新增新购验收任务
*
* @param purchaseCheckInfo 新购验收任务
* @param purchaseCheckDto 新购验收任务dto
* @return 结果
*/
public int insertPurchaseCheckInfo(PurchaseCheckInfo purchaseCheckInfo);
AjaxResult insertPurchaseCheckInfo(PurchaseCheckDto purchaseCheckDto);
/**
* 修改新购验收任务
@ -40,7 +42,7 @@ public interface IPurchaseCheckInfoService {
* @param purchaseCheckInfo 新购验收任务
* @return 结果
*/
public int updatePurchaseCheckInfo(PurchaseCheckInfo purchaseCheckInfo);
int updatePurchaseCheckInfo(PurchaseCheckInfo purchaseCheckInfo);
/**
* 批量删除新购验收任务
@ -48,7 +50,7 @@ public interface IPurchaseCheckInfoService {
* @param ids 需要删除的新购验收任务主键集合
* @return 结果
*/
public int deletePurchaseCheckInfoByIds(Long[] ids);
int deletePurchaseCheckInfoByIds(Long[] ids);
/**
* 删除新购验收任务信息
@ -56,5 +58,5 @@ public interface IPurchaseCheckInfoService {
* @param id 新购验收任务主键
* @return 结果
*/
public int deletePurchaseCheckInfoById(Long id);
int deletePurchaseCheckInfoById(Long id);
}

View File

@ -3,23 +3,38 @@ package com.bonus.material.purchase.service.impl;
import java.util.List;
import com.bonus.common.core.exception.ServiceException;
import com.bonus.common.core.utils.DateUtils;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.material.purchase.domain.PurchaseCheckDetails;
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.stereotype.Service;
import com.bonus.material.purchase.mapper.PurchaseCheckInfoMapper;
import com.bonus.material.purchase.domain.PurchaseCheckInfo;
import com.bonus.material.purchase.service.IPurchaseCheckInfoService;
import javax.annotation.Resource;
import javax.validation.constraints.NotNull;
/**
* 新购验收任务Service业务层处理
*
* @author xsheng
* @date 2024-10-16
* @author syruan
*/
@Service
public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService {
@Autowired
@Resource
private PurchaseCheckInfoMapper purchaseCheckInfoMapper;
@Resource
private PurchaseCheckDetailsMapper purchaseCheckDetailsMapper;
@Resource
private TmTaskMapper tmTaskMapper;
/**
* 查询新购验收任务
*
@ -27,19 +42,38 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService {
* @return 新购验收任务
*/
@Override
public PurchaseCheckInfo selectPurchaseCheckInfoById(Long id) {
return purchaseCheckInfoMapper.selectPurchaseCheckInfoById(id);
public PurchaseCheckDto selectPurchaseCheckInfoById(Long id) {
PurchaseCheckDto purchaseCheckDtoResult = new PurchaseCheckDto();
PurchaseCheckInfo purchaseCheckInfo = purchaseCheckInfoMapper.selectPurchaseCheckInfoById(id);
if (purchaseCheckInfo != null) {
purchaseCheckDtoResult.setPurchaseCheckInfo(purchaseCheckInfo);
List<PurchaseCheckDetails> purchaseCheckDetails = purchaseCheckDetailsMapper.selectPurchaseCheckDetailsListByTaskId(purchaseCheckInfo.getTaskId());
if (purchaseCheckDetails != null) {
purchaseCheckDtoResult.setPurchaseCheckDetailsList(purchaseCheckDetails);
}
}
return purchaseCheckDtoResult;
}
/**
* 查询新购验收任务列表
*
* @param purchaseCheckInfo 新购验收任务
* @param purchaseCheckInfoDto 新购验收任务请求参数
* @return 新购验收任务
*/
@Override
public List<PurchaseCheckInfo> selectPurchaseCheckInfoList(PurchaseCheckInfo purchaseCheckInfo) {
return purchaseCheckInfoMapper.selectPurchaseCheckInfoList(purchaseCheckInfo);
public List<PurchaseCheckInfo> selectPurchaseCheckInfoList(PurchaseCheckInfo purchaseCheckInfoDto) {
// 查询新购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;
}
/**
@ -49,12 +83,49 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService {
* @return 结果
*/
@Override
public int insertPurchaseCheckInfo(PurchaseCheckInfo purchaseCheckInfo) {
purchaseCheckInfo.setCreateTime(DateUtils.getNowDate());
public AjaxResult insertPurchaseCheckInfo(PurchaseCheckDto purchaseCheckInfo) {
// 赋值创建时间
purchaseCheckInfo.getPurchaseCheckInfo().setCreateTime(DateUtils.getNowDate());
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) {
throw new ServiceException("错误信息描述");
return AjaxResult.error("新增任务失败:" + e.getMessage());
}
}

View File

@ -3,20 +3,19 @@ package com.bonus.material.task.domain;
import com.bonus.common.core.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import com.bonus.common.core.web.domain.BaseEntity;
/**
* 任务对象 tm_task
*
* @author xsheng
* @date 2024-10-16
* @author syruan
*/
@EqualsAndHashCode(callSuper = true)
@Data
@ToString
public class TmTask extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 任务ID */
@ -47,5 +46,18 @@ public class TmTask extends BaseEntity {
@ApiModelProperty(value = "0不启用 1启用")
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() {}
}

View File

@ -2,6 +2,7 @@ package com.bonus.material.task.mapper;
import java.util.List;
import com.bonus.material.task.domain.TmTask;
import org.apache.ibatis.annotations.Param;
/**
* 任务Mapper接口
@ -16,7 +17,15 @@ public interface TmTaskMapper {
* @param taskId 任务主键
* @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 任务
* @return 任务集合
*/
public List<TmTask> selectTmTaskList(TmTask tmTask);
List<TmTask> selectTmTaskList(TmTask tmTask);
/**
* 新增任务
@ -32,7 +41,7 @@ public interface TmTaskMapper {
* @param tmTask 任务
* @return 结果
*/
public int insertTmTask(TmTask tmTask);
int insertTmTask(TmTask tmTask);
/**
* 修改任务
@ -40,7 +49,7 @@ public interface TmTaskMapper {
* @param tmTask 任务
* @return 结果
*/
public int updateTmTask(TmTask tmTask);
int updateTmTask(TmTask tmTask);
/**
* 删除任务
@ -48,7 +57,7 @@ public interface TmTaskMapper {
* @param taskId 任务主键
* @return 结果
*/
public int deleteTmTaskByTaskId(Long taskId);
int deleteTmTaskByTaskId(Long taskId);
/**
* 批量删除任务
@ -56,5 +65,5 @@ public interface TmTaskMapper {
* @param taskIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteTmTaskByTaskIds(Long[] taskIds);
int deleteTmTaskByTaskIds(Long[] taskIds);
}

View File

@ -119,8 +119,10 @@ public class TmTaskAuditLogServiceImpl implements ITmTaskAuditLogService {
List<String> needRoles = new ArrayList<>();
if (MaterialConstants.LEASE_TASK_TYPE.equals(tmTaskAuditLog.getTaskType())) {
needRoles = bmConfigService.getLeaseTaskAuditRoleKeys();
}
//TODO, add more tasks logic to get needRoles
} else if (MaterialConstants.BACK_TASK_TYPE.equals(tmTaskAuditLog.getTaskType())) {
needRoles = bmConfigService.getBackTaskAuditRoleKeys();
} //TODO, add more tasks logic to get needRoles
if (CollectionUtils.isEmpty(needRoles)) {
return new TmTaskAuditResult(true);
} else {

View File

@ -17,7 +17,7 @@ public interface WhHouseInfoMapper
* @param houseId 仓库管理主键
* @return 仓库管理
*/
public WhHouseInfo selectWhHouseInfoByHouseId(Long houseId);
WhHouseInfo selectWhHouseInfoByHouseId(Long houseId);
/**
* 查询仓库管理列表
@ -33,7 +33,7 @@ public interface WhHouseInfoMapper
* @param whHouseInfo 仓库管理
* @return 结果
*/
public int insertWhHouseInfo(WhHouseInfo whHouseInfo);
int insertWhHouseInfo(WhHouseInfo whHouseInfo);
/**
* 修改仓库管理
@ -41,7 +41,7 @@ public interface WhHouseInfoMapper
* @param whHouseInfo 仓库管理
* @return 结果
*/
public int updateWhHouseInfo(WhHouseInfo whHouseInfo);
int updateWhHouseInfo(WhHouseInfo whHouseInfo);
/**
* 删除仓库管理
@ -49,7 +49,7 @@ public interface WhHouseInfoMapper
* @param houseId 仓库管理主键
* @return 结果
*/
public int deleteWhHouseInfoByHouseId(Long houseId);
int deleteWhHouseInfoByHouseId(Long houseId);
/**
* 批量删除仓库管理
@ -57,5 +57,5 @@ public interface WhHouseInfoMapper
* @param houseIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteWhHouseInfoByHouseIds(Long[] houseIds);
int deleteWhHouseInfoByHouseIds(Long[] houseIds);
}

View File

@ -23,7 +23,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectSupplierInfoVo">
select supplier_id, supplier, address, legal_person, primary_contact, phone, business_scope, business_license, del_flag, create_by, create_time, update_by, update_time, remark, company_id, status from ma_supplier_info
select supplier_id, supplier, address, legal_person, primary_contact, phone, business_scope, business_license,
del_flag, create_by, create_time, update_by, update_time, remark, company_id, status
from ma_supplier_info
</sql>
<select id="selectSupplierInfoList" parameterType="com.bonus.material.ma.domain.SupplierInfo" resultMap="SupplierInfoResult">
@ -62,7 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">create_time,</if>
<if test="remark != null">remark,</if>
<if test="companyId != null">company_id,</if>
<if test="status != null">status,</if>
<if test="status != null">`status`,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="supplier != null and supplier != ''">#{supplier},</if>

View File

@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="ID" column="ID" />
<result property="typeId" column="type_id" />
<result property="userId" column="user_id" />
<result property="userName" column="user_name" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="companyId" column="company_id" />
@ -28,6 +29,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectTypeKeeperVo"/>
where ID = #{ID}
</select>
<select id="selectTypeKeeperByUserIdAndTypeId" parameterType="Long" resultMap="TypeKeeperResult">
<include refid="selectTypeKeeperVo"/>
where type_id = #{typeId} and user_id = #{userId}
limit 1
</select>
<insert id="insertTypeKeeper" parameterType="com.bonus.material.ma.domain.TypeKeeper" useGeneratedKeys="true" keyProperty="ID">
insert into ma_type_keeper
@ -68,4 +75,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{ID}
</foreach>
</delete>
<select id="selectTypeKeeperListAndUserName" resultMap="TypeKeeperResult">
select
tk.ID, tk.type_id, tk.user_id, tk.create_time, tk.update_time, tk.company_id, u.user_name
from
ma_type_keeper tk
left join
sys_user u on tk.user_id = u.user_id
<where>
<if test="userId != null "> and tk.user_id = #{userId}</if>
<if test="companyId != null "> and tk.company_id = #{companyId}</if>
</where>
</select>
<delete id="deleteTypeKeeperByUserIdAndTypeId">
delete from ma_type_keeper where user_id = #{userId} and type_id = #{typeId}
</delete>
</mapper>

View File

@ -12,12 +12,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="typeCode" column="type_code" />
<result property="modelCode" column="model_code" />
<result property="unitId" column="unit_id" />
<result property="unitName" column="unit_name" />
<result property="manageType" column="manage_type" />
<result property="leasePrice" column="lease_price" />
<result property="effTime" column="eff_time" />
<result property="rentPrice" column="rent_price" />
<result property="buyPrice" column="buy_price" />
<result property="payRatio" column="pay_ratio" />
<result property="payPrice" column="pay_price" />
<result property="taxRatio" column="tax_ratio" />
<result property="level" column="level" />
<result property="ratedLoad" column="rated_load" />
<result property="testLoad" column="test_load" />
@ -43,12 +46,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="typeCode" column="type_code" />
<result property="modelCode" column="model_code" />
<result property="unitId" column="unit_id" />
<result property="unitName" column="unit_name" />
<result property="manageType" column="manage_type" />
<result property="leasePrice" column="lease_price" />
<result property="effTime" column="eff_time" />
<result property="rentPrice" column="rent_price" />
<result property="buyPrice" column="buy_price" />
<result property="payRatio" column="pay_ratio" />
<result property="payPrice" column="pay_price" />
<result property="taxRatio" column="tax_ratio" />
<result property="level" column="level" />
<result property="ratedLoad" column="rated_load" />
<result property="testLoad" column="test_load" />
@ -68,12 +74,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="parentTwoLevelName" column="parentThreeLevelName" />
<result property="parentThreeLevelName" column="parentTwoLevelName" />
<result property="parentFourLevelName" column="parentOneLevelName" />
<result property="houseName" column="house_name" />
</resultMap>
<resultMap type="com.bonus.material.ma.vo.MaTypeConfigVo" id="MaTypeConfigVoResult">
<result property="typeId" column="type_id" />
<result property="typeName" column="type_name" />
<result property="parentId" column="parent_id" />
<result property="level" column="level" />
<result property="houseId" column="house_id" />
<result property="houseName" column="house_name" />
<result property="parentOneLevelName" column="parentFourLevelName" />
<result property="parentTwoLevelName" column="parentThreeLevelName" />
<result property="parentThreeLevelName" column="parentTwoLevelName" />
<result property="parentFourLevelName" column="parentOneLevelName" />
</resultMap>
<sql id="selectTypeVo">
select
type_id, type_name, parent_id, storage_num, type_code, model_code, unit_id, manage_type, lease_price,
eff_time, rent_price, buy_price, pay_ratio, level, rated_load, test_load, holding_time, warn_num,
type_id, type_name, parent_id, storage_num, type_code, model_code, unit_id, unit_name, manage_type, lease_price,
eff_time, rent_price, buy_price, pay_ratio, pay_price, tax_ratio, level, rated_load, test_load, holding_time, warn_num,
create_by, create_time, update_by, update_time, is_plan,is_ancuo, remark, fac_model, intelligent_code
from ma_type
</sql>
@ -145,12 +165,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="typeCode != null">type_code,</if>
<if test="modelCode != null">model_code,</if>
<if test="unitId != null">unit_id,</if>
<if test="unitName != null">unit_name,</if>
<if test="manageType != null and manageType != ''">manage_type,</if>
<if test="leasePrice != null">lease_price,</if>
<if test="effTime != null">eff_time,</if>
<if test="rentPrice != null">rent_price,</if>
<if test="buyPrice != null">buy_price,</if>
<if test="payRatio != null">pay_ratio,</if>
<if test="payPrice != null">pay_price,</if>
<if test="taxRatio != null">tax_ratio,</if>
<if test="level != null">`level`,</if>
<if test="ratedLoad != null">rated_load,</if>
<if test="testLoad != null">test_load,</if>
@ -173,12 +196,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="typeCode != null">#{typeCode},</if>
<if test="modelCode != null">#{modelCode},</if>
<if test="unitId != null">#{unitId},</if>
<if test="unitName != null">#{unitName},</if>
<if test="manageType != null and manageType != ''">#{manageType},</if>
<if test="leasePrice != null">#{leasePrice},</if>
<if test="effTime != null">#{effTime},</if>
<if test="rentPrice != null">#{rentPrice},</if>
<if test="buyPrice != null">#{buyPrice},</if>
<if test="payRatio != null">#{payRatio},</if>
<if test="payPrice != null">#{payPrice},</if>
<if test="taxRatio != null">#{taxRatio},</if>
<if test="level != null">#{level},</if>
<if test="ratedLoad != null">#{ratedLoad},</if>
<if test="testLoad != null">#{testLoad},</if>
@ -205,12 +231,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="typeCode != null">type_code = #{typeCode},</if>
<if test="modelCode != null">model_code = #{modelCode},</if>
<if test="unitId != null">unit_id = #{unitId},</if>
<if test="unitName != null">unit_name = #{unitName},</if>
<if test="manageType != null and manageType != ''">manage_type = #{manageType},</if>
<if test="leasePrice != null">lease_price = #{leasePrice},</if>
<if test="effTime != null">eff_time = #{effTime},</if>
<if test="rentPrice != null">rent_price = #{rentPrice},</if>
<if test="buyPrice != null">buy_price = #{buyPrice},</if>
<if test="payRatio != null">pay_ratio = #{payRatio},</if>
<if test="payPrice != null">pay_price = #{payPrice},</if>
<if test="taxRatio != null">tax_ratio = #{taxRatio},</if>
<if test="level != null">`level` = #{level},</if>
<if test="ratedLoad != null">rated_load = #{ratedLoad},</if>
<if test="testLoad != null">test_load = #{testLoad},</if>
@ -251,11 +280,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT
a.*, -- 当前层级的所有字段
b.type_name AS parentThreeLevelName, -- 父层级名称
c.type_name AS parentTwoLevelName, -- 祖父层级名称
d.type_name AS parentOneLevelName -- 曾祖父层级名称
d.type_name AS parentOneLevelName, -- 曾祖父层级名称
whi.house_name
FROM
ma_type a
LEFT JOIN
wh_house_set whs ON a.type_id = whs.type_id AND whs.del_flag = '0'
LEFT JOIN
wh_house_info whi ON whi.house_id = whs.house_id AND whs.del_flag = '0'
LEFT JOIN
ma_type b ON a.parent_id = b.type_id and b.del_flag = '0' -- 第一层,父类型
LEFT JOIN
@ -325,10 +358,54 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getMaTypeSelectVoListByParentId" resultType="com.bonus.material.ma.vo.MaTypeSelectVo">
select
type_id,type_name,parent_id,level
type_id as typeId,
type_name as typeName,
parent_id as parentId,
level
from
ma_type
where
parent_id = #{typeId} and del_flag = 0
parent_id = #{parentId} and del_flag = 0
</select>
<select id="selectFourLevelTypeListAndParent" resultMap="MaTypeConfigVoResult">
SELECT
a.*, -- 当前层级的所有字段
a.type_name AS parentFourLevelName, -- 当前层级名称
b.type_name AS parentThreeLevelName, -- 父层级名称
c.type_name AS parentTwoLevelName, -- 祖父层级名称
d.type_name AS parentOneLevelName, -- 曾祖父层级名称
whs.house_id,whi.house_name
FROM
ma_type a
LEFT JOIN
wh_house_set whs ON a.type_id = whs.type_id AND whs.del_flag = '0'
LEFT JOIN
wh_house_info whi ON whi.house_id = whs.house_id AND whs.del_flag = '0'
LEFT JOIN
ma_type b ON a.parent_id = b.type_id AND b.del_flag = '0' -- 第一层,父类型
LEFT JOIN
ma_type c ON b.parent_id = c.type_id AND c.del_flag = '0' -- 第二层,祖父类型
LEFT JOIN
ma_type d ON c.parent_id = d.type_id AND d.del_flag = '0' -- 第三层,曾祖父类型
WHERE
a.del_flag = 0 AND a.`level` = '4'
</select>
<select id="selectThreeLevelTypeListAndParent" resultMap="MaTypeConfigVoResult">
SELECT
a.*,
a.type_name AS parentThreeLevelName,
b.type_name AS parentTwoLevelName, -- 父类型名称
c.type_name AS parentOneLevelName, -- 祖父类型名称
NULL AS parentFourLevelName
FROM
ma_type a
LEFT JOIN
ma_type b ON a.parent_id = b.type_id -- 第一层,父类型
LEFT JOIN
ma_type c ON b.parent_id = c.type_id -- 第二层,祖父类型
WHERE
a.del_flag = 0 AND a.`level` = '3'
</select>
</mapper>

View File

@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="ID" column="ID" />
<result property="typeId" column="type_id" />
<result property="userId" column="user_id" />
<result property="userName" column="user_name" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="companyId" column="company_id" />
@ -69,4 +70,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{ID}
</foreach>
</delete>
<select id="selectTypeRepairListAndUserName" resultMap="TypeRepairResult">
select
m.type_id, mtk.user_id, su.nick_name as user_name, m.create_time
from
ma_type_repair mtk
left join
ma_type m ON m.type_id = mtk.type_id
left join sys_user su on mtk.user_id = su.user_id
</select>
<delete id="deleteTypeRepairByUserIdAndTypeId">
delete from ma_type_repair where user_id = #{userId} and type_id = #{typeId}
</delete>
</mapper>

View File

@ -7,6 +7,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="id" column="id" />
<result property="taskId" column="task_id" />
<result property="typeId" column="type_id" />
<result property="typeName" column="type_name" />
<result property="maTypeName" column="ma_type_name" />
<result property="purchasePrice" column="purchase_price" />
<result property="purchaseNum" column="purchase_num" />
<result property="checkNum" column="check_num" />
@ -34,6 +36,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select id, task_id, type_id, purchase_price, purchase_num, check_num, bind_num, check_result, supplier_id, status, create_by, production_time, create_time, update_by, update_time, remark, check_url_name, check_url, input_num, input_status, input_time, file_name, file_url, company_id from purchase_check_details
</sql>
<sql id="selectPurchaseCheckDetailsJoinVo">
select pcd.id, pcd.task_id, pcd.type_id, pcd.purchase_price, pcd.purchase_num, pcd.check_num, pcd.bind_num, pcd.check_result,
pcd.supplier_id, pcd.status, pcd.create_by, pcd.production_time, pcd.create_time, pcd.update_by, pcd.update_time,
pcd.remark, pcd.check_url_name, pcd.check_url, pcd.input_num, pcd.input_status, pcd.input_time, pcd.file_name,
pcd.file_url, pcd.company_id, mt.type_name, mtp.type_name as ma_type_name
from purchase_check_details pcd
left join ma_type mt on pcd.type_id = mt.type_id
left join ma_type mtp on mt.parent_id = mtp.type_id
</sql>
<select id="selectPurchaseCheckDetailsList" parameterType="com.bonus.material.purchase.domain.PurchaseCheckDetails" resultMap="PurchaseCheckDetailsResult">
<include refid="selectPurchaseCheckDetailsVo"/>
<where>
@ -62,6 +74,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectPurchaseCheckDetailsVo"/>
where id = #{id}
</select>
<select id="selectPurchaseCheckDetailsListByTaskId" parameterType="Long" resultMap="PurchaseCheckDetailsResult">
<include refid="selectPurchaseCheckDetailsJoinVo"/>
where pcd.task_id = #{taskId}
</select>
<insert id="insertPurchaseCheckDetails" parameterType="com.bonus.material.purchase.domain.PurchaseCheckDetails" useGeneratedKeys="true" keyProperty="id">
insert into purchase_check_details
@ -157,4 +174,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</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>

View File

@ -15,14 +15,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="companyId" column="company_id" />
<result property="taskStatus" column="task_status" />
</resultMap>
<sql id="selectPurchaseCheckInfoVo">
select id, task_id, purchase_time, arrival_time, purchaser, create_by, create_time, update_by, update_time, remark, company_id from purchase_check_info
<sql id="selectPurchaseCheckInfoBaseSQL">
select
id, task_id, purchase_time, arrival_time, purchaser, create_by,
create_time, update_by, update_time, remark, company_id
from
purchase_check_info
</sql>
<sql id="selectPurchaseCheckInfoJoinSQL">
select
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,
t.task_status, t.task_type
from
purchase_check_info pci
left join tm_task t on t.task_id = pci.task_id
</sql>
<select id="selectPurchaseCheckInfoList" parameterType="com.bonus.material.purchase.domain.PurchaseCheckInfo" resultMap="PurchaseCheckInfoResult">
<include refid="selectPurchaseCheckInfoVo"/>
<include refid="selectPurchaseCheckInfoBaseSQL"/>
<where>
<if test="taskId != null "> and task_id = #{taskId}</if>
<if test="purchaseTime != null "> and purchase_time = #{purchaseTime}</if>
@ -33,7 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectPurchaseCheckInfoById" parameterType="Long" resultMap="PurchaseCheckInfoResult">
<include refid="selectPurchaseCheckInfoVo"/>
<include refid="selectPurchaseCheckInfoBaseSQL"/>
where id = #{id}
</select>
@ -92,4 +107,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</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>

View File

@ -15,10 +15,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="remark" column="remark" />
<result property="companyId" column="company_id" />
<result property="status" column="status" />
<result property="monthOrder" column="month_order" />
</resultMap>
<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>
<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=",">
<if test="taskType != null">task_type,</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="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
<if test="companyId != null">company_id,</if>
<if test="status != null">status,</if>
<if test="status != null">`status`,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<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="remark != null">remark = #{remark},</if>
<if test="companyId != null">company_id = #{companyId},</if>
<if test="status != null">status = #{status},</if>
<if test="status != null">`status` = #{status},</if>
</trim>
where task_id = #{taskId}
</update>
@ -92,4 +95,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{taskId}
</foreach>
</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>

View File

@ -24,7 +24,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectWhHouseInfoVo">
select house_id, house_name, physical_name, geo_location, parent_id, status, dept_id, del_flag, create_by, create_time, update_by, update_time, remark, company_id, sort, concat, phone from wh_house_info
select house_id, house_name, physical_name, geo_location, parent_id, status, dept_id,
del_flag, create_by, create_time, update_by, update_time, remark,
company_id, sort, concat, phone
from wh_house_info
</sql>
<select id="selectWhHouseInfoList" parameterType="com.bonus.material.warehouse.domain.WhHouseInfo" resultMap="WhHouseInfoResult">
@ -39,6 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="sort != null "> and sort = #{sort}</if>
<if test="concat != null and concat != ''"> and concat = #{concat}</if>
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
and del_flag = '0'
</where>
</select>
@ -59,8 +63,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="delFlag != null">del_flag,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
<if test="companyId != null">company_id,</if>
<if test="sort != null">sort,</if>
@ -77,8 +79,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="delFlag != null">#{delFlag},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
<if test="companyId != null">#{companyId},</if>
<if test="sort != null">#{sort},</if>
@ -97,8 +97,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null">status = #{status},</if>
<if test="deptId != null">dept_id = #{deptId},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>

View File

@ -1,12 +1,6 @@
#!/bin/bash
#jar_version="24.10.0-SNAPSHOT"
export deploy_path=/opt/webapps/bonus-material
#export app_workspace=/opt/builds/releases/Bonus-Cloud/${jar_version}
#export biz_workspace=/opt/install/jenkins_home/workspace/Bonus-Cloud-Material
#cp -f ${biz_workspace}/"bonus-modules/bonus-material/target/bonus-material.jar" $deploy_path
#echo "copied ${app_workspace}/${source_jar} to $deploy_path"
# Define an array of JAR files to run
jars=("bonus-material.jar --spring.config.location=file:material_bootstrap.yml")
@ -43,5 +37,4 @@ for jar in "${jars[@]}"; do
nohup /usr/local/jdk1.8.0/bin/java -jar $jar >/dev/null 2>&1 &
done
echo "All JARs have been run successfully."
echo "All JARs have been run successfully."