功能优化
This commit is contained in:
parent
80dc08d54e
commit
577b8fa34c
|
|
@ -1,6 +1,7 @@
|
||||||
package com.bonus.material.purchase.controller;
|
package com.bonus.material.purchase.controller;
|
||||||
|
|
||||||
import com.bonus.common.biz.annotation.StoreLog;
|
import com.bonus.common.biz.annotation.StoreLog;
|
||||||
|
import com.bonus.common.biz.enums.HttpCodeEnum;
|
||||||
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;
|
||||||
|
|
@ -53,6 +54,22 @@ public class PurchaseStorageController extends BaseController {
|
||||||
return purchaseStorageService.getMachineById(dto);
|
return purchaseStorageService.getMachineById(dto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询待入库编号机具详情
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "查询待入库编号机具详情")
|
||||||
|
// @RequiresPermissions("purchase:storage:query")
|
||||||
|
@GetMapping("/getMachineByCode")
|
||||||
|
public AjaxResult getMachineByCode(PurchaseDto dto) {
|
||||||
|
try {
|
||||||
|
return purchaseStorageService.getMachineByCode(dto);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return AjaxResult.error("查询待入库设备编码查询失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 驳回或批量驳回
|
* 驳回或批量驳回
|
||||||
* @param dto
|
* @param dto
|
||||||
|
|
|
||||||
|
|
@ -126,4 +126,11 @@ public interface PurchaseBindMapper {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int updatePurchaseBindByTaskIdAndTypeId(@Param("taskId") String taskId,@Param("typeId") Long typeId,@Param("count") int count);
|
int updatePurchaseBindByTaskIdAndTypeId(@Param("taskId") String taskId,@Param("typeId") Long typeId,@Param("count") int count);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询待入库编号机具详情
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<PurchaseCheckDetails> getMachineByCode(PurchaseDto dto);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -47,4 +47,11 @@ public interface IPurchaseStorageService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
AjaxResult getMachineById(PurchaseDto dto);
|
AjaxResult getMachineById(PurchaseDto dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询待入库编号机具详情
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
AjaxResult getMachineByCode(PurchaseDto dto);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -128,6 +128,20 @@ public class PurchaseStorageServiceImpl implements IPurchaseStorageService {
|
||||||
return AjaxResult.success(list);
|
return AjaxResult.success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询待入库编号机具详情
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AjaxResult getMachineByCode(PurchaseDto dto) {
|
||||||
|
List<PurchaseCheckDetails> purchaseCheckDetails = purchaseBindMapper.getMachineByCode(dto);
|
||||||
|
if (CollectionUtils.isEmpty(purchaseCheckDetails)) {
|
||||||
|
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), "该设备不属于该批次,请重新输入!");
|
||||||
|
}
|
||||||
|
return AjaxResult.success(purchaseCheckDetails);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 内层驳回
|
* 内层驳回
|
||||||
* @param purchaseDto
|
* @param purchaseDto
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,23 @@ public class ScrapReasonController extends BaseController {
|
||||||
return success(list);
|
return success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询报废原因下拉列表 app用
|
||||||
|
* @param scrapReason
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "查询报废原因下拉列表 app用")
|
||||||
|
//@RequiresPermissions("scrap:reason:list")
|
||||||
|
@GetMapping("/getList")
|
||||||
|
public AjaxResult getList(ScrapReason scrapReason) {
|
||||||
|
try {
|
||||||
|
List<ScrapReason> list = scrapReasonService.getList(scrapReason);
|
||||||
|
return success(list);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return AjaxResult.error("报废原因数据查询失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询报废原因列表
|
* 查询报废原因列表
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -71,4 +71,11 @@ public interface ScrapReasonMapper
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
int deleteScrapReasonInfo(ScrapReason scrapReason);
|
int deleteScrapReasonInfo(ScrapReason scrapReason);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询报废原因列表
|
||||||
|
* @param scrapReason
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<ScrapReason> getList(ScrapReason scrapReason);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -67,4 +67,11 @@ public interface IScrapReasonService {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
int deleteScrapReasonInfo(ScrapReason scrapReason);
|
int deleteScrapReasonInfo(ScrapReason scrapReason);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询报废原因下拉列表 app用
|
||||||
|
* @param scrapReason
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<ScrapReason> getList(ScrapReason scrapReason);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -130,4 +130,14 @@ public class ScrapReasonServiceImpl implements IScrapReasonService
|
||||||
throw new ServiceException("删除失败");
|
throw new ServiceException("删除失败");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询报废原因下拉列表 app用
|
||||||
|
* @param scrapReason
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<ScrapReason> getList(ScrapReason scrapReason) {
|
||||||
|
return scrapReasonMapper.getList(scrapReason);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -393,4 +393,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<select id="checkQrCodeIsBind" resultType="boolean">
|
<select id="checkQrCodeIsBind" resultType="boolean">
|
||||||
select count(1) > 0 from bm_qrcode_info where qr_code = #{qrCode} and is_bind = '1' and del_flag = '0'
|
select count(1) > 0 from bm_qrcode_info where qr_code = #{qrCode} and is_bind = '1' and del_flag = '0'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getMachineByCode" resultType="com.bonus.material.purchase.domain.PurchaseCheckDetails">
|
||||||
|
SELECT
|
||||||
|
pcd.id AS id,
|
||||||
|
pmi.task_id AS taskId,
|
||||||
|
pmi.type_id AS typeId,
|
||||||
|
pmi.ma_code AS maCode,
|
||||||
|
mt2.type_name AS maTypeName,
|
||||||
|
mt1.type_name AS typeName
|
||||||
|
FROM
|
||||||
|
bm_qrcode_info pmi
|
||||||
|
LEFT JOIN ma_machine mm ON pmi.ma_code = mm.ma_code
|
||||||
|
AND mm.type_id = #{typeId}
|
||||||
|
LEFT JOIN ma_type mt1 ON mt1.type_id = mm.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 purchase_check_details pcd on pmi.task_id = pcd.task_id
|
||||||
|
and pmi.type_id = pcd.type_id
|
||||||
|
WHERE
|
||||||
|
pmi.task_id = #{taskId} AND pmi.type_id = #{typeId} AND mm.ma_status = '0'
|
||||||
|
AND pmi.ma_code = #{maCode}
|
||||||
|
GROUP BY
|
||||||
|
pmi.id
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -103,6 +103,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getList" resultType="com.bonus.material.scrap.domain.ScrapReason">
|
||||||
|
SELECT
|
||||||
|
sc.id AS id,
|
||||||
|
sc.type_id AS typeId,
|
||||||
|
mt.type_name AS typeName,
|
||||||
|
mt1.type_id AS parentId,
|
||||||
|
mt1.type_name AS parentName,
|
||||||
|
sc.update_time AS updateTime,
|
||||||
|
sc.reason AS reason
|
||||||
|
FROM
|
||||||
|
scrap_reason sc
|
||||||
|
LEFT JOIN ma_type mt ON sc.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 mt2.parent_id = mt.type_id
|
||||||
|
AND mt2.del_flag = 0
|
||||||
|
WHERE
|
||||||
|
sc.del_flag = 0
|
||||||
|
<if test="typeId != null">
|
||||||
|
AND mt2.type_id = #{typeId}
|
||||||
|
</if>
|
||||||
|
GROUP BY sc.id
|
||||||
|
</select>
|
||||||
|
|
||||||
<update id="updateScrapReasonInfo">
|
<update id="updateScrapReasonInfo">
|
||||||
update scrap_reason
|
update scrap_reason
|
||||||
set type_id = #{typeId},
|
set type_id = #{typeId},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue