Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
3258c5d8f3
|
|
@ -0,0 +1,39 @@
|
||||||
|
package com.bonus.common.biz.enums;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新购待入库 0
|
||||||
|
* 在库 1
|
||||||
|
* 在用 2
|
||||||
|
* 退料检修 3
|
||||||
|
* 检修待审核 4
|
||||||
|
* 修试后待入库 5
|
||||||
|
* 退料待报废 6
|
||||||
|
* 维修待报废 7
|
||||||
|
* 已报废审核 8
|
||||||
|
* 退料待入库 9
|
||||||
|
* 报废待审核 10
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
public enum MaMachineStatusEnum {
|
||||||
|
NEW_PURCHASE(0, "新购待入库"),
|
||||||
|
IN_STORE(1, "在库"),
|
||||||
|
IN_USE(2, "在用"),
|
||||||
|
BACK_REPAIR(3, "退料检修"),
|
||||||
|
REPAIR_TO_AUDIT(4, "检修待审核"),
|
||||||
|
REPAIR_TO_STORE(5, "修试后待入库"),
|
||||||
|
BACK_TO_SCRAP(6, "退料待报废"),
|
||||||
|
REPAIR_TO_SCRAP(7, "维修待报废"),
|
||||||
|
SCRAP_AUDIT(8, "已报废审核"),
|
||||||
|
BACK_TO_STORE(9, "退料待入库"),
|
||||||
|
SCRAP_TO_AUDIT(10, "报废待审核");
|
||||||
|
|
||||||
|
private final Integer status;
|
||||||
|
private final String statusName;
|
||||||
|
|
||||||
|
MaMachineStatusEnum(Integer status, String statusName) {
|
||||||
|
this.status = status;
|
||||||
|
this.statusName = statusName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -14,7 +14,9 @@ public enum PurchaseTaskStatusEnum {
|
||||||
IN_STORE(19, "已入库"),
|
IN_STORE(19, "已入库"),
|
||||||
TASK_TO_START(20, "入库待开始"),
|
TASK_TO_START(20, "入库待开始"),
|
||||||
TASK_IN_PROGRESS(21, "入库进行中"),
|
TASK_IN_PROGRESS(21, "入库进行中"),
|
||||||
TASK_FINISHED(22, "入库已完成");
|
TASK_FINISHED(22, "入库已完成"),
|
||||||
|
LEASE_TASK_NO_PUBLISHED(0, "领料任务--未发布"),
|
||||||
|
LEASE_TASK_PUBLISHED(1, "领料任务--已发布");
|
||||||
|
|
||||||
private final Integer status;
|
private final Integer status;
|
||||||
private final String statusName;
|
private final String statusName;
|
||||||
|
|
|
||||||
|
|
@ -12,9 +12,9 @@ import com.bonus.material.lease.service.ILeaseApplyInfoService;
|
||||||
import com.bonus.material.task.domain.vo.TmTaskRequestVo;
|
import com.bonus.material.task.domain.vo.TmTaskRequestVo;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -29,7 +29,8 @@ import java.util.List;
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/lease_apply_info")
|
@RequestMapping("/lease_apply_info")
|
||||||
public class LeaseApplyInfoController extends BaseController {
|
public class LeaseApplyInfoController extends BaseController {
|
||||||
@Autowired
|
|
||||||
|
@Resource
|
||||||
private ILeaseApplyInfoService leaseApplyInfoService;
|
private ILeaseApplyInfoService leaseApplyInfoService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -54,7 +55,7 @@ public class LeaseApplyInfoController extends BaseController {
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(HttpServletResponse response, LeaseApplyInfo leaseApplyInfo) {
|
public void export(HttpServletResponse response, LeaseApplyInfo leaseApplyInfo) {
|
||||||
List<LeaseApplyInfo> list = leaseApplyInfoService.selectLeaseApplyInfoList(leaseApplyInfo);
|
List<LeaseApplyInfo> list = leaseApplyInfoService.selectLeaseApplyInfoList(leaseApplyInfo);
|
||||||
ExcelUtil<LeaseApplyInfo> util = new ExcelUtil<LeaseApplyInfo>(LeaseApplyInfo.class);
|
ExcelUtil<LeaseApplyInfo> util = new ExcelUtil<>(LeaseApplyInfo.class);
|
||||||
util.exportExcel(response, list, "领料任务数据");
|
util.exportExcel(response, list, "领料任务数据");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -64,7 +65,7 @@ public class LeaseApplyInfoController extends BaseController {
|
||||||
@ApiOperation(value = "获取领料任务详细信息")
|
@ApiOperation(value = "获取领料任务详细信息")
|
||||||
//@RequiresPermissions("lease:info:query")
|
//@RequiresPermissions("lease:info:query")
|
||||||
@GetMapping(value = "/{id}")
|
@GetMapping(value = "/{id}")
|
||||||
public AjaxResult getInfo(@PathVariable("id") @NotNull(message = "领料任务ID不能为空") Long id) {
|
public AjaxResult getInfo(@NotNull(message = "领料任务ID不能为空") @PathVariable("id") Long id) {
|
||||||
return success(leaseApplyInfoService.selectLeaseApplyInfoById(id));
|
return success(leaseApplyInfoService.selectLeaseApplyInfoById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -76,7 +77,7 @@ public class LeaseApplyInfoController extends BaseController {
|
||||||
//@RequiresPermissions("lease:info:add")
|
//@RequiresPermissions("lease:info:add")
|
||||||
@SysLog(title = "领料任务", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增领料任务")
|
@SysLog(title = "领料任务", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增领料任务")
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody TmTaskRequestVo tmTaskRequestVo) {
|
public AjaxResult add(@NotNull(message = "领料任务不能为空") @RequestBody TmTaskRequestVo tmTaskRequestVo) {
|
||||||
try {
|
try {
|
||||||
return leaseApplyInfoService.insertLeaseApplyInfo(tmTaskRequestVo);
|
return leaseApplyInfoService.insertLeaseApplyInfo(tmTaskRequestVo);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
@ -92,7 +93,7 @@ public class LeaseApplyInfoController extends BaseController {
|
||||||
//@RequiresPermissions("lease:info:edit")
|
//@RequiresPermissions("lease:info:edit")
|
||||||
@SysLog(title = "领料任务", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改领料任务")
|
@SysLog(title = "领料任务", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改领料任务")
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@RequestBody TmTaskRequestVo tmTaskRequestVo) {
|
public AjaxResult edit(@RequestBody @NotNull TmTaskRequestVo tmTaskRequestVo) {
|
||||||
try {
|
try {
|
||||||
return toAjax(leaseApplyInfoService.updateLeaseApplyInfo(tmTaskRequestVo));
|
return toAjax(leaseApplyInfoService.updateLeaseApplyInfo(tmTaskRequestVo));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
@ -100,6 +101,18 @@ public class LeaseApplyInfoController extends BaseController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 领料任务发布
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "领料任务发布")
|
||||||
|
@PreventRepeatSubmit
|
||||||
|
@SysLog(title = "领料任务发布", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->发布领料任务")
|
||||||
|
@PostMapping("/publish")
|
||||||
|
public AjaxResult publish(@RequestBody @NotNull(message = "任务信息不能为空") LeaseApplyInfo leaseApplyInfo) {
|
||||||
|
return leaseApplyInfoService.publish(leaseApplyInfo);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除领料任务
|
* 删除领料任务
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -61,8 +61,21 @@ public class LeaseApplyDetails extends BaseEntity {
|
||||||
@ApiModelProperty(value = "已领数量")
|
@ApiModelProperty(value = "已领数量")
|
||||||
private Long alNum;
|
private Long alNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 此数量是剩余需要出库的数量(preNum - alNum)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "剩余最大出库数量")
|
||||||
|
private Integer outNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 装备管理方式(0编号 1计数)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "装备管理方式")
|
||||||
|
@Excel(name = "装备管理方式", readConverterExp = "0=编号,1=计数")
|
||||||
|
private int manageType;
|
||||||
|
|
||||||
/** 状态(0待审批,1进行中,2已出库) */
|
/** 状态(0待审批,1进行中,2已出库) */
|
||||||
@Excel(name = "状态", readConverterExp = "0=待审批,1进行中,2已出库")
|
@Excel(name = "状态", readConverterExp = "0=待审批,1=进行中,2=已出库")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
/** 数据所属组织 */
|
/** 数据所属组织 */
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,7 @@ public class LeaseApplyInfo extends BaseEntity {
|
||||||
private Long directId;
|
private Long directId;
|
||||||
|
|
||||||
/** 0工程1长期 */
|
/** 0工程1长期 */
|
||||||
@Excel(name = "0工程1长期")
|
@Excel(name = "领用类型",readConverterExp = "0=工程,1=长期")
|
||||||
@ApiModelProperty(value = "0工程1长期")
|
@ApiModelProperty(value = "0工程1长期")
|
||||||
private String leaseType;
|
private String leaseType;
|
||||||
|
|
||||||
|
|
@ -137,12 +137,14 @@ public class LeaseApplyInfo extends BaseEntity {
|
||||||
List<LeaseApplyDetails> leaseApplyDetails;
|
List<LeaseApplyDetails> leaseApplyDetails;
|
||||||
|
|
||||||
@ApiModelProperty(value = "租赁工程")
|
@ApiModelProperty(value = "租赁工程")
|
||||||
|
@Excel(name = "领料工程")
|
||||||
private String leaseProject;
|
private String leaseProject;
|
||||||
|
|
||||||
@ApiModelProperty(value = "租赁工程id")
|
@ApiModelProperty(value = "租赁工程id")
|
||||||
private Integer leaseProjectId;
|
private Integer leaseProjectId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "租赁单位")
|
@ApiModelProperty(value = "租赁单位")
|
||||||
|
@Excel(name = "领料单位")
|
||||||
private String leaseUnit;
|
private String leaseUnit;
|
||||||
|
|
||||||
@ApiModelProperty(value = "租赁单位id")
|
@ApiModelProperty(value = "租赁单位id")
|
||||||
|
|
@ -152,6 +154,7 @@ public class LeaseApplyInfo extends BaseEntity {
|
||||||
private Long agreementId;
|
private Long agreementId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "协议号")
|
@ApiModelProperty(value = "协议号")
|
||||||
|
@Excel(name = "协议号")
|
||||||
private String agreementCode;
|
private String agreementCode;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ public interface LeaseApplyInfoMapper {
|
||||||
* @param id 领料任务主键
|
* @param id 领料任务主键
|
||||||
* @return 领料任务
|
* @return 领料任务
|
||||||
*/
|
*/
|
||||||
public LeaseApplyInfo selectLeaseApplyInfoById(Long id);
|
LeaseApplyInfo selectLeaseApplyInfoById(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询领料任务列表
|
* 查询领料任务列表
|
||||||
|
|
@ -24,7 +24,7 @@ public interface LeaseApplyInfoMapper {
|
||||||
* @param leaseApplyInfo 领料任务
|
* @param leaseApplyInfo 领料任务
|
||||||
* @return 领料任务集合
|
* @return 领料任务集合
|
||||||
*/
|
*/
|
||||||
public List<LeaseApplyInfo> selectLeaseApplyInfoList(LeaseApplyInfo leaseApplyInfo);
|
List<LeaseApplyInfo> selectLeaseApplyInfoList(LeaseApplyInfo leaseApplyInfo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增领料任务
|
* 新增领料任务
|
||||||
|
|
@ -32,7 +32,7 @@ public interface LeaseApplyInfoMapper {
|
||||||
* @param leaseApplyInfo 领料任务
|
* @param leaseApplyInfo 领料任务
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertLeaseApplyInfo(LeaseApplyInfo leaseApplyInfo);
|
int insertLeaseApplyInfo(LeaseApplyInfo leaseApplyInfo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改领料任务
|
* 修改领料任务
|
||||||
|
|
@ -40,7 +40,7 @@ public interface LeaseApplyInfoMapper {
|
||||||
* @param leaseApplyInfo 领料任务
|
* @param leaseApplyInfo 领料任务
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateLeaseApplyInfo(LeaseApplyInfo leaseApplyInfo);
|
int updateLeaseApplyInfo(LeaseApplyInfo leaseApplyInfo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除领料任务
|
* 删除领料任务
|
||||||
|
|
@ -48,7 +48,7 @@ public interface LeaseApplyInfoMapper {
|
||||||
* @param id 领料任务主键
|
* @param id 领料任务主键
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteLeaseApplyInfoById(Long id);
|
int deleteLeaseApplyInfoById(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除领料任务
|
* 批量删除领料任务
|
||||||
|
|
@ -56,5 +56,5 @@ public interface LeaseApplyInfoMapper {
|
||||||
* @param ids 需要删除的数据主键集合
|
* @param ids 需要删除的数据主键集合
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteLeaseApplyInfoByIds(Long[] ids);
|
int deleteLeaseApplyInfoByIds(Long[] ids);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,11 @@ public interface ILeaseApplyInfoService {
|
||||||
*/
|
*/
|
||||||
AjaxResult insertLeaseApplyInfo(TmTaskRequestVo leaseApplyRequestVo);
|
AjaxResult insertLeaseApplyInfo(TmTaskRequestVo leaseApplyRequestVo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发布任务
|
||||||
|
*/
|
||||||
|
AjaxResult publish(LeaseApplyInfo leaseApplyInfo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改领料任务
|
* 修改领料任务
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ public interface ILeaseOutDetailsService {
|
||||||
* @param id 领料出库详细主键
|
* @param id 领料出库详细主键
|
||||||
* @return 领料出库详细
|
* @return 领料出库详细
|
||||||
*/
|
*/
|
||||||
public LeaseOutDetails selectLeaseOutDetailsById(Long id);
|
LeaseOutDetails selectLeaseOutDetailsById(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询领料出库详细列表
|
* 查询领料出库详细列表
|
||||||
|
|
@ -26,7 +26,7 @@ public interface ILeaseOutDetailsService {
|
||||||
* @param leaseOutDetails 领料出库详细
|
* @param leaseOutDetails 领料出库详细
|
||||||
* @return 领料出库详细集合
|
* @return 领料出库详细集合
|
||||||
*/
|
*/
|
||||||
public List<LeaseOutDetails> selectLeaseOutDetailsList(LeaseOutDetails leaseOutDetails);
|
List<LeaseOutDetails> selectLeaseOutDetailsList(LeaseOutDetails leaseOutDetails);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增领料出库详细
|
* 新增领料出库详细
|
||||||
|
|
@ -34,7 +34,7 @@ public interface ILeaseOutDetailsService {
|
||||||
* @param leaseOutDetailsList 领料出库详细
|
* @param leaseOutDetailsList 领料出库详细
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public AjaxResult insertLeaseOutDetails(List<LeaseOutDetails> leaseOutDetailsList);
|
AjaxResult insertLeaseOutDetails(List<LeaseOutDetails> leaseOutDetailsList);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改领料出库详细
|
* 修改领料出库详细
|
||||||
|
|
@ -42,7 +42,7 @@ public interface ILeaseOutDetailsService {
|
||||||
* @param leaseOutDetails 领料出库详细
|
* @param leaseOutDetails 领料出库详细
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateLeaseOutDetails(LeaseOutDetails leaseOutDetails);
|
int updateLeaseOutDetails(LeaseOutDetails leaseOutDetails);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除领料出库详细
|
* 批量删除领料出库详细
|
||||||
|
|
@ -50,7 +50,7 @@ public interface ILeaseOutDetailsService {
|
||||||
* @param ids 需要删除的领料出库详细主键集合
|
* @param ids 需要删除的领料出库详细主键集合
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteLeaseOutDetailsByIds(Long[] ids);
|
int deleteLeaseOutDetailsByIds(Long[] ids);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除领料出库详细信息
|
* 删除领料出库详细信息
|
||||||
|
|
@ -58,5 +58,5 @@ public interface ILeaseOutDetailsService {
|
||||||
* @param id 领料出库详细主键
|
* @param id 领料出库详细主键
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteLeaseOutDetailsById(Long id);
|
int deleteLeaseOutDetailsById(Long id);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.bonus.material.lease.service.impl;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import com.bonus.common.biz.constant.MaterialConstants;
|
import com.bonus.common.biz.constant.MaterialConstants;
|
||||||
import com.bonus.common.biz.enums.PurchaseTaskStatusEnum;
|
import com.bonus.common.biz.enums.PurchaseTaskStatusEnum;
|
||||||
import com.bonus.common.biz.enums.TmTaskTypeEnum;
|
import com.bonus.common.biz.enums.TmTaskTypeEnum;
|
||||||
|
|
@ -18,12 +19,12 @@ import com.bonus.material.task.domain.TmTaskAgreement;
|
||||||
import com.bonus.material.task.domain.vo.TmTaskRequestVo;
|
import com.bonus.material.task.domain.vo.TmTaskRequestVo;
|
||||||
import com.bonus.material.task.mapper.TmTaskAgreementMapper;
|
import com.bonus.material.task.mapper.TmTaskAgreementMapper;
|
||||||
import com.bonus.material.task.mapper.TmTaskMapper;
|
import com.bonus.material.task.mapper.TmTaskMapper;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.dao.DataAccessException;
|
import org.springframework.dao.DataAccessException;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.bonus.material.lease.mapper.LeaseApplyInfoMapper;
|
import com.bonus.material.lease.mapper.LeaseApplyInfoMapper;
|
||||||
import com.bonus.material.lease.domain.LeaseApplyInfo;
|
import com.bonus.material.lease.domain.LeaseApplyInfo;
|
||||||
import com.bonus.material.lease.service.ILeaseApplyInfoService;
|
import com.bonus.material.lease.service.ILeaseApplyInfoService;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
@ -36,10 +37,11 @@ import javax.annotation.Resource;
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
||||||
@Autowired
|
|
||||||
|
@Resource
|
||||||
private LeaseApplyInfoMapper leaseApplyInfoMapper;
|
private LeaseApplyInfoMapper leaseApplyInfoMapper;
|
||||||
|
|
||||||
@Autowired
|
@Resource
|
||||||
private LeaseApplyDetailsMapper leaseApplyDetailsMapper;
|
private LeaseApplyDetailsMapper leaseApplyDetailsMapper;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
|
|
@ -48,7 +50,6 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
||||||
@Resource
|
@Resource
|
||||||
TmTaskAgreementMapper tmTaskAgreementMapper;
|
TmTaskAgreementMapper tmTaskAgreementMapper;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询领料任务
|
* 查询领料任务
|
||||||
*
|
*
|
||||||
|
|
@ -101,6 +102,9 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
||||||
if (tmTaskRequestVo.getLeaseApplyInfo() == null) {
|
if (tmTaskRequestVo.getLeaseApplyInfo() == null) {
|
||||||
return AjaxResult.error("请先填写领料任务信息");
|
return AjaxResult.error("请先填写领料任务信息");
|
||||||
}
|
}
|
||||||
|
if (CollectionUtil.isEmpty(tmTaskRequestVo.getLeaseApplyDetailsList())) {
|
||||||
|
return AjaxResult.error("请先添加领料任务物资明细");
|
||||||
|
}
|
||||||
tmTaskRequestVo.getLeaseApplyInfo().setCreateTime(DateUtils.getNowDate());
|
tmTaskRequestVo.getLeaseApplyInfo().setCreateTime(DateUtils.getNowDate());
|
||||||
tmTaskRequestVo.getLeaseApplyInfo().setCreateBy(SecurityUtils.getUsername());
|
tmTaskRequestVo.getLeaseApplyInfo().setCreateBy(SecurityUtils.getUsername());
|
||||||
try {
|
try {
|
||||||
|
|
@ -131,6 +135,42 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发布任务
|
||||||
|
*
|
||||||
|
* @param leaseApplyInfo 领料任务info
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public AjaxResult publish(LeaseApplyInfo leaseApplyInfo) {
|
||||||
|
if (leaseApplyInfo.getId() == null) {
|
||||||
|
return AjaxResult.error("ID为空,请完善后重新发布!");
|
||||||
|
}
|
||||||
|
if (leaseApplyInfo.getTaskId() == null) {
|
||||||
|
return AjaxResult.error("任务ID为空,请完善后重新发布!");
|
||||||
|
}
|
||||||
|
|
||||||
|
leaseApplyInfo.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
leaseApplyInfo.setStatus(String.valueOf(PurchaseTaskStatusEnum.LEASE_TASK_PUBLISHED.getStatus()));
|
||||||
|
try {
|
||||||
|
int result = leaseApplyInfoMapper.updateLeaseApplyInfo(leaseApplyInfo);
|
||||||
|
if (result > 0) {
|
||||||
|
// 同步修改tm_task任务状态
|
||||||
|
TmTask tmTask = new TmTask();
|
||||||
|
tmTask.setTaskId(leaseApplyInfo.getTaskId());
|
||||||
|
tmTask.setStatus(String.valueOf(PurchaseTaskStatusEnum.LEASE_TASK_PUBLISHED.getStatus()));
|
||||||
|
tmTaskMapper.updateTmTask(tmTask);
|
||||||
|
return AjaxResult.success("发布成功");
|
||||||
|
}
|
||||||
|
return AjaxResult.error("发布失败");
|
||||||
|
} catch (DataAccessException e) {
|
||||||
|
// 抛出异常、回滚数据
|
||||||
|
throw new RuntimeException();
|
||||||
|
} catch (Exception e) {
|
||||||
|
return AjaxResult.error("发布失败:" + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private AjaxResult insertPurchaseCheckDetails(List<LeaseApplyDetails> leaseApplyDetailsList, Long taskId) {
|
private AjaxResult insertPurchaseCheckDetails(List<LeaseApplyDetails> leaseApplyDetailsList, Long taskId) {
|
||||||
if (!CollectionUtils.isEmpty(leaseApplyDetailsList)) {
|
if (!CollectionUtils.isEmpty(leaseApplyDetailsList)) {
|
||||||
for (LeaseApplyDetails details : leaseApplyDetailsList) {
|
for (LeaseApplyDetails details : leaseApplyDetailsList) {
|
||||||
|
|
@ -168,16 +208,32 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean updateLeaseApplyInfo(TmTaskRequestVo tmTaskRequestVo) {
|
public boolean updateLeaseApplyInfo(TmTaskRequestVo tmTaskRequestVo) {
|
||||||
tmTaskRequestVo.getLeaseApplyInfo().setUpdateTime(DateUtils.getNowDate());
|
|
||||||
tmTaskRequestVo.getLeaseApplyInfo().setUpdateBy(SecurityUtils.getUsername());
|
|
||||||
try {
|
try {
|
||||||
Long[] ids = new Long[]{tmTaskRequestVo.getLeaseApplyInfo().getId()};
|
// 提取到局部变量中,减少重复代码
|
||||||
|
LeaseApplyInfo leaseApplyInfo = tmTaskRequestVo.getLeaseApplyInfo();
|
||||||
|
if (leaseApplyInfo != null && leaseApplyInfo.getId() != null) {
|
||||||
|
leaseApplyInfo.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
leaseApplyInfo.setUpdateBy(SecurityUtils.getUsername());
|
||||||
|
|
||||||
|
// 去除创建一个新的数组对象,直接复用
|
||||||
|
Long[] ids = {leaseApplyInfo.getId()};
|
||||||
|
|
||||||
|
if (CollectionUtil.isNotEmpty(tmTaskRequestVo.getLeaseApplyDetailsList())) {
|
||||||
|
// 业务逻辑代码
|
||||||
leaseApplyDetailsMapper.deleteLeaseApplyDetailsByParentIds(ids);
|
leaseApplyDetailsMapper.deleteLeaseApplyDetailsByParentIds(ids);
|
||||||
insertPurchaseCheckDetails(tmTaskRequestVo.getLeaseApplyDetailsList(), tmTaskRequestVo.getLeaseApplyInfo().getTaskId());
|
insertPurchaseCheckDetails(tmTaskRequestVo.getLeaseApplyDetailsList(), leaseApplyInfo.getTaskId());
|
||||||
leaseApplyInfoMapper.updateLeaseApplyInfo(tmTaskRequestVo.getLeaseApplyInfo());
|
}
|
||||||
|
// 修改外层info
|
||||||
|
leaseApplyInfoMapper.updateLeaseApplyInfo(leaseApplyInfo);
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
} catch (DataAccessException dae) {
|
||||||
|
throw new ServiceException("数据访问异常: " + dae.getMessage());
|
||||||
|
} catch (IllegalArgumentException iae) {
|
||||||
|
throw new ServiceException("非法参数异常: " + iae.getMessage());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new ServiceException("错误信息描述");
|
throw new ServiceException("未知异常: " + e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -127,25 +127,25 @@ public class TmTaskController extends BaseController {
|
||||||
* @param souceBy app为1 web为0
|
* @param souceBy app为1 web为0
|
||||||
* @return 列表
|
* @return 列表
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "查询机具领料申请列表")
|
// @ApiOperation(value = "查询机具领料申请列表")
|
||||||
@PreventRepeatSubmit
|
// @PreventRepeatSubmit
|
||||||
@RequiresPermissions("task:task:query")
|
// @RequiresPermissions("task:task:query")
|
||||||
@SysLog(title = "任务", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->查询机具领料申请列表")
|
// @SysLog(title = "任务", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->查询机具领料申请列表")
|
||||||
@GetMapping(value = "getLeaseAuditListAll")
|
// @GetMapping(value = "getLeaseAuditListAll")
|
||||||
public AjaxResult getLeaseAuditListAll(TmTaskRequestVo task, Integer souceBy) {
|
// public AjaxResult getLeaseAuditListAll(TmTaskRequestVo task, Integer souceBy) {
|
||||||
if (StringUtils.isNull(task)) {
|
// if (StringUtils.isNull(task)) {
|
||||||
return AjaxResult.error("参数错误");
|
// return AjaxResult.error("参数错误");
|
||||||
}
|
// }
|
||||||
List<TmTaskRequestVo> leaseAuditList;
|
// List<TmTaskRequestVo> leaseAuditList;
|
||||||
if (souceBy != null && souceBy == 1) {
|
// if (souceBy != null && souceBy == 1) {
|
||||||
leaseAuditList = tmTaskService.getLeaseAuditList(task);
|
// leaseAuditList = tmTaskService.getLeaseAuditList(task);
|
||||||
return AjaxResult.success(leaseAuditList);
|
// return AjaxResult.success(leaseAuditList);
|
||||||
} else {
|
// } else {
|
||||||
startPage();
|
// startPage();
|
||||||
leaseAuditList = tmTaskService.getLeaseAuditList(task);
|
// leaseAuditList = tmTaskService.getLeaseAuditList(task);
|
||||||
return AjaxResult.success(getDataTable(leaseAuditList));
|
// return AjaxResult.success(getDataTable(leaseAuditList));
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -89,12 +89,6 @@ public class TmTaskRequestVo extends BaseEntity {
|
||||||
@ApiModelProperty(value = "关键字")
|
@ApiModelProperty(value = "关键字")
|
||||||
private String keyWord;
|
private String keyWord;
|
||||||
|
|
||||||
/**
|
|
||||||
* 领料任务实体集合
|
|
||||||
*/
|
|
||||||
@ApiModelProperty(value = "领料任务实体集合")
|
|
||||||
private List<LeaseApplyInfo> leaseApplyInfoList;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "领料任务汇总")
|
@ApiModelProperty(value = "领料任务汇总")
|
||||||
private LeaseApplyInfo leaseApplyInfo;
|
private LeaseApplyInfo leaseApplyInfo;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,13 +10,14 @@ import com.bonus.material.task.domain.TmTaskAgreement;
|
||||||
* @date 2024-10-16
|
* @date 2024-10-16
|
||||||
*/
|
*/
|
||||||
public interface TmTaskAgreementMapper {
|
public interface TmTaskAgreementMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询任务
|
* 查询任务
|
||||||
*
|
*
|
||||||
* @param taskId 任务主键
|
* @param taskId 任务主键
|
||||||
* @return 任务
|
* @return 任务
|
||||||
*/
|
*/
|
||||||
public TmTaskAgreement selectTmTaskAgreementByTaskId(Long taskId);
|
TmTaskAgreement selectTmTaskAgreementByTaskId(Long taskId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询任务列表
|
* 查询任务列表
|
||||||
|
|
@ -24,7 +25,7 @@ public interface TmTaskAgreementMapper {
|
||||||
* @param tmTaskAgreement 任务
|
* @param tmTaskAgreement 任务
|
||||||
* @return 任务集合
|
* @return 任务集合
|
||||||
*/
|
*/
|
||||||
public List<TmTaskAgreement> selectTmTaskAgreementList(TmTaskAgreement tmTaskAgreement);
|
List<TmTaskAgreement> selectTmTaskAgreementList(TmTaskAgreement tmTaskAgreement);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增任务
|
* 新增任务
|
||||||
|
|
@ -32,7 +33,7 @@ public interface TmTaskAgreementMapper {
|
||||||
* @param tmTaskAgreement 任务
|
* @param tmTaskAgreement 任务
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertTmTaskAgreement(TmTaskAgreement tmTaskAgreement);
|
int insertTmTaskAgreement(TmTaskAgreement tmTaskAgreement);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改任务
|
* 修改任务
|
||||||
|
|
@ -40,7 +41,7 @@ public interface TmTaskAgreementMapper {
|
||||||
* @param tmTaskAgreement 任务
|
* @param tmTaskAgreement 任务
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateTmTaskAgreement(TmTaskAgreement tmTaskAgreement);
|
int updateTmTaskAgreement(TmTaskAgreement tmTaskAgreement);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除任务
|
* 删除任务
|
||||||
|
|
@ -48,7 +49,7 @@ public interface TmTaskAgreementMapper {
|
||||||
* @param taskId 任务主键
|
* @param taskId 任务主键
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteTmTaskAgreementByTaskId(Long taskId);
|
int deleteTmTaskAgreementByTaskId(Long taskId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除任务
|
* 批量删除任务
|
||||||
|
|
@ -56,5 +57,5 @@ public interface TmTaskAgreementMapper {
|
||||||
* @param taskIds 需要删除的数据主键集合
|
* @param taskIds 需要删除的数据主键集合
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteTmTaskAgreementByTaskIds(Long[] taskIds);
|
int deleteTmTaskAgreementByTaskIds(Long[] taskIds);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -89,11 +89,11 @@ public interface TmTaskMapper {
|
||||||
|
|
||||||
int deleteTmTaskByPurchaseIds(Long[] ids);
|
int deleteTmTaskByPurchaseIds(Long[] ids);
|
||||||
|
|
||||||
List<TmTaskRequestVo> getAuditListByLeaseTmTask(@Param("record") TmTaskRequestVo tmTaskRequestVo);
|
// List<TmTaskRequestVo> getAuditListByLeaseTmTask(@Param("record") TmTaskRequestVo tmTaskRequestVo);
|
||||||
|
//
|
||||||
List<TmTaskRequestVo> getAuditListByLeaseTmTaskByPeople(@Param("record") TmTaskRequestVo tmTaskRequestVo);
|
// List<TmTaskRequestVo> getAuditListByLeaseTmTaskByPeople(@Param("record") TmTaskRequestVo tmTaskRequestVo);
|
||||||
|
//
|
||||||
List<LeaseApplyInfo> getAuditListByLeaseInfo(@Param("record") TmTaskRequestVo record);
|
// List<LeaseApplyInfo> getAuditListByLeaseInfo(@Param("record") TmTaskRequestVo record);
|
||||||
|
//
|
||||||
List<LeaseApplyDetails> getLeaseApplyDetails(@Param("record") LeaseApplyInfo record);
|
// List<LeaseApplyDetails> getLeaseApplyDetails(@Param("record") LeaseApplyInfo record);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -59,5 +59,7 @@ public interface ITmTaskService {
|
||||||
*/
|
*/
|
||||||
public int deleteTmTaskByTaskId(Long taskId);
|
public int deleteTmTaskByTaskId(Long taskId);
|
||||||
|
|
||||||
List<TmTaskRequestVo> getLeaseAuditList(TmTaskRequestVo tmTask);
|
// List<TmTaskRequestVo> getLeaseAuditList(TmTaskRequestVo tmTask);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -106,49 +106,50 @@ public class TmTaskServiceImpl implements ITmTaskService {
|
||||||
/**
|
/**
|
||||||
* 获取单个申请列表
|
* 获取单个申请列表
|
||||||
*/
|
*/
|
||||||
@Override
|
// @Override
|
||||||
public List<TmTaskRequestVo> getLeaseAuditList(TmTaskRequestVo tmTaskRequestVo) {
|
// public List<TmTaskRequestVo> getLeaseAuditList(TmTaskRequestVo tmTaskRequestVo) {
|
||||||
Set<String> roles = SecurityUtils.getLoginUser().getRoles();
|
// Set<String> roles = SecurityUtils.getLoginUser().getRoles();
|
||||||
List<TmTaskRequestVo> tmTaskList;
|
// List<TmTaskRequestVo> tmTaskList;
|
||||||
if (roles.contains(MaterialConstants.STRING_ADMIN)) {
|
// if (roles.contains(MaterialConstants.STRING_ADMIN)) {
|
||||||
tmTaskList = tmTaskMapper.getAuditListByLeaseTmTask(tmTaskRequestVo);
|
// tmTaskList = tmTaskMapper.getAuditListByLeaseTmTask(tmTaskRequestVo);
|
||||||
} else {
|
// } else {
|
||||||
String username = SecurityUtils.getLoginUser().getUsername();
|
// String username = SecurityUtils.getLoginUser().getUsername();
|
||||||
tmTaskRequestVo.setCreateBy(username);
|
// tmTaskRequestVo.setCreateBy(username);
|
||||||
tmTaskList = tmTaskMapper.getAuditListByLeaseTmTaskByPeople(tmTaskRequestVo);
|
// tmTaskList = tmTaskMapper.getAuditListByLeaseTmTaskByPeople(tmTaskRequestVo);
|
||||||
}
|
// }
|
||||||
for (TmTaskRequestVo tmTask : tmTaskList) {
|
// for (TmTaskRequestVo tmTask : tmTaskList) {
|
||||||
int count = 0;
|
// int count = 0;
|
||||||
if (tmTask != null) {
|
// if (tmTask != null) {
|
||||||
// 去查询任务分单表
|
// // 去查询任务分单表
|
||||||
List<LeaseApplyInfo> auditListByLeaseInfo = tmTaskMapper.getAuditListByLeaseInfo(tmTask);
|
// List<LeaseApplyInfo> auditListByLeaseInfo = tmTaskMapper.getAuditListByLeaseInfo(tmTask);
|
||||||
if (auditListByLeaseInfo != null && !auditListByLeaseInfo.isEmpty()) {
|
// if (auditListByLeaseInfo != null && !auditListByLeaseInfo.isEmpty()) {
|
||||||
// 对领料任务集合查询具体详情
|
// // 对领料任务集合查询具体详情
|
||||||
for (LeaseApplyInfo leaseApplyInfo : auditListByLeaseInfo) {
|
// for (LeaseApplyInfo leaseApplyInfo : auditListByLeaseInfo) {
|
||||||
if (leaseApplyInfo != null) {
|
// if (leaseApplyInfo != null) {
|
||||||
// 去查询领料任务详情表
|
// // 去查询领料任务详情表
|
||||||
List<LeaseApplyDetails> leaseApplyDetails = tmTaskMapper.getLeaseApplyDetails(leaseApplyInfo);
|
// List<LeaseApplyDetails> leaseApplyDetails = tmTaskMapper.getLeaseApplyDetails(leaseApplyInfo);
|
||||||
if (leaseApplyDetails != null && !leaseApplyDetails.isEmpty()) {
|
// if (leaseApplyDetails != null && !leaseApplyDetails.isEmpty()) {
|
||||||
for (LeaseApplyDetails leaseApplyDetail : leaseApplyDetails) {
|
// for (LeaseApplyDetails leaseApplyDetail : leaseApplyDetails) {
|
||||||
if (leaseApplyDetail != null && leaseApplyDetail.getPreNum() != null) {
|
// if (leaseApplyDetail != null && leaseApplyDetail.getPreNum() != null) {
|
||||||
// 统计预领数量
|
// // 统计预领数量
|
||||||
count += leaseApplyDetail.getPreNum();
|
// count += leaseApplyDetail.getPreNum();
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
// 塞入领料任务详情的集合中
|
// // 塞入领料任务详情的集合中
|
||||||
leaseApplyInfo.setLeaseApplyDetails(leaseApplyDetails);
|
// leaseApplyInfo.setLeaseApplyDetails(leaseApplyDetails);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
// 存入领料任务实体集合
|
// // 存入领料任务实体集合
|
||||||
tmTask.setLeaseApplyInfoList(auditListByLeaseInfo);
|
// tmTask.setLeaseApplyInfoList(auditListByLeaseInfo);
|
||||||
tmTask.setRemark(auditListByLeaseInfo.get(0).getRemark());
|
// tmTask.setRemark(auditListByLeaseInfo.get(0).getRemark());
|
||||||
}
|
// }
|
||||||
// 塞入预领的合计数量
|
// // 塞入预领的合计数量
|
||||||
tmTask.setPreCountNum(count);
|
// tmTask.setPreCountNum(count);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
// return tmTaskList;
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
return tmTaskList;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
FROM ma_machine mm
|
FROM ma_machine mm
|
||||||
LEFT JOIN ma_type mt ON mt.type_id = mm.type_id
|
LEFT JOIN ma_type mt ON mt.type_id = mm.type_id
|
||||||
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
|
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
|
||||||
WHERE mm.ma_code is not null and mm.ma_status in (15)
|
WHERE mm.ma_code is not null and mm.ma_status in (1)
|
||||||
GROUP BY mt.type_id) AS subquery0 ON subquery0.type_id = mt.type_id
|
GROUP BY mt.type_id) AS subquery0 ON subquery0.type_id = mt.type_id
|
||||||
WHERE mt.del_flag = '0'
|
WHERE mt.del_flag = '0'
|
||||||
<if test="level!=null and level!=''">
|
<if test="level!=null and level!=''">
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<sql id="selectLeaseApplyDetailsVo">
|
<sql id="selectLeaseApplyDetailsVo">
|
||||||
select
|
select
|
||||||
lad.id, lad.parent_id, mt.type_id, mt.type_name, mt2.type_name as ma_type_name, mt.storage_num,
|
lad.id, lad.parent_id, mt.type_id, mt.type_name, mt2.type_name as ma_type_name, mt.storage_num,
|
||||||
|
mt.manage_type as manageType,
|
||||||
|
(lad.pre_num - IF(lad.al_num IS NULL,'0',lad.al_num)) AS outNum,
|
||||||
lad.pre_num, lad.audit_num, lad.al_num, lad.status, mt.unit_name,
|
lad.pre_num, lad.audit_num, lad.al_num, lad.status, mt.unit_name,
|
||||||
lad.create_by, lad.create_time, lad.update_by, lad.update_time, lad.remark, lad.company_id
|
lad.create_by, lad.create_time, lad.update_by, lad.update_time, lad.remark, lad.company_id
|
||||||
from
|
from
|
||||||
|
|
|
||||||
|
|
@ -154,7 +154,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
FROM ma_machine mm
|
FROM ma_machine mm
|
||||||
LEFT JOIN ma_type mt ON mt.type_id = mm.type_id
|
LEFT JOIN ma_type mt ON mt.type_id = mm.type_id
|
||||||
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
|
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
|
||||||
WHERE mm.ma_code is not null and mm.ma_status in (15)
|
WHERE mm.ma_code is not null and mm.ma_status in (1)
|
||||||
GROUP BY mt.type_id) AS subquery0 ON subquery0.type_id = mt.type_id
|
GROUP BY mt.type_id) AS subquery0 ON subquery0.type_id = mt.type_id
|
||||||
WHERE mt.del_flag = '0' and mt.type_id = #{typeId}
|
WHERE mt.del_flag = '0' and mt.type_id = #{typeId}
|
||||||
</select>
|
</select>
|
||||||
|
|
|
||||||
|
|
@ -458,7 +458,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
select DISTINCT m.type_id, m.type_name, m.parent_id, m.unit_id, m.unit_name, m.manage_type,
|
select DISTINCT m.type_id, m.type_name, m.parent_id, m.unit_id, m.unit_name, m.manage_type,
|
||||||
m.lease_price,m.eff_time, m.rent_price, m.buy_price, m.pay_price, m.level, m.rated_load, m.test_load,
|
m.lease_price,m.eff_time, m.rent_price, m.buy_price, m.pay_price, m.level, m.rated_load, m.test_load,
|
||||||
m.holding_time, m.warn_num,
|
m.holding_time, m.warn_num,
|
||||||
mpi.prop_name, m.del_flag, m.create_by, m.create_time,
|
m.del_flag, m.create_by, m.create_time,
|
||||||
m.remark,m.type_id id , m.type_name label,
|
m.remark,m.type_id id , m.type_name label,
|
||||||
CASE m.manage_type
|
CASE m.manage_type
|
||||||
WHEN 0 THEN
|
WHEN 0 THEN
|
||||||
|
|
@ -467,8 +467,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
IFNULL(m.storage_num, 0)
|
IFNULL(m.storage_num, 0)
|
||||||
END as storage_num
|
END as storage_num
|
||||||
from ma_type m
|
from ma_type m
|
||||||
left join ma_prop_set mps on m.type_id = mps.type_id and mps.`status`='0' and mps.del_flag='0'
|
|
||||||
left join ma_prop_info mpi on mps.prop_id = mpi.prop_id and mpi.`status`='0' and mpi.del_flag='0'
|
|
||||||
left join (SELECT mt.type_id,
|
left join (SELECT mt.type_id,
|
||||||
mt2.type_name AS typeName,
|
mt2.type_name AS typeName,
|
||||||
mt.type_name AS typeModelName,
|
mt.type_name AS typeModelName,
|
||||||
|
|
@ -476,7 +474,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
FROM ma_machine mm
|
FROM ma_machine mm
|
||||||
LEFT JOIN ma_type mt ON mt.type_id = mm.type_id
|
LEFT JOIN ma_type mt ON mt.type_id = mm.type_id
|
||||||
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
|
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
|
||||||
WHERE mm.ma_code is not null and mm.ma_status in (15)
|
WHERE mm.ma_code is not null and mm.ma_status in (1)
|
||||||
GROUP BY mt.type_id) AS subquery0 ON subquery0.type_id = m.type_id
|
GROUP BY mt.type_id) AS subquery0 ON subquery0.type_id = m.type_id
|
||||||
<where>
|
<where>
|
||||||
m.del_flag = '0'
|
m.del_flag = '0'
|
||||||
|
|
|
||||||
|
|
@ -129,127 +129,120 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
)
|
)
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<select id="getAuditListByLeaseTmTask" resultType="com.bonus.material.task.domain.vo.TmTaskRequestVo">
|
<!-- <select id="getAuditListByLeaseTmTask" resultType="com.bonus.material.task.domain.vo.TmTaskRequestVo">-->
|
||||||
SELECT DISTINCT
|
<!-- SELECT DISTINCT-->
|
||||||
tt.task_id as taskId, tt.task_type as taskType, tt.task_status as taskStatus, tt.status, tt.code,
|
<!-- tt.task_id as taskId, tt.task_type as taskType, tt.task_status as taskStatus, tt.status, tt.code,-->
|
||||||
su.phonenumber AS phoneNumber, sd.dept_name as deptName,
|
<!-- su.phonenumber AS phoneNumber, sd.dept_name as deptName,-->
|
||||||
bpl.pro_id as proId,bpl.pro_name as projectName,
|
<!-- bpl.pro_id as proId,bpl.pro_name as projectName,-->
|
||||||
bui.unit_id as unitId,bui.unit_name as unitName,
|
<!-- bui.unit_id as unitId,bui.unit_name as unitName,-->
|
||||||
lai.lease_person as leasePerson, lai.phone as leasePhone, tt.create_by as applyFor,
|
<!-- lai.lease_person as leasePerson, lai.phone as leasePhone, tt.create_by as applyFor,-->
|
||||||
lai.lease_type as leaseType,lai.estimate_lease_time as estimateLeaseTime,
|
<!-- lai.lease_type as leaseType,lai.estimate_lease_time as estimateLeaseTime,-->
|
||||||
bai.agreement_code as agreementCode,
|
<!-- bai.agreement_code as agreementCode,-->
|
||||||
tt.create_time as createTimes, tt.update_time as updateTimes
|
<!-- tt.create_time as createTimes, tt.update_time as updateTimes-->
|
||||||
FROM
|
<!-- FROM-->
|
||||||
tm_task tt
|
<!-- tm_task tt-->
|
||||||
LEFT JOIN sys_user su ON tt.create_by = su.user_name
|
<!-- LEFT JOIN sys_user su ON tt.create_by = su.user_name-->
|
||||||
LEFT JOIN sys_dept sd ON su.dept_id = sd.dept_id
|
<!-- LEFT JOIN sys_dept sd ON su.dept_id = sd.dept_id-->
|
||||||
LEFT JOIN tm_task_agreement tta ON tt.task_id = tta.task_id
|
<!-- LEFT JOIN tm_task_agreement tta ON tt.task_id = tta.task_id-->
|
||||||
LEFT JOIN bm_agreement_info bai ON bai.agreement_id = tta.agreement_id
|
<!-- LEFT JOIN bm_agreement_info bai ON bai.agreement_id = tta.agreement_id-->
|
||||||
LEFT JOIN bm_project bpl ON bpl.pro_id = bai.project_id
|
<!-- LEFT JOIN bm_project bpl ON bpl.pro_id = bai.project_id-->
|
||||||
LEFT JOIN bm_unit bui ON bui.unit_id = bai.unit_id
|
<!-- LEFT JOIN bm_unit bui ON bui.unit_id = bai.unit_id-->
|
||||||
LEFT JOIN lease_apply_info lai ON lai.task_id = tt.task_id
|
<!-- LEFT JOIN lease_apply_info lai ON lai.task_id = tt.task_id-->
|
||||||
WHERE
|
<!-- WHERE-->
|
||||||
tt.task_type = 2 and tt.status = '1'
|
<!-- tt.task_type = 2 and tt.status = '1'-->
|
||||||
<if test="record.taskId != null and record.taskId != '' ">
|
<!-- <if test="record.taskId != null and record.taskId != '' ">-->
|
||||||
AND tt.task_id = #{record.taskId}
|
<!-- AND tt.task_id = #{record.taskId}-->
|
||||||
</if>
|
<!-- </if>-->
|
||||||
|
|
||||||
<if test="record.startTime != null and record.startTime != '' and record.endTime != null and record.endTime != '' ">
|
<!-- <if test="record.startTime != null and record.startTime != '' and record.endTime != null and record.endTime != '' ">-->
|
||||||
AND tt.update_time BETWEEN CONCAT(#{record.startTime}, ' 00:00:00') AND CONCAT(#{record.endTime}, ' 23:59:59')
|
<!-- AND tt.update_time BETWEEN CONCAT(#{record.startTime}, ' 00:00:00') AND CONCAT(#{record.endTime}, ' 23:59:59')-->
|
||||||
</if>
|
<!-- </if>-->
|
||||||
|
|
||||||
<if test="record.unitId != null and record.unitId != ''">
|
<!-- <if test="record.unitId != null and record.unitId != ''">-->
|
||||||
AND bui.unit_id = #{record.unitId}
|
<!-- AND bui.unit_id = #{record.unitId}-->
|
||||||
</if>
|
<!-- </if>-->
|
||||||
|
|
||||||
<if test="record.projectId != null and record.projectId != ''">
|
<!-- <if test="record.projectId != null and record.projectId != ''">-->
|
||||||
AND bpl.pro_id = #{record.projectId}
|
<!-- AND bpl.pro_id = #{record.projectId}-->
|
||||||
</if>
|
<!-- </if>-->
|
||||||
|
|
||||||
<if test="record.keyWord != null and record.keyWord != ''">
|
<!-- <if test="record.keyWord != null and record.keyWord != ''">-->
|
||||||
AND (bai.agreement_code like concat('%', #{record.keyWord}, '%') or
|
<!-- AND (bai.agreement_code like concat('%', #{record.keyWord}, '%') or-->
|
||||||
tt.code like concat('%', #{record.keyWord}, '%'))
|
<!-- tt.code like concat('%', #{record.keyWord}, '%'))-->
|
||||||
</if>
|
<!-- </if>-->
|
||||||
GROUP BY tt.task_id
|
<!-- GROUP BY tt.task_id-->
|
||||||
ORDER BY tt.update_time DESC
|
<!-- ORDER BY tt.update_time DESC-->
|
||||||
</select>
|
<!-- </select>-->
|
||||||
|
|
||||||
<select id="getAuditListByLeaseTmTaskByPeople" resultType="com.bonus.material.task.domain.vo.TmTaskRequestVo">
|
<!-- <select id="getAuditListByLeaseTmTaskByPeople" resultType="com.bonus.material.task.domain.vo.TmTaskRequestVo">-->
|
||||||
SELECT DISTINCT
|
<!-- SELECT DISTINCT-->
|
||||||
tt.*, su.phonenumber AS phoneNumber, sd.dept_name as deptName,
|
<!-- tt.*, su.phonenumber AS phoneNumber, sd.dept_name as deptName,-->
|
||||||
bpl.pro_id as proId,bpl.pro_name as projectName,
|
<!-- bpl.pro_id as proId,bpl.pro_name as projectName,-->
|
||||||
bui.unit_id as unitId,bui.unit_name as unitName,
|
<!-- bui.unit_id as unitId,bui.unit_name as unitName,-->
|
||||||
lai.lease_person as leasePerson, lai.phone as leasePhone, tt.create_by as applyFor,
|
<!-- lai.lease_person as leasePerson, lai.phone as leasePhone, tt.create_by as applyFor,-->
|
||||||
-- d.`name` as taskName,
|
<!-- lai.lease_type as leaseType,lai.estimate_lease_time as estimateLeaseTime,-->
|
||||||
lai.lease_type as leaseType,lai.estimate_lease_time as estimateLeaseTime,
|
<!-- bai.agreement_code as agreementCode,-->
|
||||||
-- case when d.id = '31' then lai.company_audit_remark
|
<!-- tt.create_time as createTimes, tt.update_time as updateTimes-->
|
||||||
-- when d.id = '32' then lai.dept_audit_remark
|
<!-- FROM-->
|
||||||
-- when d.id = '33' then lai.direct_audit_remark
|
<!-- tm_task tt-->
|
||||||
-- when d.id = '98' then lai.company_audit_remark
|
<!-- LEFT JOIN sys_user su ON tt.create_by = su.user_name-->
|
||||||
-- when d.id = '99' then lai.dept_audit_remark
|
<!-- LEFT JOIN sys_dept sd ON su.dept_id = sd.dept_id-->
|
||||||
-- when d.id = '100' then lai.direct_audit_remark
|
<!-- LEFT JOIN tm_task_agreement tta ON tt.task_id = tta.task_id-->
|
||||||
-- end examineStatus ,
|
<!-- LEFT JOIN bm_agreement_info bai ON bai.agreement_id = tta.agreement_id-->
|
||||||
-- d.id as examineStatusId,
|
<!-- LEFT JOIN bm_project bpl ON bpl.pro_id = bai.project_id-->
|
||||||
bai.agreement_code as agreementCode,
|
<!-- LEFT JOIN bm_unit bui ON bui.unit_id = bai.unit_id-->
|
||||||
tt.create_time as createTimes, tt.update_time as updateTimes
|
<!-- LEFT JOIN lease_apply_info lai ON lai.task_id = tt.task_id-->
|
||||||
FROM
|
<!-- WHERE-->
|
||||||
tm_task tt
|
<!-- tt.task_type = 2 and tt.status = '1' and tt.create_by = #{record.createBy}-->
|
||||||
LEFT JOIN sys_user su ON tt.create_by = su.user_name
|
<!-- <if test="record.taskId != null and record.taskId != '' ">-->
|
||||||
LEFT JOIN sys_dept sd ON su.dept_id = sd.dept_id
|
<!-- AND tt.task_id = #{record.taskId}-->
|
||||||
LEFT JOIN tm_task_agreement tta ON tt.task_id = tta.task_id
|
<!-- </if>-->
|
||||||
LEFT JOIN bm_agreement_info bai ON bai.agreement_id = tta.agreement_id
|
|
||||||
LEFT JOIN bm_project bpl ON bpl.pro_id = bai.project_id
|
|
||||||
LEFT JOIN bm_unit bui ON bui.unit_id = bai.unit_id
|
|
||||||
LEFT JOIN lease_apply_info lai ON lai.task_id = tt.task_id
|
|
||||||
-- LEFT JOIN sys_dic d ON d.id = tt.task_status
|
|
||||||
WHERE
|
|
||||||
tt.task_type = 2 and tt.status = '1' and tt.create_by = #{record.createBy}
|
|
||||||
<if test="record.taskId != null and record.taskId != '' ">
|
|
||||||
AND tt.task_id = #{record.taskId}
|
|
||||||
</if>
|
|
||||||
|
|
||||||
<if test="record.startTime != null and record.startTime != '' and record.endTime != null and record.endTime != '' ">
|
<!-- <if test="record.startTime != null and record.startTime != '' and record.endTime != null and record.endTime != '' ">-->
|
||||||
AND tt.update_time BETWEEN CONCAT(#{record.startTime}, ' 00:00:00') AND CONCAT(#{record.endTime}, ' 23:59:59')
|
<!-- AND tt.update_time BETWEEN CONCAT(#{record.startTime}, ' 00:00:00') AND CONCAT(#{record.endTime}, ' 23:59:59')-->
|
||||||
</if>
|
<!-- </if>-->
|
||||||
|
|
||||||
<if test="record.unitId != null and record.unitId != ''">
|
<!-- <if test="record.unitId != null and record.unitId != ''">-->
|
||||||
AND bui.unit_id = #{record.unitId}
|
<!-- AND bui.unit_id = #{record.unitId}-->
|
||||||
</if>
|
<!-- </if>-->
|
||||||
|
|
||||||
<if test="record.projectId != null and record.projectId != ''">
|
<!-- <if test="record.projectId != null and record.projectId != ''">-->
|
||||||
AND bpl.pro_id = #{record.projectId}
|
<!-- AND bpl.pro_id = #{record.projectId}-->
|
||||||
</if>
|
<!-- </if>-->
|
||||||
|
|
||||||
<if test="record.keyWord != null and record.keyWord != ''">
|
<!-- <if test="record.keyWord != null and record.keyWord != ''">-->
|
||||||
AND (bai.agreement_code like concat('%', #{record.keyWord}, '%') or
|
<!-- AND (bai.agreement_code like concat('%', #{record.keyWord}, '%') or-->
|
||||||
tt.code like concat('%', #{record.keyWord}, '%'))
|
<!-- tt.code like concat('%', #{record.keyWord}, '%'))-->
|
||||||
</if>
|
<!-- </if>-->
|
||||||
GROUP BY tt.task_id
|
<!-- GROUP BY tt.task_id-->
|
||||||
ORDER BY tt.update_time DESC
|
<!-- ORDER BY tt.update_time DESC-->
|
||||||
</select>
|
<!-- </select>-->
|
||||||
|
|
||||||
<select id="getAuditListByLeaseInfo" resultType="com.bonus.material.lease.domain.LeaseApplyInfo">
|
<!-- <select id="getAuditListByLeaseInfo" resultType="com.bonus.material.lease.domain.LeaseApplyInfo">-->
|
||||||
SELECT
|
<!-- SELECT-->
|
||||||
lai.*
|
<!-- lai.id, lai.code, lai.task_id as taskId, lai.lease_person as leasePerson, lai.phone, lai.type,-->
|
||||||
FROM
|
<!-- lai.create_by as createBy, lai.create_time as createTime, lai.remark, lai.company_id as companyId,-->
|
||||||
lease_apply_info lai
|
<!-- lai.status, lai.direct_id as directId, lai.lease_type as leaseType, lai.estimate_lease_time as estimateLeaseTime,-->
|
||||||
WHERE
|
<!-- lai.cost_bearing_party as costBearingParty-->
|
||||||
lai.task_id = #{record.taskId} AND lai.`code` = #{record.code}
|
<!-- FROM-->
|
||||||
</select>
|
<!-- lease_apply_info lai-->
|
||||||
|
<!-- WHERE-->
|
||||||
|
<!-- lai.task_id = #{record.taskId} AND lai.`code` = #{record.code}-->
|
||||||
|
<!-- </select>-->
|
||||||
|
|
||||||
<select id="getLeaseApplyDetails" resultType="com.bonus.material.lease.domain.LeaseApplyDetails">
|
<!-- <select id="getLeaseApplyDetails" resultType="com.bonus.material.lease.domain.LeaseApplyDetails">-->
|
||||||
SELECT
|
<!-- SELECT-->
|
||||||
lad.*, mt.type_name AS typeModelName, mt1.type_name AS typeName,mt.unit_name as unitName, mt.manage_type as manageType,
|
<!-- lad.*, mt.type_name AS typeModelName, mt1.type_name AS typeName,mt.unit_name as unitName, mt.manage_type as manageType,-->
|
||||||
case WHEN mt.manage_type = '0' then '编号' else '计数' end manageTypeName,
|
<!-- case WHEN mt.manage_type = '0' then '编号' else '计数' end manageTypeName,-->
|
||||||
mt.storage_num, (lad.pre_num - IF(lad.al_num IS NULL,'0',lad.al_num)) AS outNum,mm.ma_code as maCode
|
<!-- mt.storage_num, (lad.pre_num - IF(lad.al_num IS NULL,'0',lad.al_num)) AS outNum,mm.ma_code as maCode-->
|
||||||
FROM
|
<!-- FROM-->
|
||||||
lease_apply_details lad
|
<!-- lease_apply_details lad-->
|
||||||
LEFT JOIN ma_type mt ON lad.type_id = mt.type_id
|
<!-- LEFT JOIN ma_type mt ON lad.type_id = mt.type_id-->
|
||||||
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
|
<!-- LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id-->
|
||||||
LEFT JOIN ma_machine mm ON lad.type_id = mm.type_id
|
<!-- LEFT JOIN ma_machine mm ON lad.type_id = mm.type_id-->
|
||||||
WHERE
|
<!-- WHERE-->
|
||||||
lad.parent_id = #{record.id} AND lad.company_id = #{record.companyId}
|
<!-- lad.parent_id = #{record.taskId}-->
|
||||||
GROUP BY
|
<!-- GROUP BY-->
|
||||||
lad.id
|
<!-- lad.id-->
|
||||||
</select>
|
<!-- </select>-->
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue