成套机具代码提交
This commit is contained in:
parent
f94470a742
commit
62f2330ffb
|
|
@ -196,4 +196,6 @@ public interface BackReceiveMapper {
|
|||
List<Integer> getMaId(BackApplyInfo backApplyInfo);
|
||||
|
||||
int selectNumByTypeId(@Param("parentId")Integer parentId,@Param("typeId") String typeId);
|
||||
|
||||
int selectTaskStatus(int taskId);
|
||||
}
|
||||
|
|
@ -148,6 +148,11 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
int res;
|
||||
try {
|
||||
int taskId = record.getTaskId();
|
||||
//先判断是否已经完成退料了
|
||||
int taskStatus = selectTaskStatus(taskId);
|
||||
if (taskStatus == 0) {
|
||||
throw new RuntimeException("该退料单已完成退料");
|
||||
}
|
||||
//修改任务状态
|
||||
res = updateTaskStatus(taskId, 40);
|
||||
if (res == 0) {
|
||||
|
|
@ -197,7 +202,7 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
if (allList != null && allList.size() > 0) {
|
||||
res = updateSlt(record, allList);
|
||||
if (res == 0) {
|
||||
throw new RuntimeException("slt_agreement_info");
|
||||
throw new RuntimeException("该机具未被领料使用");
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
|
@ -206,6 +211,15 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
return res;
|
||||
}
|
||||
|
||||
private int selectTaskStatus(int taskId) {
|
||||
int taskStatus = backReceiveMapper.selectTaskStatus(taskId);
|
||||
if (taskStatus == 40) {
|
||||
return 0;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
private int updateSlt(BackApplyInfo record, List<BackApplyInfo> hgList) {
|
||||
for (BackApplyInfo bean : hgList) {
|
||||
List<SltAgreementInfo> infoList = backReceiveMapper.getStlInfo(bean);
|
||||
|
|
|
|||
|
|
@ -50,8 +50,6 @@ public class WarehouseKeeperServiceImpl implements WarehouseKeeperService {
|
|||
int i = 0;
|
||||
if (list.size() > 0) {
|
||||
i = warehouseKeeperMapper.add(list);
|
||||
}else{
|
||||
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -667,7 +667,7 @@
|
|||
mt2.type_name AS typeName,
|
||||
bad.pre_num as preNum,
|
||||
bad.status as status,
|
||||
IFNULL(bad.audit_num,0)-IFNULL(aa.back_num,0) as partNum,
|
||||
IFNULL(bad.audit_num,0)-IFNULL(aa.back_num,0) as num,
|
||||
mt.manage_type as manageType,
|
||||
CONCAT('NSJJ',mt.`code`,mt.model_code) as `code`
|
||||
FROM
|
||||
|
|
@ -931,6 +931,7 @@
|
|||
<select id="getMaId" resultType="java.lang.Integer">
|
||||
select ma_id from back_check_details where parent_id = #{parentId} and type_id = #{typeId}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectTaskStatus" resultType="java.lang.Integer">
|
||||
select task_status from tm_task where task_id = #{taskId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -5,6 +5,7 @@ import java.util.List;
|
|||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
||||
import com.bonus.sgzb.material.domain.MachinePart;
|
||||
import com.bonus.sgzb.material.domain.PurchaseInput;
|
||||
import com.bonus.sgzb.material.service.IPurchaseCheckInfoService;
|
||||
import com.bonus.sgzb.material.domain.PurchaseCheckInfo;
|
||||
|
|
@ -30,8 +31,7 @@ import com.bonus.sgzb.common.core.web.page.TableDataInfo;
|
|||
@RestController
|
||||
@Api(value = "新购验收任务")
|
||||
@RequestMapping("/purchaseCheckInfo")
|
||||
public class PurchaseCheckInfoController extends BaseController
|
||||
{
|
||||
public class PurchaseCheckInfoController extends BaseController {
|
||||
@Autowired
|
||||
private IPurchaseCheckInfoService purchaseCheckInfoService;
|
||||
|
||||
|
|
@ -59,13 +59,23 @@ public class PurchaseCheckInfoController extends BaseController
|
|||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 成套机具明细查看
|
||||
*/
|
||||
@ApiOperation("成套机具明细查看")
|
||||
@GetMapping("/wholeSetDetails")
|
||||
public TableDataInfo wholeSetDetails(PurchaseCheckInfo purchaseCheckInfo) {
|
||||
startPage();
|
||||
List<MachinePart> list = purchaseCheckInfoService.getWholeSetDetails(purchaseCheckInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询新购验收任务列表
|
||||
*/
|
||||
@ApiOperation("查询新购验收任务列表")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(PurchaseCheckInfo purchaseCheckInfo)
|
||||
{
|
||||
public TableDataInfo list(PurchaseCheckInfo purchaseCheckInfo) {
|
||||
startPage();
|
||||
List<PurchaseCheckInfo> list = purchaseCheckInfoService.selectPurchaseCheckInfoList(purchaseCheckInfo);
|
||||
return getDataTable(list);
|
||||
|
|
@ -77,8 +87,7 @@ public class PurchaseCheckInfoController extends BaseController
|
|||
@ApiOperation("导出新购验收任务列表")
|
||||
@Log(title = "新购验收任务", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, PurchaseCheckInfo purchaseCheckInfo)
|
||||
{
|
||||
public void export(HttpServletResponse response, PurchaseCheckInfo purchaseCheckInfo) {
|
||||
List<PurchaseCheckInfo> list = purchaseCheckInfoService.exportList(purchaseCheckInfo);
|
||||
ExcelUtil<PurchaseCheckInfo> util = new ExcelUtil<PurchaseCheckInfo>(PurchaseCheckInfo.class);
|
||||
util.exportExcel(response, list, "新购验收任务数据");
|
||||
|
|
@ -90,8 +99,7 @@ public class PurchaseCheckInfoController extends BaseController
|
|||
@ApiOperation("导出新购工机具入库")
|
||||
@Log(title = "导出新购工机具入库", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/putInExport")
|
||||
public void putInExport(HttpServletResponse response, PurchaseCheckInfo purchaseCheckInfo)
|
||||
{
|
||||
public void putInExport(HttpServletResponse response, PurchaseCheckInfo purchaseCheckInfo) {
|
||||
List<PurchaseInput> list = purchaseCheckInfoService.putInExportList(purchaseCheckInfo);
|
||||
ExcelUtil<PurchaseInput> util = new ExcelUtil<PurchaseInput>(PurchaseInput.class);
|
||||
util.exportExcel(response, list, "新购工机具入库");
|
||||
|
|
@ -103,8 +111,7 @@ public class PurchaseCheckInfoController extends BaseController
|
|||
@ApiOperation("获取新购验收任务详细信息")
|
||||
@GetMapping(value = "/getDetails")
|
||||
public AjaxResult getInfo(@RequestParam(required = false) Long taskId,
|
||||
@RequestParam(required = false) String keyWord)
|
||||
{
|
||||
@RequestParam(required = false) String keyWord) {
|
||||
return success(purchaseCheckInfoService.selectPurchaseCheckInfoByTaskId(taskId, keyWord));
|
||||
}
|
||||
|
||||
|
|
@ -114,8 +121,7 @@ public class PurchaseCheckInfoController extends BaseController
|
|||
@ApiOperation("获取新购验收任务验收单")
|
||||
@GetMapping(value = "/getAcceptanceForm")
|
||||
public AjaxResult getAcceptanceForm(@RequestParam(required = false) Long taskId,
|
||||
@RequestParam(required = false) String keyWord)
|
||||
{
|
||||
@RequestParam(required = false) String keyWord) {
|
||||
return success(purchaseCheckInfoService.getAcceptanceForm(taskId, keyWord));
|
||||
}
|
||||
|
||||
|
|
@ -125,8 +131,7 @@ public class PurchaseCheckInfoController extends BaseController
|
|||
@ApiOperation("新增新购验收任务")
|
||||
@Log(title = "新购验收任务", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody PurchaseCheckInfo purchaseCheckInfo)
|
||||
{
|
||||
public AjaxResult add(@RequestBody PurchaseCheckInfo purchaseCheckInfo) {
|
||||
return toAjax(purchaseCheckInfoService.insertPurchaseCheckInfo(purchaseCheckInfo));
|
||||
}
|
||||
|
||||
|
|
@ -155,8 +160,7 @@ public class PurchaseCheckInfoController extends BaseController
|
|||
@ApiOperation("删除新购验收任务")
|
||||
@Log(title = "新购验收任务", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{taskId}")
|
||||
public AjaxResult remove(@PathVariable Long taskId)
|
||||
{
|
||||
public AjaxResult remove(@PathVariable Long taskId) {
|
||||
return toAjax(purchaseCheckInfoService.deletePurchaseCheckInfoByTaskId(taskId));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.bonus.sgzb.material.mapper;
|
||||
|
||||
import com.bonus.sgzb.material.domain.BmNoticeInfo;
|
||||
import com.bonus.sgzb.material.domain.MachinePart;
|
||||
import com.bonus.sgzb.material.domain.PurchaseCheckInfo;
|
||||
import com.bonus.sgzb.material.domain.PurchaseInput;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
|
@ -15,8 +16,7 @@ import java.util.List;
|
|||
* @date 2023-12-10
|
||||
*/
|
||||
@Mapper
|
||||
public interface PurchaseCheckInfoMapper
|
||||
{
|
||||
public interface PurchaseCheckInfoMapper {
|
||||
/**
|
||||
* 查询新购验收任务purchase_check_info
|
||||
*
|
||||
|
|
@ -67,14 +67,15 @@ public interface PurchaseCheckInfoMapper
|
|||
|
||||
/**
|
||||
* 查询新购入库任务列表
|
||||
* @param taskId
|
||||
** @param type 1-验收,2-入库
|
||||
*
|
||||
* @param taskId * @param type 1-验收,2-入库
|
||||
* @return
|
||||
*/
|
||||
String selectTypeNameByTaskId(@Param("taskId") Long taskId, @Param("type") String type);
|
||||
|
||||
/**
|
||||
* 插入
|
||||
*
|
||||
* @param bmNoticeInfo
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -82,6 +83,7 @@ public interface PurchaseCheckInfoMapper
|
|||
|
||||
/**
|
||||
* 查询
|
||||
*
|
||||
* @param purchaseCheckInfo
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -89,12 +91,15 @@ public interface PurchaseCheckInfoMapper
|
|||
|
||||
/**
|
||||
* 新购验收
|
||||
*
|
||||
* @param purchaseCheckInfo
|
||||
* @return
|
||||
*/
|
||||
List<PurchaseCheckInfo> exportList(PurchaseCheckInfo purchaseCheckInfo);
|
||||
|
||||
/**
|
||||
* 新购入库导出
|
||||
*
|
||||
* @param purchaseCheckInfo
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -102,6 +107,7 @@ public interface PurchaseCheckInfoMapper
|
|||
|
||||
/**
|
||||
* 查询
|
||||
*
|
||||
* @param purchaseCheckInfo
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -109,8 +115,11 @@ public interface PurchaseCheckInfoMapper
|
|||
|
||||
/**
|
||||
* 查询 类型名称和管理类型
|
||||
*
|
||||
* @param taskId
|
||||
* @return
|
||||
*/
|
||||
List<PurchaseCheckInfo> selectTypeNameAndManageTypeByTaskId(Long taskId);
|
||||
|
||||
List<MachinePart> getWholeSetDetails(PurchaseCheckInfo purchaseCheckInfo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.bonus.sgzb.material.service;
|
||||
|
||||
import com.bonus.sgzb.material.domain.BmNoticeInfo;
|
||||
import com.bonus.sgzb.material.domain.MachinePart;
|
||||
import com.bonus.sgzb.material.domain.PurchaseCheckInfo;
|
||||
import com.bonus.sgzb.material.domain.PurchaseInput;
|
||||
import com.bonus.sgzb.material.vo.NoticeInfoVO;
|
||||
|
|
@ -107,4 +108,6 @@ public interface IPurchaseCheckInfoService
|
|||
* @return
|
||||
*/
|
||||
List<PurchaseCheckInfo> selectPutInListExamine(PurchaseCheckInfo purchaseCheckInfo);
|
||||
|
||||
List<MachinePart> getWholeSetDetails(PurchaseCheckInfo purchaseCheckInfo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -107,6 +107,11 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService {
|
|||
return purchaseCheckInfos;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MachinePart> getWholeSetDetails(PurchaseCheckInfo purchaseCheckInfo) {
|
||||
return purchaseCheckInfoMapper.getWholeSetDetails(purchaseCheckInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询新购验收任务列表
|
||||
*
|
||||
|
|
@ -168,7 +173,9 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService {
|
|||
return purchaseCheckInfoMapper.insertPurchaseCheckInfo(purchaseCheckInfo);
|
||||
}
|
||||
|
||||
/**采购单号编码生成规则*/
|
||||
/**
|
||||
* 采购单号编码生成规则
|
||||
*/
|
||||
private String purchaseCodeRule() {
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
|
||||
Date nowDate = DateUtils.getNowDate();
|
||||
|
|
|
|||
|
|
@ -309,4 +309,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
) t
|
||||
GROUP BY task_id
|
||||
</select>
|
||||
<select id="getWholeSetDetails" resultType="com.bonus.sgzb.material.domain.MachinePart">
|
||||
SELECT
|
||||
mt2.type_name AS typeModelName,
|
||||
mt3.type_name AS typeName,
|
||||
aa.part_num * #{purchaseNum} AS partNum,
|
||||
mt2.unit_name as unitName
|
||||
FROM
|
||||
ma_type mt2
|
||||
LEFT JOIN ma_type mt3 ON mt2.parent_id = mt3.type_id
|
||||
INNER JOIN (
|
||||
SELECT
|
||||
mws.type_id,
|
||||
mws.part_num
|
||||
FROM
|
||||
ma_type mt
|
||||
LEFT JOIN ma_whole_set mws ON mt.type_id = mws.parent_id
|
||||
WHERE
|
||||
mt.type_id = #{typeId}
|
||||
) aa ON aa.type_id = mt2.type_id
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
WHERE mt2.type_name like concat('%', #{keyWord}, '%')
|
||||
</if>
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -885,4 +885,3 @@ export default {
|
|||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
|
||||
Loading…
Reference in New Issue