Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
b5bf04e682
|
|
@ -40,8 +40,13 @@ public class TreeNode {
|
|||
@ApiModelProperty(value = "实时库存")
|
||||
private Long storageNum;
|
||||
|
||||
private Long num;
|
||||
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty(value = "类型")
|
||||
private String manageType;
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||
private List<TreeNode> children = new ArrayList<>();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -347,5 +347,9 @@ public class LeaseApplyInfo extends BaseEntity{
|
|||
*/
|
||||
private List<String> projectIdList;
|
||||
|
||||
private Long parentId;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private String leaseTime;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -120,6 +120,8 @@ public class BackApplyInfoController extends BaseController {
|
|||
if (!result.isSuccess()) {
|
||||
return AjaxResult.error("SysFile文件服务上传失败:" + result.get("msg"));
|
||||
}
|
||||
//电子档案工程同步,第一次执行时间较长
|
||||
syncProject();
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, Object> jsonObject = (Map<String, Object>) result.get("data");
|
||||
|
|
@ -559,6 +561,7 @@ public class BackApplyInfoController extends BaseController {
|
|||
} catch (Exception e) {
|
||||
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, new ArrayList<>()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -573,4 +576,27 @@ public class BackApplyInfoController extends BaseController {
|
|||
}
|
||||
|
||||
/** -------出门证结束------- */
|
||||
|
||||
|
||||
/**
|
||||
* 电子档案工程同步
|
||||
*/
|
||||
public void syncProject() {
|
||||
//1、查询未同步的工程信息
|
||||
List<BackApplyInfo> list = backApplyInfoService.selectNotSyncProject();
|
||||
if (list.size()>0){
|
||||
for (BackApplyInfo backApplyInfo : list){
|
||||
//2、将所有工程信息插入archives_record_info,并返回id
|
||||
backApplyInfoService.syncProject(backApplyInfo);
|
||||
if (backApplyInfo.getId()!=null){
|
||||
//3、将返回的每个id插入archives_record_details
|
||||
backApplyInfoService.syncProjectDetails(backApplyInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -507,4 +507,10 @@ public interface BackApplyInfoMapper {
|
|||
* @return
|
||||
*/
|
||||
int delHandlingOrder(HandlingOrder bean);
|
||||
|
||||
List<BackApplyInfo> selectNotSyncProject();
|
||||
|
||||
int syncProject(BackApplyInfo backApplyInfo);
|
||||
|
||||
int syncProjectDetails(BackApplyInfo backApplyInfo2);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -242,5 +242,12 @@ public interface IBackApplyInfoService {
|
|||
* @return
|
||||
*/
|
||||
AjaxResult delHandlingOrder(HandlingOrder bean);
|
||||
|
||||
|
||||
List<BackApplyInfo> selectNotSyncProject();
|
||||
|
||||
int syncProject(BackApplyInfo backApplyInfo);
|
||||
|
||||
int syncProjectDetails(BackApplyInfo backApplyInfo);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2294,6 +2294,29 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BackApplyInfo> selectNotSyncProject() {
|
||||
return backApplyInfoMapper.selectNotSyncProject();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int syncProject(BackApplyInfo backApplyInfo) {
|
||||
return backApplyInfoMapper.syncProject(backApplyInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int syncProjectDetails(BackApplyInfo backApplyInfo) {
|
||||
BackApplyInfo backApplyInfo2 = new BackApplyInfo();
|
||||
backApplyInfo2.setId(backApplyInfo.getId());
|
||||
backApplyInfo2.setTypeName("领料单");
|
||||
backApplyInfoMapper.syncProjectDetails(backApplyInfo2);
|
||||
backApplyInfo2.setTypeName("退料单");
|
||||
backApplyInfoMapper.syncProjectDetails(backApplyInfo2);
|
||||
backApplyInfo2.setTypeName("业务联系单");
|
||||
backApplyInfoMapper.syncProjectDetails(backApplyInfo2);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理班组退料结算协议
|
||||
* @param record
|
||||
|
|
|
|||
|
|
@ -151,6 +151,13 @@ public class SelectController {
|
|||
return service.getDeviceTypeTree(dto);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "设备类型树")
|
||||
@PostMapping("getDeviceTypeTreeTwo")
|
||||
public AjaxResult getDeviceTypeTreeTwo(@RequestBody SelectDto dto){
|
||||
return service.getDeviceTypeTreeTwo(dto);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "退料设备类型树")
|
||||
@PostMapping("getBackDeviceTypeTree")
|
||||
public AjaxResult getBackDeviceTypeTree(@RequestBody SelectDto dto){
|
||||
|
|
|
|||
|
|
@ -299,4 +299,6 @@ public interface SelectMapper {
|
|||
* @return
|
||||
*/
|
||||
List<TypeTreeNode> getBzUseTypeTreeL4(BackApplyInfo bean);
|
||||
|
||||
List<TreeNode> getDeviceTypeTreeTwo(SelectDto dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -103,6 +103,8 @@ public interface SelectService {
|
|||
*/
|
||||
AjaxResult getDeviceTypeTree(SelectDto dto);
|
||||
|
||||
AjaxResult getDeviceTypeTreeTwo(SelectDto dto);
|
||||
|
||||
AjaxResult getBackDeviceTypeTree(SelectDto dto);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -433,6 +433,24 @@ public class SelectServiceImpl implements SelectService {
|
|||
return AjaxResult.success(groupList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getDeviceTypeTreeTwo(SelectDto dto) {
|
||||
List<TreeNode> groupList = new ArrayList<>();
|
||||
List<TreeNode> list = new ArrayList<>();
|
||||
try {
|
||||
list = mapper.getDeviceTypeTreeTwo(dto);
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
// 创建树形结构(数据集合作为参数)
|
||||
TreeBuild treeBuild = new TreeBuild(list);
|
||||
// 原查询结果转换树形结构
|
||||
groupList = treeBuild.buildTree();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("单位树/归属部门/所属上级-查询失败", e);
|
||||
}
|
||||
return AjaxResult.success(groupList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getBackDeviceTypeTree(SelectDto dto) {
|
||||
List<TypeTreeNode> groupList = new ArrayList<>();
|
||||
|
|
|
|||
|
|
@ -172,11 +172,7 @@ public class MachineController extends BaseController {
|
|||
@ApiOperation(value = "电子标签查询")
|
||||
@GetMapping("/getElectronicLabel")
|
||||
public AjaxResult getElectronicLabel(Machine machine) {
|
||||
try {
|
||||
return success(machineService.getElectronicLabel(machine));
|
||||
} catch (Exception e) {
|
||||
return error("系统错误, " + e.getMessage());
|
||||
}
|
||||
return machineService.getElectronicLabel(machine);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,79 @@
|
|||
package com.bonus.material.ma.controller;
|
||||
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||
import com.bonus.material.ma.domain.PutInStorageBean;
|
||||
import com.bonus.material.ma.domain.SavePutInfoDto;
|
||||
import com.bonus.material.ma.domain.SupplierInfo;
|
||||
import com.bonus.material.ma.service.WarehousingService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.java.Log;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 入库盘点
|
||||
*/
|
||||
@Api(tags = " 入库盘点")
|
||||
@RestController
|
||||
@RequestMapping("/warehousing")
|
||||
@Slf4j
|
||||
public class WarehousingController extends BaseController {
|
||||
@Autowired
|
||||
private WarehousingService warehousingService;
|
||||
|
||||
/**
|
||||
* 查询入库盘点列表
|
||||
*/
|
||||
@ApiOperation(value = "获取入库盘点列表")
|
||||
@GetMapping("/getList")
|
||||
public TableDataInfo getList(PutInStorageBean bean) {
|
||||
startPage();
|
||||
List<PutInStorageBean> list = warehousingService.getList(bean);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询供应商管理列表
|
||||
*/
|
||||
@ApiOperation(value = "查询供应商管理列表")
|
||||
@GetMapping("/supplierInfoList")
|
||||
public TableDataInfo supplierInfoList(SupplierInfo maSupplierInfo)
|
||||
{
|
||||
List<SupplierInfo> list = warehousingService.selectMaSupplierInfoList(maSupplierInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增入库盘点
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "新增入库盘点")
|
||||
@PreventRepeatSubmit
|
||||
@PostMapping("/addList")
|
||||
public AjaxResult savePutInfo(@RequestBody SavePutInfoDto dto) {
|
||||
return warehousingService.savePutInfo(dto);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据入库单号查看详情
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "根据入库单号查看详情")
|
||||
@GetMapping("/getDetail")
|
||||
public TableDataInfo getDetail(PutInStorageBean bean) {
|
||||
startPage();
|
||||
List<PutInStorageBean> list = warehousingService.getDetails(bean);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,158 @@
|
|||
package com.bonus.material.ma.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 表单类型表单集合
|
||||
* @Author ma_sh
|
||||
* @create 2024/3/28 17:53
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ApiModel("表单类型表单集合")
|
||||
public class MachIneDto {
|
||||
|
||||
/**
|
||||
* 判断为数量还是编号,true为编号
|
||||
*/
|
||||
@ApiModelProperty(value = "判断为数量还是编号,true为编号")
|
||||
private Boolean isCode;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@ApiModelProperty(value = "主键id")
|
||||
private Integer id;
|
||||
|
||||
/** 机具ID */
|
||||
@ApiModelProperty(value = "机具ID")
|
||||
private Long maId;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@ApiModelProperty(value = "主键id")
|
||||
private Integer infoId;
|
||||
|
||||
/** 设备编号 */
|
||||
@ApiModelProperty(value = "设备编号")
|
||||
private String maCode;
|
||||
|
||||
/** 二维码 */
|
||||
@ApiModelProperty(value = "二维码")
|
||||
private String qrCode;
|
||||
|
||||
|
||||
/**
|
||||
* 类型id
|
||||
*/
|
||||
@ApiModelProperty(value = "类型id")
|
||||
private String typeId;
|
||||
|
||||
/**
|
||||
* 主信息
|
||||
*/
|
||||
@ApiModelProperty(value = "主信息")
|
||||
private Integer info;
|
||||
|
||||
/** 出厂编码 */
|
||||
@ApiModelProperty(value = "出厂编码")
|
||||
private String outFacCode;
|
||||
|
||||
/** 生产厂家 */
|
||||
@ApiModelProperty(value = "生产厂家")
|
||||
private String maVender;
|
||||
|
||||
/** 本次检修日期 */
|
||||
@ApiModelProperty(value = "本次检修日期")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private Date thisCheckTime;
|
||||
|
||||
/** 下次检修日期 */
|
||||
@ApiModelProperty(value = "下次检修日期")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private Date nextCheckTime;
|
||||
|
||||
/** 单价 */
|
||||
@ApiModelProperty(value = "单价")
|
||||
private BigDecimal buyPrice;
|
||||
|
||||
/** 编码 */
|
||||
@ApiModelProperty(value = "编码")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
@ApiModelProperty(value = "创建者")
|
||||
private Long creator;
|
||||
|
||||
/**
|
||||
* 入库形式
|
||||
*/
|
||||
@ApiModelProperty(value = "入库形式")
|
||||
private String putInType;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remarks;
|
||||
|
||||
/**
|
||||
* 单位名称
|
||||
*/
|
||||
@ApiModelProperty(value = "单位名称")
|
||||
private String unitId;
|
||||
|
||||
/**
|
||||
* 工程名称
|
||||
*/
|
||||
@ApiModelProperty(value = "工程名称")
|
||||
private String proId;
|
||||
|
||||
/**
|
||||
* 表单备注
|
||||
*/
|
||||
@ApiModelProperty(value = "表单备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
@ApiModelProperty(value = "上方页面入库数量")
|
||||
private Integer num;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
@ApiModelProperty(value = "数量")
|
||||
private Integer totalNum;
|
||||
|
||||
/**
|
||||
* 检验人
|
||||
*/
|
||||
@ApiModelProperty(value = "检验人")
|
||||
private String checkMan;
|
||||
|
||||
/**
|
||||
* 入库数量
|
||||
*/
|
||||
@ApiModelProperty(value = "表单集合入库数量")
|
||||
private Integer putInStoreNum;
|
||||
|
||||
}
|
||||
|
|
@ -329,4 +329,6 @@ public class Machine extends BaseEntity {
|
|||
private int devType;
|
||||
|
||||
private String type;
|
||||
|
||||
private Integer manageType;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,101 @@
|
|||
package com.bonus.material.ma.domain;
|
||||
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @description 入库盘点
|
||||
*/
|
||||
@Data
|
||||
public class PutInStorageBean extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** id */
|
||||
@ApiModelProperty(value = "id")
|
||||
private Integer id;
|
||||
|
||||
/** 入库形式 */
|
||||
@ApiModelProperty(value = "入库形式")
|
||||
private String putInType;
|
||||
|
||||
/** 关键字 */
|
||||
@ApiModelProperty(value = "关键字")
|
||||
private String keyWord;
|
||||
|
||||
/** 入库数量 */
|
||||
@ApiModelProperty(value = "入库数量")
|
||||
private BigDecimal num;
|
||||
|
||||
/** 创建者 */
|
||||
@ApiModelProperty(value = "创建者")
|
||||
private Integer creator;
|
||||
|
||||
/** 入库人 */
|
||||
@ApiModelProperty(value = "入库人")
|
||||
private String modelName;
|
||||
|
||||
/** 盘点入库单号 */
|
||||
@ApiModelProperty(value = "盘点入库单号")
|
||||
private String kindName;
|
||||
|
||||
/** 设备编号 */
|
||||
@ApiModelProperty(value = "设备编号")
|
||||
private String maCode;
|
||||
|
||||
/** 单位ID */
|
||||
@ApiModelProperty(value = "单位ID")
|
||||
private String unitId;
|
||||
|
||||
/** 单位名称 */
|
||||
@ApiModelProperty(value = "单位名称")
|
||||
private String unitName;
|
||||
|
||||
/** 工程ID */
|
||||
@ApiModelProperty(value = "工程ID")
|
||||
private String projectId;
|
||||
|
||||
/** 工程名称 */
|
||||
@ApiModelProperty(value = "工程名称")
|
||||
private String projectName;
|
||||
|
||||
/** 创建日期 */
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private String createDate;
|
||||
|
||||
/** 备注 */
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
/** 主信息 */
|
||||
@ApiModelProperty(value = "主信息")
|
||||
private Integer info;
|
||||
|
||||
/** 库房 */
|
||||
@ApiModelProperty(value = "库房")
|
||||
private Integer ram;
|
||||
|
||||
/** 设备工器具类型 */
|
||||
@ApiModelProperty(value = "设备工器具类型")
|
||||
private Integer type;
|
||||
|
||||
/** 设备工器具类型名称 */
|
||||
@ApiModelProperty(value = "设备工器具类型名称")
|
||||
private String typeName;
|
||||
|
||||
/** 规格型号 */
|
||||
@ApiModelProperty(value = "规格型号")
|
||||
private String typeModelName;
|
||||
|
||||
/** 设备主键 */
|
||||
@ApiModelProperty(value = "设备主键")
|
||||
private Integer machine;
|
||||
|
||||
|
||||
private String code;
|
||||
|
||||
private Integer infoId;
|
||||
}
|
||||
|
|
@ -0,0 +1,124 @@
|
|||
package com.bonus.material.ma.domain;
|
||||
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 新增盘点入库接口实体类dto
|
||||
* @Author ma_sh
|
||||
* @create 2024/3/28 14:22
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ApiModel("新增盘点入库接口实体类dto")
|
||||
public class SavePutInfoDto extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 判断为数量还是编号,true为编号
|
||||
*/
|
||||
@ApiModelProperty(value = "判断为数量还是编号,true为编号")
|
||||
private Boolean isCode;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@ApiModelProperty(value = "主键id")
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 类型id
|
||||
*/
|
||||
@ApiModelProperty(value = "类型id")
|
||||
private String typeId;
|
||||
|
||||
/**
|
||||
* 主信息
|
||||
*/
|
||||
@ApiModelProperty(value = "主信息")
|
||||
private Integer info;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
@ApiModelProperty(value = "数量")
|
||||
private Integer num;
|
||||
|
||||
/**
|
||||
* 库房
|
||||
*/
|
||||
@ApiModelProperty(value = "库房")
|
||||
private Integer ram;
|
||||
|
||||
/**
|
||||
* 设备工器具类型
|
||||
*/
|
||||
@ApiModelProperty(value = "设备工器具类型")
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 设备主键
|
||||
*/
|
||||
@ApiModelProperty(value = "设备主键")
|
||||
private Integer machine;
|
||||
|
||||
/**
|
||||
* 入库形式
|
||||
*/
|
||||
@ApiModelProperty(value = "入库形式")
|
||||
private String putInType;
|
||||
|
||||
/**
|
||||
* 盘点入库单号
|
||||
*/
|
||||
@ApiModelProperty(value = "盘点入库单号")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 单位名称
|
||||
*/
|
||||
@ApiModelProperty(value = "单位名称")
|
||||
private String unitId;
|
||||
|
||||
/**
|
||||
* 工程名称
|
||||
*/
|
||||
@ApiModelProperty(value = "工程名称")
|
||||
private String proId;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
@ApiModelProperty(value = "创建者")
|
||||
private Long creator;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private String createDate;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remarks;
|
||||
|
||||
/**
|
||||
* 检验人
|
||||
*/
|
||||
@ApiModelProperty(value = "检验人")
|
||||
private String checkMan;
|
||||
|
||||
/**
|
||||
* 表单类型表单集合
|
||||
*/
|
||||
private List<MachIneDto> machIneDtoList;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package com.bonus.material.ma.domain.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 返回异常枚举类
|
||||
* @Author ma_sh
|
||||
* @create 2024/3/29 14:43
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum ExceptionEnum {
|
||||
|
||||
PARAM_NULL(1001, "参数为空"),
|
||||
IOT_CODE_DUPLICATE(1002, "设备编号重复"),
|
||||
IOT_TO_DELETE(1003, "该iot设备绑定相关类型设备,无法删除"),
|
||||
SUCCESS(200, "操作成功"),
|
||||
SAVE_TO_DATABASE(500, "新增保存失败,请联系管理员!!!"),
|
||||
DELETE_TO_DATABASE(500, "删除失败,请联系管理员!!!"),
|
||||
BIND_TO_DATABASE(500, "绑定失败,请联系管理员!!!"),
|
||||
UN_BIND_TO_DATABASE(500, "解绑失败,请联系管理员!!!"),
|
||||
UPDATE_TO_DATABASE(500, "修改失败,请联系管理员!!!"),
|
||||
|
||||
RETURN_DATA_IS_EMPTY(501, "返回数据为空!!"),
|
||||
IOT_ENCODING_ERROR(502, "输入的IOT编码有误,请输入正确的编码!!!");
|
||||
|
||||
private Integer code;
|
||||
|
||||
private String msg;
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package com.bonus.material.ma.domain.vo;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* 后端生产随机编码通用方法(格式:今日年月日日期-随机4位编码 20240328-0001)
|
||||
* @Author ma_sh
|
||||
* @create 2024/3/28 17:42
|
||||
*/
|
||||
public class FieldGenerator {
|
||||
|
||||
public static String generateField() {
|
||||
LocalDate today = LocalDate.now();
|
||||
String currentDate = today.format(DateTimeFormatter.ofPattern("yyyyMMdd"));
|
||||
// 生成UUID并取后4位,转换为纯数字类型
|
||||
String uuid = UUID.randomUUID().toString().replaceAll("-", "");
|
||||
String uuidLast4Digits = uuid.substring(uuid.length() - 7);
|
||||
int uuidLast4DigitsNumeric = Integer.parseInt(uuidLast4Digits, 16);
|
||||
return currentDate + "-" + String.format("%07d", uuidLast4DigitsNumeric % 10000);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package com.bonus.material.ma.domain.vo;
|
||||
|
||||
/**
|
||||
* @Author:梁超
|
||||
* @date:2024/1/30 - 14:09
|
||||
*/
|
||||
public class GlobalContants {
|
||||
public static final int NUM1 = 9;
|
||||
public static final int NUM2 = 100;
|
||||
public static final int NUM3 = 99;
|
||||
public static final int NUM4 = 1000;
|
||||
|
||||
public static final int NUM5 = 68;
|
||||
public static final int NUM6 = 24;
|
||||
}
|
||||
|
|
@ -204,4 +204,12 @@ public interface MachineMapper
|
|||
List<Machine> getElectronicLabelByWsMaInfo(Machine machine);
|
||||
|
||||
List<Machine> getHisByCodeNewByWsMaInfo(Machine machine);
|
||||
|
||||
LeaseApplyInfo getLeaseParentId(Machine machine);
|
||||
|
||||
LeaseApplyInfo getLeaseUnitAndProject(LeaseApplyInfo leaseInfo);
|
||||
|
||||
LeaseApplyInfo getBackParentId(Machine machine);
|
||||
|
||||
LeaseApplyInfo getBackUnitAndProject(LeaseApplyInfo leaseInfoBack);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,71 @@
|
|||
package com.bonus.material.ma.mapper;
|
||||
|
||||
|
||||
import com.bonus.material.ma.domain.MachIneDto;
|
||||
import com.bonus.material.ma.domain.PutInStorageBean;
|
||||
import com.bonus.material.ma.domain.SupplierInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 入库盘点
|
||||
* @author hay
|
||||
* @date 2024/3/27 13:33
|
||||
*/
|
||||
@Mapper
|
||||
public interface WarehousingMapper {
|
||||
|
||||
/**
|
||||
* 查询入库盘点列表
|
||||
* @param bean
|
||||
* @return 结果
|
||||
*/
|
||||
List<PutInStorageBean> getList(PutInStorageBean bean);
|
||||
|
||||
|
||||
List<SupplierInfo> selectMaSupplierInfoList(SupplierInfo maSupplierInfo);
|
||||
|
||||
|
||||
int selectByMaCode(String maCode);
|
||||
|
||||
/**
|
||||
* 插入ma_type_put_in_storage_info表
|
||||
* @param machIneDto
|
||||
* @return
|
||||
*/
|
||||
int saveInfo(MachIneDto machIneDto);
|
||||
|
||||
/**
|
||||
* 新增ma_machine表
|
||||
* @param machIneDto
|
||||
* @return
|
||||
*/
|
||||
int insertMachine(MachIneDto machIneDto);
|
||||
|
||||
/**
|
||||
* 新增ma_type_put_in_storage_details表
|
||||
* @param machIneDto
|
||||
* @return
|
||||
*/
|
||||
Integer saveDetails(MachIneDto machIneDto);
|
||||
|
||||
/**
|
||||
* 查询
|
||||
* @param nowDate
|
||||
* @return
|
||||
*/
|
||||
int selectTaskNumByMonth(@Param("date") Date nowDate);
|
||||
|
||||
/**
|
||||
* 更新matype表中num数量
|
||||
* @param typeId
|
||||
* @param num
|
||||
* @return
|
||||
*/
|
||||
int updateMaType(@Param("typeId") String typeId, @Param("num") Integer num);
|
||||
|
||||
List<PutInStorageBean> getDetails(PutInStorageBean bean);
|
||||
}
|
||||
|
|
@ -84,7 +84,7 @@ public interface IMachineService
|
|||
* @param machine
|
||||
* @return
|
||||
*/
|
||||
List<Machine> getElectronicLabel(Machine machine);
|
||||
AjaxResult getElectronicLabel(Machine machine);
|
||||
|
||||
/**
|
||||
* 根据标签信息查询出库单
|
||||
|
|
|
|||
|
|
@ -0,0 +1,43 @@
|
|||
package com.bonus.material.ma.service;
|
||||
|
||||
|
||||
|
||||
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.material.ma.domain.PutInStorageBean;
|
||||
import com.bonus.material.ma.domain.SavePutInfoDto;
|
||||
import com.bonus.material.ma.domain.SupplierInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 入库盘点
|
||||
* @author hay
|
||||
* @date 2024/3/27 13:31
|
||||
*/
|
||||
public interface WarehousingService {
|
||||
|
||||
/**
|
||||
* 查询入库盘点列表
|
||||
* @param bean
|
||||
* @return 结果
|
||||
*/
|
||||
List<PutInStorageBean> getList(PutInStorageBean bean);
|
||||
|
||||
List<SupplierInfo> selectMaSupplierInfoList(SupplierInfo maSupplierInfo);
|
||||
|
||||
/**
|
||||
* 新增入库盘点
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
AjaxResult savePutInfo(SavePutInfoDto dto);
|
||||
|
||||
|
||||
/**
|
||||
* 根据入库单号查看详情
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<PutInStorageBean> getDetails(PutInStorageBean bean);
|
||||
}
|
||||
|
|
@ -1,6 +1,8 @@
|
|||
package com.bonus.material.ma.service.impl;
|
||||
|
||||
import java.time.ZoneId;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
|
@ -207,8 +209,9 @@ public class MachineServiceImpl implements IMachineService
|
|||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<Machine> getElectronicLabel(Machine machine) {
|
||||
public AjaxResult getElectronicLabel(Machine machine) {
|
||||
List<Machine> list = new ArrayList<>();
|
||||
int type = 0;
|
||||
try {
|
||||
if (machine.getDevType()==1){
|
||||
//查询ws_ma_info,工器具
|
||||
|
|
@ -217,6 +220,18 @@ public class MachineServiceImpl implements IMachineService
|
|||
//查询ma_machine表,安全工器具
|
||||
list = machineMapper.getElectronicLabel(machine);
|
||||
}
|
||||
for (Machine dto : list){
|
||||
Date nextCheckTime = dto.getNextCheckTime();
|
||||
Date todayStart = new Date(); // 获取当前时间
|
||||
// 将 todayStart 设置为当天的开始时间(00:00:00)
|
||||
todayStart = Date.from(todayStart.toInstant().atZone(ZoneId.systemDefault())
|
||||
.withHour(0).withMinute(0).withSecond(0).withNano(0)
|
||||
.toInstant());
|
||||
if (nextCheckTime != null && nextCheckTime.before(todayStart)) {
|
||||
type=1;
|
||||
throw new RuntimeException("该工器具已临近下次检验时间,请及时退还至机具(物流)分公司!");
|
||||
}
|
||||
}
|
||||
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
for (Machine dto : list) {
|
||||
|
|
@ -237,9 +252,13 @@ public class MachineServiceImpl implements IMachineService
|
|||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
return AjaxResult.success(list);
|
||||
} catch (Exception e){
|
||||
return new ArrayList<>();
|
||||
if (type==1){
|
||||
return AjaxResult.error("该工器具已临近下次检验时间,请及时退还至机具(物流)分公司!");
|
||||
} else {
|
||||
return AjaxResult.success(new ArrayList<>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -338,8 +357,36 @@ public class MachineServiceImpl implements IMachineService
|
|||
Machine checkNum = machineMapper.getCheckNumByQrcode(machine);
|
||||
//报废时间
|
||||
Machine scrapTime = machineMapper.getScrapTimeByQrcode(machine);
|
||||
//3根据机具id查询领退工程
|
||||
Machine leaseInfo = machineMapper.getLeaseInfoByQrcode(machine);
|
||||
// //3根据机具id查询领退工程
|
||||
// Machine leaseInfo = machineMapper.getLeaseInfoByQrcode(machine);
|
||||
|
||||
// 根据maid查询领料任务
|
||||
LeaseApplyInfo leaseInfo = machineMapper.getLeaseParentId(machine);
|
||||
if (leaseInfo.getParentId() == null){
|
||||
baseInfo.setLeaseTime(null);
|
||||
baseInfo.setLeaseUnit(null);
|
||||
baseInfo.setLeaseProject(null);
|
||||
}else{
|
||||
LeaseApplyInfo leaseDetail = machineMapper.getLeaseUnitAndProject(leaseInfo);
|
||||
baseInfo.setLeaseTime(String.valueOf(leaseDetail.getLeaseTime()));
|
||||
baseInfo.setLeaseUnit(leaseDetail.getUnitName());
|
||||
baseInfo.setLeaseProject(leaseDetail.getProjectName());
|
||||
}
|
||||
|
||||
// 根据maid查询退料任务
|
||||
LeaseApplyInfo leaseInfoBack = machineMapper.getBackParentId(machine);
|
||||
if (leaseInfoBack.getParentId() == null){
|
||||
baseInfo.setBackTime(null);
|
||||
baseInfo.setBackUnit(null);
|
||||
baseInfo.setBackProject(null);
|
||||
}else{
|
||||
LeaseApplyInfo leaseDetailBack = machineMapper.getBackUnitAndProject(leaseInfoBack);
|
||||
baseInfo.setBackTime(String.valueOf(leaseDetailBack.getLeaseTime()));
|
||||
baseInfo.setBackUnit(leaseDetailBack.getUnitName());
|
||||
baseInfo.setBackProject(leaseDetailBack.getProjectName());
|
||||
}
|
||||
|
||||
|
||||
if (inTime != null){
|
||||
Integer taskId = inTime.getTaskId();
|
||||
if(taskId != null){
|
||||
|
|
@ -368,14 +415,6 @@ public class MachineServiceImpl implements IMachineService
|
|||
baseInfo.setScrapTime("暂无");
|
||||
}
|
||||
|
||||
if(leaseInfo != null){
|
||||
baseInfo.setLeaseTime(leaseInfo.getLeaseTime());
|
||||
baseInfo.setLeaseUnit(leaseInfo.getLeaseUnit());
|
||||
baseInfo.setLeaseProject(leaseInfo.getLeaseProject());
|
||||
baseInfo.setBackTime(leaseInfo.getBackTime());
|
||||
baseInfo.setBackUnit(leaseInfo.getBackUnit());
|
||||
baseInfo.setBackProject(leaseInfo.getBackProject());
|
||||
}
|
||||
return success(baseInfo);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,284 @@
|
|||
package com.bonus.material.ma.service.impl;
|
||||
|
||||
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import com.bonus.common.core.utils.StringUtils;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.material.ma.domain.MachIneDto;
|
||||
import com.bonus.material.ma.domain.PutInStorageBean;
|
||||
import com.bonus.material.ma.domain.SavePutInfoDto;
|
||||
import com.bonus.material.ma.domain.SupplierInfo;
|
||||
import com.bonus.material.ma.domain.vo.ExceptionEnum;
|
||||
import com.bonus.material.ma.domain.vo.FieldGenerator;
|
||||
import com.bonus.material.ma.domain.vo.GlobalContants;
|
||||
import com.bonus.material.ma.mapper.WarehousingMapper;
|
||||
import com.bonus.material.ma.service.WarehousingService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author hay
|
||||
* @description 入库盘点
|
||||
* @date 2024/3/27 13:32
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class WarehousingServiceImpl implements WarehousingService {
|
||||
|
||||
@Autowired
|
||||
private WarehousingMapper warehousingMapper;
|
||||
|
||||
// @Autowired
|
||||
// private PurchaseInputMapper purchaseInputMapper;
|
||||
|
||||
/**
|
||||
* 查询入库盘点列表
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<PutInStorageBean> getList(PutInStorageBean bean) {
|
||||
return warehousingMapper.getList(bean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SupplierInfo> selectMaSupplierInfoList(SupplierInfo maSupplierInfo)
|
||||
{
|
||||
return warehousingMapper.selectMaSupplierInfoList(maSupplierInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成code编码
|
||||
* @return
|
||||
*/
|
||||
public String genderBackCode() {
|
||||
log.info("enter method genderBackCode");
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
|
||||
Date nowDate = DateUtils.getNowDate();
|
||||
String format = dateFormat.format(nowDate);
|
||||
int taskNum = warehousingMapper.selectTaskNumByMonth(nowDate) + 1;
|
||||
String code = "";
|
||||
if (taskNum > GlobalContants.NUM1 && taskNum < GlobalContants.NUM2) {
|
||||
code = "PD" + format + "-00" + taskNum;
|
||||
} else if (taskNum > GlobalContants.NUM3 && taskNum < GlobalContants.NUM4) {
|
||||
code = "PD" + format + "-0" + taskNum;
|
||||
} else {
|
||||
code = "PD" + format + "-000" + taskNum;
|
||||
}
|
||||
log.info("end method genderBackCode" + code);
|
||||
return code;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增入库盘点
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult savePutInfo(SavePutInfoDto dto) {
|
||||
log.info("新增入库盘点入参dto:{}", dto);
|
||||
Long userId = SecurityUtils.getLoginUser().getUserid();
|
||||
dto.setCreator(userId);
|
||||
String code = genderBackCode();
|
||||
List<MachIneDto> machIneDtoList = dto.getMachIneDtoList();
|
||||
//判断提交表单中是否存在相同编码
|
||||
for (int i = 0; i < machIneDtoList.size() - 1; i++) {
|
||||
for (int j = i + 1; j < machIneDtoList.size(); j++) {
|
||||
if (StringUtils.isNotEmpty(machIneDtoList.get(i).getMaCode()) && StringUtils.isNotEmpty(machIneDtoList.get(j).getMaCode())
|
||||
&& machIneDtoList.get(i).getMaCode().equals(machIneDtoList.get(j).getMaCode())) {
|
||||
throw new ServiceException("列表中包含以下相同的设备编码,请修改后重新提交:" + machIneDtoList.get(i).getMaCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
//判断提交中设备编码是否与库中相同
|
||||
if (CollectionUtils.isNotEmpty(machIneDtoList)) {
|
||||
for (MachIneDto machIneDto : machIneDtoList) {
|
||||
if (StringUtils.isNotBlank(machIneDto.getMaCode())) {
|
||||
int count = selectByMaCode(machIneDto.getMaCode());
|
||||
if (count != 0) {
|
||||
throw new ServiceException("以下设备编码与库中数据存在重复,请修改后重新提交:" + machIneDto.getMaCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
int res;
|
||||
try {
|
||||
//1. 判断是数量还是编号入库,保存到不同表
|
||||
//1.1 如果是编号入库
|
||||
if (dto.getIsCode()) {
|
||||
res = insertMaMachineInfo(dto, code);
|
||||
if (res == 0) {
|
||||
log.error("insertMaMachineInfo方法插入异常");
|
||||
throw new RuntimeException("insertMaMachineInfo方法插入异常");
|
||||
}
|
||||
//去修改ma_type里面的库存num,根据前端传的数量追加
|
||||
res = updateMaTypeInfo(dto.getTypeId(), dto.getNum());
|
||||
if (res == 0) {
|
||||
log.error("updateMaTypeInfo方法修改异常");
|
||||
throw new RuntimeException("updateMaTypeInfo方法修改异常");
|
||||
}
|
||||
} else {
|
||||
//2.插入ma_type_put_in_storage_info表和ma_type_put_in_storage_details表
|
||||
res = insertPutInfo(dto, code);
|
||||
if (res == 0) {
|
||||
log.error("insertPutInfo方法插入异常");
|
||||
throw new RuntimeException("insertPutInfo方法插入异常");
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("保存入库盘点异常:{}",e.getMessage());
|
||||
// 添加事务回滚逻辑,保证入库全部成功或者全部失败
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
return AjaxResult.error(ExceptionEnum.SAVE_TO_DATABASE.getCode(), ExceptionEnum.SAVE_TO_DATABASE.getMsg());
|
||||
}
|
||||
return AjaxResult.success(res);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据设备编码code查重
|
||||
* @param maCode
|
||||
* @return
|
||||
*/
|
||||
private int selectByMaCode(String maCode) {
|
||||
return warehousingMapper.selectByMaCode(maCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编号新增,插入ma_machine、ma_machine_label和ma_label_bind
|
||||
* @param dto
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
private int insertMaMachineInfo(SavePutInfoDto dto, String code) {
|
||||
int res = 0;
|
||||
if (dto.getNum() != null) {
|
||||
MachIneDto machIneDto = dto.getMachIneDtoList().get(0);
|
||||
machIneDto.setCode(code);
|
||||
machIneDto.setPutInType(dto.getPutInType());
|
||||
machIneDto.setCreator(dto.getCreator());
|
||||
machIneDto.setNum(dto.getNum());
|
||||
machIneDto.setIsCode(dto.getIsCode());
|
||||
machIneDto.setTypeId(dto.getTypeId());
|
||||
machIneDto.setUnitId(dto.getUnitId());
|
||||
machIneDto.setProId(dto.getProId());
|
||||
machIneDto.setRemarks(dto.getRemarks());
|
||||
res += insertInfo(machIneDto);
|
||||
machIneDto.setInfoId(machIneDto.getId());
|
||||
}
|
||||
for (int i = 0; i < dto.getMachIneDtoList().size(); i++) {
|
||||
MachIneDto machIneDto = dto.getMachIneDtoList().get(i);
|
||||
machIneDto.setCode(code);
|
||||
machIneDto.setIsCode(dto.getIsCode());
|
||||
machIneDto.setTypeId(dto.getTypeId());
|
||||
machIneDto.setCreator(dto.getCreator());
|
||||
machIneDto.setPutInType(dto.getPutInType());
|
||||
machIneDto.setNum(dto.getNum());
|
||||
machIneDto.setCheckMan(dto.getCheckMan());
|
||||
machIneDto.setInfoId(dto.getMachIneDtoList().get(0).getInfoId());
|
||||
res += insertMachineInfo(machIneDto);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 插入ma_type_put_in_storage_info表,返回主键id
|
||||
* @param machIneDto
|
||||
* @return
|
||||
*/
|
||||
private int insertInfo(MachIneDto machIneDto) {
|
||||
return warehousingMapper.saveInfo(machIneDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 方法抽取,保持到ma_machine、ma_machine_label和ma_label_bind
|
||||
* @param machIneDto
|
||||
* @return
|
||||
*/
|
||||
private int insertMachineInfo(MachIneDto machIneDto) {
|
||||
int res = warehousingMapper.insertMachine(machIneDto);
|
||||
|
||||
res += insertTypePutInStorageInfo(machIneDto);
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 方法抽取
|
||||
* @param machIneDto
|
||||
* @return
|
||||
*/
|
||||
private int insertTypePutInStorageInfo(MachIneDto machIneDto) {
|
||||
//ma_type_put_in_storage_details表
|
||||
return warehousingMapper.saveDetails(machIneDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 方法抽取,追加ma_type表里面的num
|
||||
* @param typeId
|
||||
* @param num
|
||||
* @return
|
||||
*/
|
||||
private int updateMaTypeInfo(String typeId, Integer num) {
|
||||
return warehousingMapper.updateMaType(typeId, num);
|
||||
}
|
||||
|
||||
/**
|
||||
* 插入表方法
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
private int insertPutInfo(SavePutInfoDto dto, String code) {
|
||||
int res = 0;
|
||||
Integer total = dto.getMachIneDtoList().stream()
|
||||
.map(MachIneDto::getPutInStoreNum)
|
||||
.filter(num -> num != null)
|
||||
.collect(Collectors.summingInt(Integer::intValue));
|
||||
if (CollectionUtils.isNotEmpty(dto.getMachIneDtoList())) {
|
||||
MachIneDto machIneDto = dto.getMachIneDtoList().get(0);
|
||||
machIneDto.setCode(code);
|
||||
machIneDto.setPutInType(dto.getPutInType());
|
||||
machIneDto.setCreator(dto.getCreator());
|
||||
machIneDto.setIsCode(dto.getIsCode());
|
||||
machIneDto.setTotalNum(total);
|
||||
machIneDto.setRemarks(dto.getRemarks());
|
||||
res += insertInfo(machIneDto);
|
||||
machIneDto.setInfoId(machIneDto.getId());
|
||||
}
|
||||
for (int i = 0; i < dto.getMachIneDtoList().size(); i++) {
|
||||
MachIneDto machIneDto = dto.getMachIneDtoList().get(i);
|
||||
machIneDto.setCreator(dto.getCreator());
|
||||
machIneDto.setPutInType(dto.getPutInType());
|
||||
machIneDto.setRemarks(dto.getRemarks());
|
||||
machIneDto.setCode(code);
|
||||
machIneDto.setInfoId(dto.getMachIneDtoList().get(0).getInfoId());
|
||||
res += insertTypePutInStorageInfo(machIneDto);
|
||||
//根据类型追加ma_type表里面的num
|
||||
res += updateMaTypeInfo(machIneDto.getTypeId(), machIneDto.getPutInStoreNum());
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据入库单号查看详情
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<PutInStorageBean> getDetails(PutInStorageBean bean) {
|
||||
return warehousingMapper.getDetails(bean);
|
||||
}
|
||||
}
|
||||
|
|
@ -72,6 +72,11 @@ public interface RepairApplyDetailsMapper {
|
|||
*/
|
||||
public int deleteRepairApplyDetailsByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 批量根据维修ID数组查询维修任务单号
|
||||
*/
|
||||
List<RepairAuditDetails> selectRepairCodeByIds(@Param("list") List<Long> list);
|
||||
|
||||
/**
|
||||
* 根据维修ID查询维修任务单号
|
||||
* @param repairId
|
||||
|
|
@ -102,6 +107,11 @@ public interface RepairApplyDetailsMapper {
|
|||
*/
|
||||
int updateRepairApplyDetailsAfterAudit(RepairAuditDetails dto);
|
||||
|
||||
/**
|
||||
* 批量修改repair_apply_record维修任务详情状态
|
||||
*/
|
||||
int updateRepairApplyDetailsAfterAuditBatch(@Param("list") List<RepairAuditDetails> list);
|
||||
|
||||
/**
|
||||
* 根据back_id获取最大level
|
||||
* @param backId
|
||||
|
|
|
|||
|
|
@ -603,21 +603,10 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
|||
level = details.getLevel();
|
||||
}
|
||||
}
|
||||
/*if (Objects.nonNull(preTmTaskInfo) && Objects.nonNull(preTmTaskInfo.getPreTaskId())) {
|
||||
taskMapper.updateTaskStatus(String.valueOf(preTmTaskInfo.getPreTaskId()), RepairTaskStatusEnum.TASK_STATUS_PROCESSING.getStatus());
|
||||
}*/
|
||||
// 根据taskId查询维修审核明细
|
||||
final List<RepairAuditDetails> repairAuditDetailsByTaskId = repairAuditDetailsMapper.selectRepairAuditDetailsByTaskId(auditDetails.getTaskId());
|
||||
if (!CollectionUtils.isEmpty(repairAuditDetailsByTaskId)) {
|
||||
for (RepairAuditDetails repairAuditDetail : repairAuditDetailsByTaskId) {
|
||||
/*if ("1".equals(repairAuditDetail.getStatus()) || "2".equals(repairAuditDetail.getStatus())) {
|
||||
continue;
|
||||
}
|
||||
// 根据查询详情获取的维修ID,更新scrap_apply_details维修数量
|
||||
repairApplyDetailsMapper.updateRepairApplyDetailsAfterReject(
|
||||
ObjectUtils.defaultIfNull(repairAuditDetail.getRepairedNum(),0).longValue(),
|
||||
ObjectUtils.defaultIfNull(repairAuditDetail.getScrapNum(),0).longValue(), repairAuditDetail.getRepairId());
|
||||
repairApplyDetailsMapper.updateStatus(repairAuditDetail.getRepairId(), RepairTaskStatusEnum.TASK_STATUS_PROCESSING.getStatus());*/
|
||||
RepairTaskDetails repairTaskDetails = new RepairTaskDetails();
|
||||
repairTaskDetails.setNewTaskId(newTaskId);
|
||||
repairTaskDetails.setMaId(repairAuditDetail.getMaId() == null ? null : repairAuditDetail.getMaId().toString());
|
||||
|
|
@ -785,6 +774,12 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量插入维修明细
|
||||
* @param scrapApplyDetailList 报废明细
|
||||
* @param repairAuditDetailsByQuery 维修明细by查询
|
||||
* @param agreementId 协议ID
|
||||
*/
|
||||
private void batchInsertRepairInputDetails(List<ScrapApplyDetails> scrapApplyDetailList, List<RepairAuditDetails> repairAuditDetailsByQuery, Long agreementId) {
|
||||
boolean inputFlag = false;
|
||||
boolean scrapFlag = false;
|
||||
|
|
@ -803,7 +798,9 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
|||
//插入修饰审核入库任务表
|
||||
Long newTaskId = null;
|
||||
if (inputFlag) {
|
||||
// 插入任务表
|
||||
newTaskId = insertTt();
|
||||
// 插入任务协议关联表
|
||||
insertTta(newTaskId, agreementId);
|
||||
}
|
||||
//插入报废任务表
|
||||
|
|
@ -813,11 +810,37 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
|||
insertScrapTta(newScrapTaskId, agreementId);
|
||||
}
|
||||
final List<RepairInputDetails> inputList = new ArrayList<>();
|
||||
|
||||
List<RepairAuditDetails> dtoArray = new ArrayList<>();
|
||||
List<ScrapApplyDetails> listAll = new ArrayList<>();
|
||||
if (CollectionUtil.isNotEmpty(repairAuditDetailsByQuery)) {
|
||||
dtoArray = repairApplyDetailsMapper.selectRepairCodeByIds(repairAuditDetailsByQuery.stream().map(RepairAuditDetails::getRepairId).collect(Collectors.toList()));
|
||||
repairApplyDetailsMapper.updateRepairApplyDetailsAfterAuditBatch(repairAuditDetailsByQuery);
|
||||
listAll = scrapApplyDetailsMapper.selectScrapByTaskIdList(repairAuditDetailsByQuery);
|
||||
}
|
||||
|
||||
for (final RepairAuditDetails details : repairAuditDetailsByQuery) {
|
||||
RepairAuditDetails dto = repairApplyDetailsMapper.selectById(details.getRepairId());
|
||||
// 根据taskId修改repair_apply_record的status状态为已审核1
|
||||
repairApplyDetailsMapper.updateRepairApplyDetailsAfterAudit(dto);
|
||||
List<ScrapApplyDetails> list = scrapApplyDetailsMapper.selectScrapByTaskId(dto);
|
||||
RepairAuditDetails dto;
|
||||
if (CollectionUtil.isEmpty(dtoArray)) {
|
||||
dto = repairApplyDetailsMapper.selectById(details.getRepairId());
|
||||
// 根据taskId修改repair_apply_record的status状态为已审核1
|
||||
repairApplyDetailsMapper.updateRepairApplyDetailsAfterAudit(dto);
|
||||
} else {
|
||||
dto = dtoArray.stream().filter(dto1 -> dto1.getRepairId().equals(details.getRepairId())).findFirst().orElse(null);
|
||||
}
|
||||
|
||||
List<ScrapApplyDetails> list;
|
||||
if (CollectionUtil.isNotEmpty(listAll)) {
|
||||
list = listAll.stream().filter(item -> {
|
||||
if (dto != null) {
|
||||
return item.getTaskId().equals(dto.getTaskId());
|
||||
}
|
||||
return false;
|
||||
}).collect(Collectors.toList());
|
||||
} else {
|
||||
list = scrapApplyDetailsMapper.selectScrapByTaskId(dto);
|
||||
}
|
||||
|
||||
if (details.getRepairedNum().compareTo(BigDecimal.ZERO) > 0) {
|
||||
//修改机具状态为修试后待入库
|
||||
if (null != details.getMaId()) {
|
||||
|
|
|
|||
|
|
@ -119,6 +119,11 @@ public interface ScrapApplyDetailsMapper {
|
|||
*/
|
||||
List<ScrapApplyDetails> selectScrapByTaskId(RepairAuditDetails dto);
|
||||
|
||||
/**
|
||||
* 批量根据任务id数组查询报废详情
|
||||
*/
|
||||
List<ScrapApplyDetails> selectScrapByTaskIdList(@Param("list") List<RepairAuditDetails> list);
|
||||
|
||||
/**
|
||||
* 台账审核
|
||||
* @param scrapApplyDetails
|
||||
|
|
|
|||
|
|
@ -1445,9 +1445,6 @@ public class SltAgreementInfoController extends BaseController {
|
|||
@ApiOperation(value = "未结算报表list查询")
|
||||
@GetMapping("/getSltReportList")
|
||||
public TableDataInfo getSltReportList(SltAgreementInfo query) {
|
||||
// ----------- 定义返回集合 ------------
|
||||
List<SltInfoVo> resultList = new ArrayList<>();
|
||||
|
||||
try {
|
||||
// ----------- 查询列表 ---------------
|
||||
List<SltAgreementInfo> list = sltAgreementInfoService.getSltReportList(query);
|
||||
|
|
@ -1457,12 +1454,14 @@ public class SltAgreementInfoController extends BaseController {
|
|||
// 设置结算权限,控制展示
|
||||
list.forEach(info -> info.setSettlementType(settlementType));
|
||||
|
||||
// --------- 定义返回集合 ------------------
|
||||
List<SltInfoVo> dataList = new ArrayList<>();
|
||||
SltInfoVo bean = new SltInfoVo();
|
||||
// --------- 拿到list中所有的agreementId存成集合,给每个info赋值 ------------------
|
||||
List<Long> AgreementIdsArray = list.stream().map(SltAgreementInfo::getAgreementId).collect(Collectors.toList());
|
||||
|
||||
// 把每个对象的agreementId设置成集合,避免重复查询
|
||||
list.forEach(info -> {
|
||||
info.setAgreementIds(list.stream().map(SltAgreementInfo::getAgreementId).collect(Collectors.toList()));
|
||||
info.setAgreementIds(AgreementIdsArray);
|
||||
SltInfoVo vo = sltAgreementInfoService.getSltInfoReportBatch(info);
|
||||
if (vo != null && !ObjectUtil.isEmpty(vo)) {
|
||||
vo.setAgreementId(info.getAgreementId());
|
||||
|
|
|
|||
|
|
@ -796,6 +796,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
insert into bm_exit_permit (material,name,car_code,add_date,create_by,create_time)
|
||||
values (#{material}, #{name}, #{carCode}, #{addDate}, #{createBy}, now())
|
||||
</insert>
|
||||
<insert id="syncProject" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO archives_record_info
|
||||
(
|
||||
parent_id,`level`,archives_value,archives_name,del_flag,create_time
|
||||
) VALUES (
|
||||
'22','2',#{proId},#{proName},'0',NOW()
|
||||
)
|
||||
</insert>
|
||||
<insert id="syncProjectDetails">
|
||||
INSERT INTO archives_record_details
|
||||
(
|
||||
info_id,parent_id,`level`,doc_name,doc_type,del_flag,create_time
|
||||
) VALUES (
|
||||
#{id},'0','1',#{typeName},'文件夹','0',NOW()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<delete id="deleteBackApply">
|
||||
delete from back_apply_info where id = #{id}
|
||||
|
|
@ -1558,4 +1574,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
from sys_user su
|
||||
where su.user_id = 474 and su.del_flag = 0
|
||||
</select>
|
||||
<select id="selectNotSyncProject" resultType="com.bonus.material.back.domain.BackApplyInfo">
|
||||
SELECT
|
||||
pro_id as proId,
|
||||
pro_name as proName
|
||||
FROM
|
||||
bm_project
|
||||
WHERE
|
||||
del_flag='0'
|
||||
and pro_id not in (
|
||||
SELECT
|
||||
archives_value
|
||||
FROM
|
||||
archives_record_info
|
||||
WHERE
|
||||
parent_id='22'
|
||||
and archives_value is not null
|
||||
)
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -903,4 +903,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
GROUP BY
|
||||
mt.type_id
|
||||
</select>
|
||||
<select id="getDeviceTypeTreeTwo" resultType="com.bonus.common.biz.domain.TreeNode">
|
||||
SELECT mt.type_id AS id,
|
||||
mt.type_name AS label,
|
||||
mt.parent_id AS parentId,
|
||||
mt.unit_name AS unitName,
|
||||
mt.storage_num as num,
|
||||
mt.model_code AS modelCode,
|
||||
mt.manage_type AS manageType
|
||||
FROM ma_type mt
|
||||
WHERE mt.del_flag = '0'
|
||||
<if test="level!=null and level!=''">
|
||||
<if test="level == 2">
|
||||
AND mt.level IN ('1','2')
|
||||
</if>
|
||||
<if test="level == 3">
|
||||
AND mt.level IN ('1','2','3')
|
||||
</if>
|
||||
<if test="level == 4">
|
||||
AND mt.level IN ('1','2','3','4')
|
||||
</if>
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -490,8 +490,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
mi.ma_name as materialName,
|
||||
mi.ma_model as materialModel,
|
||||
mi.ma_code as maCode,
|
||||
mi.this_check_time as thisCheckTime,
|
||||
mi.next_check_time as nextCheckTime,
|
||||
LEFT(mi.this_check_time, 10) AS thisCheckTime,
|
||||
LEFT(mi.next_check_time, 10) AS nextCheckTime,
|
||||
mi.repair_man as repairMan,
|
||||
mi.check_man as checkMan,
|
||||
mi.phone,
|
||||
|
|
@ -500,15 +500,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
'1' as devType
|
||||
FROM
|
||||
ws_ma_info mi
|
||||
WHERE mi.ma_code LIKE CONCAT('%',#{maCode},'%') and mi.is_active = 1 and DATEDIFF(mi.next_check_time,NOW()) > 0
|
||||
WHERE mi.ma_code LIKE CONCAT('%',#{maCode},'%') and mi.is_active = 1
|
||||
UNION
|
||||
SELECT
|
||||
mm.ma_id AS id,
|
||||
mt2.type_name as maName,
|
||||
mt.type_name as maModel,
|
||||
mm.ma_code as maCode,
|
||||
mm.this_check_time as thisCheckTime,
|
||||
mm.next_check_time as nextCheckTime,
|
||||
LEFT(mm.this_check_time, 10) AS thisCheckTime,
|
||||
LEFT(mm.next_check_time, 10) AS nextCheckTime,
|
||||
mm.check_man as repairMan,
|
||||
ifnull(mm.inspect_man,"高民") as checkMan,
|
||||
"0551-63703966" as phone,
|
||||
|
|
@ -518,7 +518,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
FROM ma_machine mm
|
||||
LEFT JOIN ma_type mt on mm.type_id = mt.type_id
|
||||
LEFT JOIN ma_type mt2 on mt.parent_id = mt2.type_id
|
||||
WHERE mm.ma_code LIKE CONCAT('%',#{maCode},'%') and mt.MANAGE_TYPE =0 and DATEDIFF(mm.next_check_time,NOW()) > 0
|
||||
WHERE mm.ma_code LIKE CONCAT('%',#{maCode},'%') and mt.MANAGE_TYPE =0
|
||||
</select>
|
||||
|
||||
<delete id="deleteMachineByMaCodeAndTypeId">
|
||||
|
|
@ -807,6 +807,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
mm.check_man as checkMan,
|
||||
mm.this_check_time as thisCheckTime,
|
||||
mm.next_check_time as nextCheckTime,
|
||||
mt.manage_type as manageType,
|
||||
mm.in_out_num as inOutNum,
|
||||
mt.jiju_type as jiJuType,
|
||||
mt.is_check as isCheck,
|
||||
|
|
@ -838,6 +839,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
wmi.check_man as checkMan,
|
||||
wmi.this_check_time as thisCheckTime,
|
||||
wmi.next_check_time as nextCheckTime,
|
||||
1 as manageType,
|
||||
'' as inOutNum,
|
||||
'1' as jiJuType,
|
||||
'' as isCheck,
|
||||
|
|
@ -900,4 +902,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="maId != null">and wmi.id = #{maId}</if>
|
||||
LIMIT 100
|
||||
</select>
|
||||
<select id="getLeaseParentId" resultType="com.bonus.common.biz.domain.lease.LeaseApplyInfo">
|
||||
select parent_id as parentId from lease_out_details where ma_id = #{maId} order by create_time desc limit 1
|
||||
</select>
|
||||
<select id="getLeaseUnitAndProject" resultType="com.bonus.common.biz.domain.lease.LeaseApplyInfo">
|
||||
select
|
||||
bu.unit_name as unitName,
|
||||
bp.pro_name as projectName,
|
||||
DATE_FORMAT(lai.create_time, '%Y-%m-%d') as leaseTime
|
||||
from lease_apply_info lai
|
||||
left join tm_task_agreement tta on lai.task_id = tta.task_id
|
||||
left join bm_agreement_info bai on tta.agreement_id = bai.agreement_id
|
||||
left join bm_unit bu on bai.unit_id = bu.unit_id
|
||||
left join bm_project bp on bai.project_id = bp.pro_id
|
||||
where lai.id = #{parentId}
|
||||
</select>
|
||||
<select id="getBackParentId" resultType="com.bonus.common.biz.domain.lease.LeaseApplyInfo">
|
||||
select parent_id as parentId from back_check_details where ma_id = #{maId} order by create_time desc limit 1
|
||||
</select>
|
||||
<select id="getBackUnitAndProject" resultType="com.bonus.common.biz.domain.lease.LeaseApplyInfo">
|
||||
select
|
||||
bu.unit_name as unitName,
|
||||
bp.pro_name as projectName,
|
||||
DATE_FORMAT(ba.create_time, '%Y-%m-%d') as leaseTime
|
||||
from back_apply_info ba
|
||||
left join tm_task_agreement tta on ba.task_id = tta.task_id
|
||||
left join bm_agreement_info bai on tta.agreement_id = bai.agreement_id
|
||||
left join bm_unit bu on bai.unit_id = bu.unit_id
|
||||
left join bm_project bp on bai.project_id = bp.pro_id
|
||||
where ba.id = #{parentId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,221 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.material.ma.mapper.WarehousingMapper">
|
||||
<select id="getList" resultType="com.bonus.material.ma.domain.PutInStorageBean">
|
||||
SELECT
|
||||
psi.id as id,
|
||||
case when psi.put_in_type = 0 then '库存盘点入库'
|
||||
else ''
|
||||
end as putInType,
|
||||
psi.code as code,
|
||||
su.nick_name as modelName,
|
||||
psi.create_time as createDate,
|
||||
psi.remarks as remark,
|
||||
GROUP_CONCAT(DISTINCT mt1.type_name) AS kindName
|
||||
FROM ma_type_put_in_storage_info psi
|
||||
left join sys_user su on psi.creator = su.user_id
|
||||
left join ma_type_put_in_storage_details psd on psi.id = psd.info_id
|
||||
left join ma_type mt on psd.type_id = mt.type_id and mt.del_flag = '0'
|
||||
left join ma_type mt1 on mt.parent_id = mt1.type_id and mt1.del_flag = '0'
|
||||
left join ma_type mt2 ON mt1.parent_id = mt2.type_id and mt2.del_flag = '0'
|
||||
left join ma_type mt3 ON mt2.parent_id = mt3.type_id and mt3.del_flag = '0'
|
||||
WHERE 1=1
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
AND (
|
||||
psi.code LIKE CONCAT('%',#{keyWord},'%') OR
|
||||
su.nick_name LIKE CONCAT('%',#{keyWord},'%') OR
|
||||
psi.remarks LIKE CONCAT('%',#{keyWord},'%')
|
||||
)
|
||||
</if>
|
||||
GROUP BY psi.id
|
||||
ORDER BY psi.create_time DESC
|
||||
</select>
|
||||
<select id="selectMaSupplierInfoList" resultType="com.bonus.material.ma.domain.SupplierInfo">
|
||||
SELECT
|
||||
supplier_id as supplierId ,
|
||||
supplier as supplier
|
||||
FROM ma_supplier_info
|
||||
</select>
|
||||
|
||||
<select id="selectByMaCode" resultType="java.lang.Integer">
|
||||
select count(*)
|
||||
from ma_machine
|
||||
<where>
|
||||
<if test="maCode != null ">and ma_code = #{maCode}</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectTaskNumByMonth" resultType="java.lang.Integer">
|
||||
select count(*) from ma_type_put_in_storage_info where DATE_FORMAT(create_time,'%y%m') = DATE_FORMAT(#{date},'%y%m')
|
||||
</select>
|
||||
|
||||
<insert id="saveInfo" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO ma_type_put_in_storage_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="putInType != null and putInType != ''">put_in_type,</if>
|
||||
<choose>
|
||||
<when test="isCode and num != null and num != 0">
|
||||
num,
|
||||
</when>
|
||||
<otherwise>
|
||||
<if test="totalNum != null and totalNum != 0">
|
||||
num,
|
||||
</if>
|
||||
</otherwise>
|
||||
</choose>
|
||||
<if test="typeId != null and typeId != ''">type_id,</if>
|
||||
<if test="creator != null and creator != ''">creator,</if>
|
||||
<if test="code != null and code != ''">code,</if>
|
||||
<if test="remarks != null and remarks != ''">remarks,</if>
|
||||
create_time
|
||||
</trim>
|
||||
VALUES
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="putInType != null and putInType != ''">#{putInType},</if>
|
||||
<choose>
|
||||
<when test="isCode and num != null and num != 0">
|
||||
#{num},
|
||||
</when>
|
||||
<otherwise>
|
||||
<if test="totalNum != null and totalNum != 0">
|
||||
#{totalNum},
|
||||
</if>
|
||||
</otherwise>
|
||||
</choose>
|
||||
<if test="typeId != null and typeId != ''">#{typeId},</if>
|
||||
<if test="creator != null and creator != ''">#{creator},</if>
|
||||
<if test="code != null and code != ''">#{code},</if>
|
||||
<if test="remarks != null and remarks != ''">#{remarks},</if>
|
||||
sysdate()
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<insert id="saveDetails" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO ma_type_put_in_storage_details (
|
||||
<trim prefix="" suffixOverrides=",">
|
||||
<choose>
|
||||
<when test="isCode and num != null and num != 0">
|
||||
num,
|
||||
</when>
|
||||
<otherwise>
|
||||
<if test="putInStoreNum != null and putInStoreNum != 0">
|
||||
num,
|
||||
</if>
|
||||
</otherwise>
|
||||
</choose>
|
||||
<if test="infoId != null and infoId != ''">
|
||||
info_id,
|
||||
</if>
|
||||
<if test="typeId != null and typeId != ''">
|
||||
type_id,
|
||||
</if>
|
||||
<if test="maId != null and maId != ''">
|
||||
ma_id,
|
||||
</if>
|
||||
<if test="remark != null and remark != ''">
|
||||
remarks,
|
||||
</if>
|
||||
<if test="maCode != null and maCode != ''">
|
||||
ma_code,
|
||||
</if>
|
||||
</trim>
|
||||
)
|
||||
VALUES (
|
||||
<choose>
|
||||
<when test="isCode and num != null and num != 0">
|
||||
1,
|
||||
</when>
|
||||
<otherwise>
|
||||
<if test="putInStoreNum != null and putInStoreNum != 0">
|
||||
#{putInStoreNum},
|
||||
</if>
|
||||
</otherwise>
|
||||
</choose>
|
||||
<trim prefix="" suffixOverrides=",">
|
||||
<if test="infoId != null and infoId != ''">
|
||||
#{infoId},
|
||||
</if>
|
||||
<if test="typeId != null and typeId != ''">
|
||||
#{typeId},
|
||||
</if>
|
||||
<if test="maId != null and maId != ''">
|
||||
#{maId},
|
||||
</if>
|
||||
<if test="remark != null and remark != ''">
|
||||
#{remark},
|
||||
</if>
|
||||
<if test="maCode != null and maCode != ''">
|
||||
#{maCode},
|
||||
</if>
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
|
||||
<insert id="insertMachine" useGeneratedKeys="true" keyProperty="maId">
|
||||
insert into ma_machine (
|
||||
<if test="typeId != null and typeId != '' ">type_id,</if>
|
||||
<if test="maCode != null and maCode != '' ">ma_code,</if>
|
||||
ma_status,
|
||||
<if test="buyPrice != null and buyPrice != ''">buy_price,</if>
|
||||
<if test="maVender != null and maVender != ''">ma_vender,</if>
|
||||
<if test="checkMan != null and checkMan != ''">check_man,</if>
|
||||
<if test="outFacCode != null and outFacCode != ''">out_fac_code,</if>
|
||||
<if test="thisCheckTime != null">this_check_time,</if>
|
||||
<if test="nextCheckTime != null">next_check_time,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="typeId != null and typeId != ''">#{typeId},</if>
|
||||
<if test="maCode != null and maCode != ''">#{maCode},</if>
|
||||
1,
|
||||
<if test="buyPrice != null and buyPrice != ''">#{buyPrice},</if>
|
||||
<if test="maVender != null and maVender != ''">#{maVender},</if>
|
||||
<if test="checkMan != null and checkMan != ''">#{checkMan},</if>
|
||||
<if test="outFacCode != null and outFacCode != ''">#{outFacCode},</if>
|
||||
<if test="thisCheckTime != null">#{thisCheckTime},</if>
|
||||
<if test="nextCheckTime != null">#{nextCheckTime},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateMaType">
|
||||
UPDATE ma_type
|
||||
SET storage_num = IFNULL(storage_num, 0) + #{num},
|
||||
update_time = now()
|
||||
<where>
|
||||
<if test="typeId != null ">and type_id = #{typeId}</if>
|
||||
</where>
|
||||
</update>
|
||||
|
||||
<select id="getDetails" resultType="com.bonus.material.ma.domain.PutInStorageBean">
|
||||
SELECT
|
||||
case when psi.put_in_type = 0 then '库存盘点入库'
|
||||
else ''
|
||||
end as putInType,
|
||||
psd.ma_code as maCode,
|
||||
psd.num as num,
|
||||
mt2.type_name as typeName,
|
||||
mt.type_name as typeModelName,
|
||||
su.nick_name as modelName,
|
||||
psi.create_time as createDate,
|
||||
psd.remarks as remark
|
||||
FROM ma_type_put_in_storage_info psi
|
||||
LEFT JOIN ma_type_put_in_storage_details psd on psi.id = psd.info_id
|
||||
LEFT JOIN ma_type mt on mt.type_id = psd.type_id
|
||||
LEFT JOIN ma_type mt2 on mt2.type_id = mt.parent_id
|
||||
LEFT JOIN sys_user su on su.user_id = psi.creator
|
||||
where
|
||||
1 = 1
|
||||
<if test="infoId != null and infoId != ''">
|
||||
and psi.id = #{infoId}
|
||||
</if>
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and (
|
||||
mt2.type_name like concat('%',#{keyWord},'%') or
|
||||
su.user_name like concat('%',#{keyWord},'%') or
|
||||
mt.type_name like concat('%',#{keyWord},'%') or
|
||||
psd.ma_code like concat('%',#{keyWord},'%')
|
||||
)
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -260,4 +260,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectRepairCodeByIds" resultType="com.bonus.material.repair.domain.RepairAuditDetails">
|
||||
select
|
||||
id as repairId,
|
||||
task_id as taskId,
|
||||
type_id as typeId,
|
||||
ma_id as maId,
|
||||
level as level
|
||||
from repair_apply_details
|
||||
where id in
|
||||
<foreach item="id" collection="list" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<update id="updateRepairApplyDetailsAfterAuditBatch">
|
||||
update repair_apply_record
|
||||
set status = 1,
|
||||
update_time = NOW()
|
||||
where task_id in
|
||||
<foreach item="obj" collection="list" open="(" separator="," close=")">
|
||||
#{obj.taskId}
|
||||
</foreach>
|
||||
</update>
|
||||
</mapper>
|
||||
|
|
@ -579,4 +579,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
AND m.type_id = #{typeId}
|
||||
</select>
|
||||
|
||||
<select id="selectScrapByTaskIdList" resultType="com.bonus.material.scrap.domain.ScrapApplyDetails">
|
||||
SELECT
|
||||
task_id AS taskId,
|
||||
ma_id AS maId,
|
||||
type_id AS typeId,
|
||||
GROUP_CONCAT(DISTINCT scrap_reason) AS scrapReason,
|
||||
GROUP_CONCAT(DISTINCT scrap_type) AS scrapType,
|
||||
GROUP_CONCAT(DISTINCT create_by) AS createBy
|
||||
FROM repair_apply_record rc
|
||||
WHERE rc.repair_type = '3'
|
||||
<if test="list != null and list.size > 0">
|
||||
AND (
|
||||
<foreach collection="list" item="t" separator=" OR ">
|
||||
(
|
||||
rc.task_id = #{t.taskId}
|
||||
AND rc.type_id = #{t.typeId}
|
||||
<if test="t.maId != null">
|
||||
AND rc.ma_id = #{t.maId}
|
||||
</if>
|
||||
<if test="t.maId == null">
|
||||
AND rc.ma_id IS NULL
|
||||
</if>
|
||||
)
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
GROUP BY rc.task_id, rc.ma_id, rc.type_id
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -197,11 +197,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
LEFT JOIN bm_unit bui ON bui.unit_id = bai.unit_id
|
||||
LEFT JOIN slt_agreement_apply saa on saa.agreement_id = bai.agreement_id
|
||||
where bai.status = '1' AND bui.type_id != '1731'
|
||||
<if test="unitIds != null">
|
||||
<if test="unitIds != null and unitIds.size() > 0">
|
||||
and bui.unit_id in
|
||||
<foreach item="item" index="index" collection="unitIds" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
<foreach item="item" index="index" collection="unitIds" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="projectId != null and projectId != ''">
|
||||
and bp.pro_id = #{projectId}
|
||||
|
|
@ -209,6 +209,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="sltStatus != null">
|
||||
and bai.is_slt = #{sltStatus}
|
||||
</if>
|
||||
<if test="agreementCode != null">
|
||||
and bai.agreement_code like concat('%',#{agreementCode},'%')
|
||||
</if>
|
||||
GROUP BY bai.agreement_id
|
||||
ORDER BY bai.create_time desc
|
||||
<!-- <choose>-->
|
||||
|
|
@ -855,6 +858,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="sltStatus != null">
|
||||
and bai.is_slt = #{sltStatus}
|
||||
</if>
|
||||
<if test="agreementCode != null and agreementCode != ''">
|
||||
and bai.agreement_code = #{agreementCode}
|
||||
</if>
|
||||
GROUP BY bai.agreement_id
|
||||
ORDER BY bai.create_time desc
|
||||
</select>
|
||||
|
|
|
|||
Loading…
Reference in New Issue