2026.4.28 午 14:50

平库出库确认
This commit is contained in:
1009473166@qq.com
2026-04-28 14:50:39 +08:00
parent 411e3a2c4f
commit 6851a898ca
5 changed files with 50 additions and 2 deletions

View File

@@ -15,13 +15,16 @@ import com.ruoyi.pda.service.PdaService;
import com.ruoyi.stock.stock.domain.BasStock; import com.ruoyi.stock.stock.domain.BasStock;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import java.util.HashMap;
import java.util.List; import java.util.List;
@Controller @Controller
@@ -204,6 +207,7 @@ public class PdaController extends BaseController {
/** /**
* 立库出库信息校验 * 立库出库信息校验
*
* @param trayCodeMakeSure * @param trayCodeMakeSure
* @return * @return
*/ */
@@ -212,7 +216,7 @@ public class PdaController extends BaseController {
public AjaxResult verifyMaterial(@RequestBody TrayCodeMakeSure trayCodeMakeSure) { public AjaxResult verifyMaterial(@RequestBody TrayCodeMakeSure trayCodeMakeSure) {
String trayCode = trayCodeMakeSure.getTrayCode(); String trayCode = trayCodeMakeSure.getTrayCode();
List<MydoJobDetail> mydoJobDetailList = trayCodeMakeSure.getMydoJobDetailList(); List<MydoJobDetail> mydoJobDetailList = trayCodeMakeSure.getMydoJobDetailList();
for (MydoJobDetail m : mydoJobDetailList ) { for (MydoJobDetail m : mydoJobDetailList) {
Integer count = pdaService.selectByTrayCodeAndProduct(trayCode, m.getProductId()); Integer count = pdaService.selectByTrayCodeAndProduct(trayCode, m.getProductId());
if (count == 0) { if (count == 0) {
return AjaxResult.error(m.getProductId() + ",物料不是出库物料"); return AjaxResult.error(m.getProductId() + ",物料不是出库物料");
@@ -222,6 +226,34 @@ public class PdaController extends BaseController {
return AjaxResult.success(); return AjaxResult.success();
} }
/**
* 平库出库确认
* @param trayCodeMakeSure
* @return
*/
@RequestMapping("/completeOutPk")
@ResponseBody
@Async
@Transactional(rollbackFor = Exception.class)
public AjaxResult completeOutPk(@RequestBody TrayCodeMakeSure trayCodeMakeSure) {
try {
String trayCode = trayCodeMakeSure.getTrayCode();
List<MydoJobDetail> mydoJobDetailList = trayCodeMakeSure.getMydoJobDetailList();
for (MydoJobDetail m : mydoJobDetailList) {
HashMap<String, Object> map = new HashMap<>();
map.put("v_tray_code", trayCode);
map.put("v_out_stockout_detail_id", m.getStockinDetailId());
map.put("v_quantity", m.getOutQuantity());
pdaService.completeOutPk(map);
if (!map.get("v_result").equals("10")) {
return AjaxResult.error(map.get("v_result_msg").toString());
}
}
return AjaxResult.success();
} catch (Exception e) {
throw new RuntimeException(e.getMessage());
}
}
} }

View File

@@ -46,4 +46,6 @@ public interface PdaMapper {
void completeInPk(HashMap<String, Object> map); void completeInPk(HashMap<String, Object> map);
Integer selectByTrayCodeAndProduct(@Param("trayCode") String trayCode, @Param("productId") String productId); Integer selectByTrayCodeAndProduct(@Param("trayCode") String trayCode, @Param("productId") String productId);
void completeOutPk(HashMap<String, Object> map);
} }

View File

@@ -8,6 +8,7 @@ import com.ruoyi.pda.domain.TrayCodeMakeSure;
import com.ruoyi.pda.domain.TrayCodeMsg; import com.ruoyi.pda.domain.TrayCodeMsg;
import com.ruoyi.stock.stock.domain.BasStock; import com.ruoyi.stock.stock.domain.BasStock;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects; import java.util.Objects;
@@ -63,4 +64,6 @@ public interface PdaService {
AjaxResult selectBasStockHc(String trayCode); AjaxResult selectBasStockHc(String trayCode);
Integer selectByTrayCodeAndProduct(String trayCode, String productId); Integer selectByTrayCodeAndProduct(String trayCode, String productId);
void completeOutPk(HashMap<String, Object> map);
} }

View File

@@ -331,4 +331,9 @@ public class PdaServiceImp implements PdaService {
public Integer selectByTrayCodeAndProduct(String trayCode, String productId) { public Integer selectByTrayCodeAndProduct(String trayCode, String productId) {
return pdaMapper.selectByTrayCodeAndProduct(trayCode,productId); return pdaMapper.selectByTrayCodeAndProduct(trayCode,productId);
} }
@Override
public void completeOutPk(HashMap<String, Object> map) {
pdaMapper.completeOutPk(map);
}
} }

View File

@@ -168,7 +168,13 @@
where job_id in (select job_id from mydo_job where tray_code = #{trayCode} and in_or_out > 20) where job_id in (select job_id from mydo_job where tray_code = #{trayCode} and in_or_out > 20)
and product_id = #{productId} and product_id = #{productId}
</select> </select>
<select id="completeOutPk" parameterType="java.util.Map" statementType="CALLABLE">
{call proc_complete_out_pk(#{v_tray_code,mode=IN,jdbcType=VARCHAR},
#{v_out_stockout_detail_id,mode=IN,jdbcType=VARCHAR},
#{v_quantity,mode=IN,jdbcType=VARCHAR},
#{v_result,mode=OUT,jdbcType=INTEGER},
#{v_result_msg,mode=OUT,jdbcType=VARCHAR})}
</select>
</mapper> </mapper>