功能修改
This commit is contained in:
parent
cce2ddf4f9
commit
129550fa13
|
|
@ -1,6 +1,7 @@
|
||||||
package com.bonus.material.lease.controller;
|
package com.bonus.material.lease.controller;
|
||||||
|
|
||||||
import com.bonus.common.biz.annotation.StoreLog;
|
import com.bonus.common.biz.annotation.StoreLog;
|
||||||
|
import com.bonus.common.biz.domain.lease.LeaseOutDetails;
|
||||||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||||
import com.bonus.common.core.web.controller.BaseController;
|
import com.bonus.common.core.web.controller.BaseController;
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
|
|
@ -73,6 +74,32 @@ public class LeaseApplyInfoController extends BaseController {
|
||||||
return success(leaseApplyInfoService.selectLeaseApplyInfoById(id, keyWord));
|
return success(leaseApplyInfoService.selectLeaseApplyInfoById(id, keyWord));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取领料出库内部详细信息
|
||||||
|
* @param leaseApplyDetails
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "获取领料出库内部详细信息")
|
||||||
|
//@RequiresPermissions("lease:info:query")
|
||||||
|
@GetMapping(value = "/getInnerById")
|
||||||
|
public AjaxResult getInnerById(LeaseApplyDetails leaseApplyDetails) {
|
||||||
|
return success(leaseApplyInfoService.getInnerById(leaseApplyDetails));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取领料出库内部详细信息
|
||||||
|
* @param leaseApplyDetails
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "获取领料出库内部详细信息")
|
||||||
|
//@RequiresPermissions("lease:info:query")
|
||||||
|
@GetMapping(value = "/getDetailsById")
|
||||||
|
public AjaxResult getDetailsById(LeaseApplyDetails leaseApplyDetails) {
|
||||||
|
startPage();
|
||||||
|
List<LeaseApplyDetails> list = leaseApplyInfoService.getDetailsById(leaseApplyDetails);
|
||||||
|
return AjaxResult.success(getDataTable(list));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取领料出库单详细信息
|
* 获取领料出库单详细信息
|
||||||
* @param leaseApplyInfo
|
* @param leaseApplyInfo
|
||||||
|
|
@ -207,6 +234,22 @@ public class LeaseApplyInfoController extends BaseController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* app领料出库退回
|
||||||
|
* @param leaseOutDetails
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "app领料出库退回")
|
||||||
|
@PreventRepeatSubmit
|
||||||
|
@PostMapping("/leaseOutBack")
|
||||||
|
public AjaxResult leaseOutBack(@NotNull(message = "领料出库信息不能为空") @RequestBody LeaseOutDetails leaseOutDetails) {
|
||||||
|
try {
|
||||||
|
return leaseApplyInfoService.leaseOutBack(leaseOutDetails);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return error("系统错误, " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除领料任务
|
* 删除领料任务
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -38,11 +38,17 @@ public class LeaseApplyDetails extends BaseEntity {
|
||||||
@ApiModelProperty(value = "规格型号id")
|
@ApiModelProperty(value = "规格型号id")
|
||||||
private Long typeId;
|
private Long typeId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "规格型号id")
|
||||||
|
private Long taskId;
|
||||||
|
|
||||||
/** 规格型号 */
|
/** 规格型号 */
|
||||||
@ApiModelProperty(value = "规格型号名称")
|
@ApiModelProperty(value = "规格型号名称")
|
||||||
@Excel(name = "规格型号")
|
@Excel(name = "规格型号")
|
||||||
private String typeName;
|
private String typeName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "机具编码")
|
||||||
|
private String maCode;
|
||||||
|
|
||||||
/** 计量单位 */
|
/** 计量单位 */
|
||||||
@ApiModelProperty(value = "计量单位")
|
@ApiModelProperty(value = "计量单位")
|
||||||
@Excel(name = "计量单位")
|
@Excel(name = "计量单位")
|
||||||
|
|
|
||||||
|
|
@ -105,4 +105,25 @@ public interface LeaseApplyDetailsMapper {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<LeaseOutVo> selectLeaseOutDetailsList(@Param("id") Long id, @Param("userId") Long userId);
|
List<LeaseOutVo> selectLeaseOutDetailsList(@Param("id") Long id, @Param("userId") Long userId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据领料任务id查询领料任务详细
|
||||||
|
* @param leaseApplyDetails
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
LeaseApplyDetails getInnerById(LeaseApplyDetails leaseApplyDetails);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据领料任务id查询领料任务详细
|
||||||
|
* @param leaseApplyDetails
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<LeaseApplyDetails> getDetailsById(LeaseApplyDetails leaseApplyDetails);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 领料退回
|
||||||
|
* @param leaseOutDetails
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int updateBackDetailsOutNum(LeaseOutDetails leaseOutDetails);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -81,4 +81,11 @@ public interface LeaseOutDetailsMapper {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Type selectByTypeId(LeaseOutDetails record);
|
Type selectByTypeId(LeaseOutDetails record);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据任务id删除领料出库详细
|
||||||
|
* @param leaseOutDetails
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int deleteLeaseOutDetails(LeaseOutDetails leaseOutDetails);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
package com.bonus.material.lease.service;
|
package com.bonus.material.lease.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.bonus.common.biz.domain.lease.LeaseOutDetails;
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.common.biz.domain.lease.LeaseApplyInfo;
|
import com.bonus.common.biz.domain.lease.LeaseApplyInfo;
|
||||||
import com.bonus.material.basic.domain.BmQrcodeInfo;
|
import com.bonus.material.basic.domain.BmQrcodeInfo;
|
||||||
|
|
@ -112,4 +114,25 @@ public interface ILeaseApplyInfoService {
|
||||||
* @param response
|
* @param response
|
||||||
*/
|
*/
|
||||||
void exportInfo(LeaseApplyRequestVo leaseApplyRequestVo, HttpServletResponse response);
|
void exportInfo(LeaseApplyRequestVo leaseApplyRequestVo, HttpServletResponse response);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询内部领料任务详情
|
||||||
|
* @param leaseApplyDetails
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
LeaseApplyDetails getInnerById(LeaseApplyDetails leaseApplyDetails);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询领料任务详情
|
||||||
|
* @param leaseApplyDetails
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<LeaseApplyDetails> getDetailsById(LeaseApplyDetails leaseApplyDetails);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 领料任务出库回退
|
||||||
|
* @param leaseOutDetails
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
AjaxResult leaseOutBack(LeaseOutDetails leaseOutDetails);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -62,4 +62,10 @@ public interface ILeaseOutDetailsService {
|
||||||
|
|
||||||
public AjaxResult leaseOut(LeaseOutDetails record);
|
public AjaxResult leaseOut(LeaseOutDetails record);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* app领料出库退回
|
||||||
|
* @param leaseOutDetails
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
AjaxResult leaseOutBack(LeaseOutDetails leaseOutDetails);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -401,6 +401,36 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 领料单详情
|
||||||
|
* @param leaseApplyDetails
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public LeaseApplyDetails getInnerById(LeaseApplyDetails leaseApplyDetails) {
|
||||||
|
return leaseApplyDetailsMapper.getInnerById(leaseApplyDetails);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 领料单详情
|
||||||
|
* @param leaseApplyDetails
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<LeaseApplyDetails> getDetailsById(LeaseApplyDetails leaseApplyDetails) {
|
||||||
|
return leaseApplyDetailsMapper.getDetailsById(leaseApplyDetails);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* app领料出库退回
|
||||||
|
* @param leaseOutDetails
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AjaxResult leaseOutBack(LeaseOutDetails leaseOutDetails) {
|
||||||
|
return leaseOutDetailsService.leaseOutBack(leaseOutDetails);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出领料单
|
* 导出领料单
|
||||||
* @param response
|
* @param response
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ import com.bonus.material.ma.mapper.MachineMapper;
|
||||||
import com.bonus.material.ma.mapper.TypeMapper;
|
import com.bonus.material.ma.mapper.TypeMapper;
|
||||||
import com.bonus.material.settlement.domain.SltAgreementInfo;
|
import com.bonus.material.settlement.domain.SltAgreementInfo;
|
||||||
import com.bonus.material.settlement.mapper.SltAgreementInfoMapper;
|
import com.bonus.material.settlement.mapper.SltAgreementInfoMapper;
|
||||||
|
import com.bonus.material.task.domain.TmTask;
|
||||||
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 lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
@ -189,13 +190,13 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
|
||||||
if (res == 0) {
|
if (res == 0) {
|
||||||
throw new RuntimeException("出库失败,插入结算记录失败");
|
throw new RuntimeException("出库失败,插入结算记录失败");
|
||||||
}
|
}
|
||||||
/*if (record.getManageType().equals(InputOutEnum.STANDARD_BOX.getTypeId())) {
|
// 6、如果标准箱入库,需要将设备从标准箱移出
|
||||||
// 6、如果标准箱入库,需要将设备从标准箱移出
|
if (record.getMaId() != null) {
|
||||||
res = updateBoxBind(record);
|
res = updateBoxBind(record);
|
||||||
if (res == 0) {
|
if (res == 0) {
|
||||||
throw new RuntimeException("出库失败,移出设备失败");
|
throw new RuntimeException("出库失败,移出设备失败");
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
} else {
|
} else {
|
||||||
return AjaxResult.error("领料出库失败,机具库存不足");
|
return AjaxResult.error("领料出库失败,机具库存不足");
|
||||||
}
|
}
|
||||||
|
|
@ -209,8 +210,86 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
|
||||||
return AjaxResult.success("出库成功");
|
return AjaxResult.success("出库成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* app领料出库退回
|
||||||
|
*
|
||||||
|
* @param leaseOutDetails
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AjaxResult leaseOutBack(LeaseOutDetails leaseOutDetails) {
|
||||||
|
int res = 0;
|
||||||
|
try {
|
||||||
|
// 1 根据任务id查询此任务是否已经完结
|
||||||
|
TmTask tmTask = tmTaskMapper.selectTmTaskByTaskId(Long.valueOf(leaseOutDetails.getTaskId()));
|
||||||
|
if (tmTask != null && tmTask.getTaskStatus().equals(LeaseTaskStatusEnum.LEASE_TASK_FINISHED.getStatus())) {
|
||||||
|
return AjaxResult.error("该任务已完成,不能进行退库操作");
|
||||||
|
}
|
||||||
|
// 3、插入出库记录,修改库存,修改机具状态
|
||||||
|
res = updateRecords(leaseOutDetails);
|
||||||
|
if (res == 0) {
|
||||||
|
throw new RuntimeException("出库退回失败,更新设备规格库存数量时出错!");
|
||||||
|
}
|
||||||
|
// 4、修改任务状态(tm_task)
|
||||||
|
res = editTaskStatus(leaseOutDetails);
|
||||||
|
if (res == 0) {
|
||||||
|
throw new RuntimeException("出库退回失败,修改任务状态失败");
|
||||||
|
}
|
||||||
|
// 5、删除结算记录
|
||||||
|
res = deleteSltInfo(leaseOutDetails);
|
||||||
|
if (res == 0) {
|
||||||
|
throw new RuntimeException("出库失败,插入结算记录失败");
|
||||||
|
}
|
||||||
|
} catch (RuntimeException re) {
|
||||||
|
return AjaxResult.error("出库退回失败");
|
||||||
|
}
|
||||||
|
return AjaxResult.success("出库退回成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除结算记录
|
||||||
|
* @param leaseOutDetails
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private int deleteSltInfo(LeaseOutDetails leaseOutDetails) {
|
||||||
|
return sltAgreementInfoMapper.deleteSltInfo(leaseOutDetails);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改任务状态(tm_task)
|
||||||
|
* @param leaseOutDetails
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private int editTaskStatus(LeaseOutDetails leaseOutDetails) {
|
||||||
|
return tmTaskMapper.updateTaskStatus(leaseOutDetails.getTaskId(), LeaseTaskStatusEnum.LEASE_TASK_IN_PROGRESS.getStatus());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新出库记录
|
||||||
|
* @param leaseOutDetails
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private int updateRecords(LeaseOutDetails leaseOutDetails) {
|
||||||
|
int res = 0;
|
||||||
|
// 首先更新领料任务详情表的领料数及状态(lease_apply_details)
|
||||||
|
leaseOutDetails.setUpdateBy(SecurityUtils.getUsername());
|
||||||
|
res = leaseApplyDetailsMapper.updateBackDetailsOutNum(leaseOutDetails);
|
||||||
|
if (res > 0) {
|
||||||
|
// 删除领料出库明细表(lease_out_details)
|
||||||
|
res = leaseOutDetailsMapper.deleteLeaseOutDetails(leaseOutDetails);
|
||||||
|
if (res > 0) {
|
||||||
|
// 普通机具减少 (ma_type 设备规格表)的库存数量
|
||||||
|
res = typeMapper.addMaTypeStockNum(leaseOutDetails);
|
||||||
|
// 更新 (ma_machine 设备表)的状态
|
||||||
|
machineMapper.updateMaMachineStatus(leaseOutDetails, MaMachineStatusEnum.IN_STORE.getStatus());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 标准箱移出设备
|
* 标准箱移出设备
|
||||||
|
*
|
||||||
* @param record
|
* @param record
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -284,7 +363,7 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (record.getOutNum() == null ) {
|
if (record.getOutNum() == null) {
|
||||||
record.setOutNum(BigDecimal.valueOf(0L));
|
record.setOutNum(BigDecimal.valueOf(0L));
|
||||||
}
|
}
|
||||||
//判断(ma_type 设备规格表)中的库存够不够出库的
|
//判断(ma_type 设备规格表)中的库存够不够出库的
|
||||||
|
|
|
||||||
|
|
@ -158,4 +158,11 @@ public interface TypeMapper {
|
||||||
int deleteTypeRepairerByTypeId(Type type);
|
int deleteTypeRepairerByTypeId(Type type);
|
||||||
|
|
||||||
int insertTypeRepairer(Type repairer);
|
int insertTypeRepairer(Type repairer);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 库存退回
|
||||||
|
* @param leaseOutDetails
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int addMaTypeStockNum(@Param("record") LeaseOutDetails leaseOutDetails);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -97,4 +97,11 @@ public interface SltAgreementInfoMapper {
|
||||||
* 退料驳回结算信息处理
|
* 退料驳回结算信息处理
|
||||||
*/
|
*/
|
||||||
int backRejectSltCope(Long backTaskId);
|
int backRejectSltCope(Long backTaskId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退料结算信息删除
|
||||||
|
* @param leaseOutDetails
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int deleteSltInfo(@Param("record") LeaseOutDetails leaseOutDetails);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -147,7 +147,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<delete id="deleteBoxBind">
|
<delete id="deleteBoxBind">
|
||||||
delete from bm_qrcode_box_bind where box_id = #{boxId} and ma_id = #{maId}
|
delete from bm_qrcode_box_bind where ma_id = #{maId}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<insert id="addQrcodeBoxBind">
|
<insert id="addQrcodeBoxBind">
|
||||||
|
|
|
||||||
|
|
@ -212,6 +212,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
parent_id = #{record.parentId} and type_id = #{record.typeId}
|
parent_id = #{record.parentId} and type_id = #{record.typeId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<update id="updateBackDetailsOutNum">
|
||||||
|
UPDATE
|
||||||
|
lease_apply_details
|
||||||
|
SET
|
||||||
|
al_num = al_num - #{outNum},
|
||||||
|
<if test="record.updateBy != null and record.updateBy!= '' ">
|
||||||
|
update_by = #{updateBy},
|
||||||
|
</if>
|
||||||
|
update_time = now(),
|
||||||
|
status = '1'
|
||||||
|
WHERE
|
||||||
|
parent_id = #{parentId} and type_id = #{typeId}
|
||||||
|
</update>
|
||||||
|
|
||||||
<select id="getOutboundNum" resultType="com.bonus.material.lease.domain.LeaseApplyDetails">
|
<select id="getOutboundNum" resultType="com.bonus.material.lease.domain.LeaseApplyDetails">
|
||||||
SELECT id, parent_id as parentId, type_id as typeId, pre_num as preNum, al_num as alNum, `status`, remark
|
SELECT id, parent_id as parentId, type_id as typeId, pre_num as preNum, al_num as alNum, `status`, remark
|
||||||
FROM lease_apply_details
|
FROM lease_apply_details
|
||||||
|
|
@ -304,4 +318,68 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
WHERE lod.parent_id = #{id}
|
WHERE lod.parent_id = #{id}
|
||||||
GROUP BY lod.type_id, mm.ma_code
|
GROUP BY lod.type_id, mm.ma_code
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getInnerById" resultType="com.bonus.material.lease.domain.LeaseApplyDetails">
|
||||||
|
select lad.id as id,
|
||||||
|
lad.parent_id as parentId,
|
||||||
|
mt.type_id as typeId,
|
||||||
|
mt.type_name as typeName,
|
||||||
|
mt2.type_name as maTypeName,
|
||||||
|
CASE mt.manage_type
|
||||||
|
WHEN 0 THEN
|
||||||
|
IFNULL(subquery0.num, 0)
|
||||||
|
ELSE
|
||||||
|
IFNULL(mt.storage_num, 0)
|
||||||
|
END as storageNum,
|
||||||
|
mt.manage_type as manageType,
|
||||||
|
(lad.pre_num - IF(lad.al_num IS NULL, '0', lad.al_num)) AS outNum,
|
||||||
|
IFNULL(lad.pre_num, 0) as preNum,
|
||||||
|
IFNULL(lad.audit_num, 0) as auditNum,
|
||||||
|
IFNULL(lad.al_num, 0) as alNum,
|
||||||
|
IFNULL(lad.status, 0) as status,
|
||||||
|
mt.unit_name as unitName,
|
||||||
|
mt.unit_value as unitValue,
|
||||||
|
lad.create_by as createBy,
|
||||||
|
lad.create_time as createTime,
|
||||||
|
lad.update_by as updateBy,
|
||||||
|
lad.update_time as updateTime,
|
||||||
|
lad.remark as remark,
|
||||||
|
lad.company_id as companyId
|
||||||
|
from lease_apply_details lad
|
||||||
|
left join
|
||||||
|
ma_type mt on lad.type_id = mt.type_id and mt.`level` = '4' and mt.del_flag = '0'
|
||||||
|
left join
|
||||||
|
ma_type mt2 on mt2.type_id = mt.parent_id and mt2.`level` = '3' and mt2.del_flag = '0'
|
||||||
|
left join (SELECT mt.type_id,
|
||||||
|
mt2.type_name AS typeName,
|
||||||
|
mt.type_name AS typeModelName,
|
||||||
|
count(mm.ma_id) num
|
||||||
|
FROM ma_machine mm
|
||||||
|
LEFT JOIN ma_type mt ON mt.type_id = mm.type_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 (1)
|
||||||
|
GROUP BY mt.type_id) AS subquery0 ON subquery0.type_id = mt.type_id
|
||||||
|
where lad.id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getDetailsById" resultType="com.bonus.material.lease.domain.LeaseApplyDetails">
|
||||||
|
SELECT
|
||||||
|
mt1.type_name as maTypeName,
|
||||||
|
mt.type_name as typeName,
|
||||||
|
mm.ma_code as maCode,
|
||||||
|
lod.create_by as createBy,
|
||||||
|
lod.create_time as createTime
|
||||||
|
FROM
|
||||||
|
lease_out_details lod
|
||||||
|
LEFT JOIN ma_type mt ON lod.type_id = mt.type_id
|
||||||
|
AND mt.del_flag = '0'
|
||||||
|
LEFT JOIN ma_type mt1 ON mt1.type_id = mt.parent_id
|
||||||
|
AND mt1.del_flag = '0'
|
||||||
|
LEFT JOIN lease_apply_info lai ON lod.parent_id = lai.id
|
||||||
|
LEFT JOIN ma_machine mm ON lod.ma_id = mm.ma_id
|
||||||
|
where lai.task_id = #{taskId} and lod.type_id = #{typeId}
|
||||||
|
ORDER BY
|
||||||
|
lod.create_time DESC
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -176,5 +176,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
<delete id="deleteLeaseOutDetails">
|
||||||
|
delete from lease_out_details where parent_id = #{parentId} and type_id = #{typeId}
|
||||||
|
<if test="maId != null">
|
||||||
|
and ma_id = #{maId}
|
||||||
|
</if>
|
||||||
|
</delete>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
@ -813,5 +813,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
insert into ma_type_repair(type_id, user_id) values (#{typeId},#{repairerId})
|
insert into ma_type_repair(type_id, user_id) values (#{typeId},#{repairerId})
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
<insert id="addMaTypeStockNum">
|
||||||
|
UPDATE
|
||||||
|
ma_type
|
||||||
|
SET
|
||||||
|
storage_num = storage_num + #{record.outNum} ,update_time = NOW()
|
||||||
|
WHERE
|
||||||
|
type_id = #{record.typeId}
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -136,6 +136,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteSltInfo">
|
||||||
|
DELETE FROM slt_agreement_info
|
||||||
|
WHERE
|
||||||
|
lease_id = #{record.parentId}
|
||||||
|
and type_id = #{record.typeId}
|
||||||
|
<if test="record.maId != null">
|
||||||
|
AND ma_id = #{record.maId}
|
||||||
|
</if>
|
||||||
|
</delete>
|
||||||
|
|
||||||
<select id="getSltAgreementInfo" resultType="com.bonus.material.settlement.domain.SltAgreementInfo">
|
<select id="getSltAgreementInfo" resultType="com.bonus.material.settlement.domain.SltAgreementInfo">
|
||||||
SELECT
|
SELECT
|
||||||
id,
|
id,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue