出库自动分配

This commit is contained in:
liuhanqing
2025-06-16 16:26:18 +08:00
parent 43797aa35a
commit f54721f937
7 changed files with 75 additions and 15 deletions

View File

@@ -128,4 +128,12 @@ public class OutStockoutController extends BaseController {
String s = outStockoutService.updateOutStockoutStatus(stockoutIds, status, newStatus); String s = outStockoutService.updateOutStockoutStatus(stockoutIds, status, newStatus);
return s; return s;
} }
@PreAuthorize("@ss.hasPermi('out:outStockout:autoAllot')")
@Log(title = "出库单自动分配", businessType = BusinessType.OTHER)
@GetMapping("/autoAllot")
@ResponseBody
public AjaxResult autoAllot(@RequestParam("stockoutId") String stockoutId) {
return outStockoutService.autoAllot(stockoutId);
}
} }

View File

@@ -61,4 +61,6 @@ public interface OutStockoutMapper
public int deleteOutStockoutByStockoutGuids(String[] stockoutGuids); public int deleteOutStockoutByStockoutGuids(String[] stockoutGuids);
public void updateOutStockoutStatus(HashMap<String,String> map); public void updateOutStockoutStatus(HashMap<String,String> map);
void autoAllot(HashMap<String, String> map);
} }

View File

@@ -1,6 +1,8 @@
package com.ruoyi.out.outStockout.service; package com.ruoyi.out.outStockout.service;
import java.util.List; import java.util.List;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.out.outStockout.domain.OutStockout; import com.ruoyi.out.outStockout.domain.OutStockout;
import com.ruoyi.out.outStockout.domain.OutStockoutVo; import com.ruoyi.out.outStockout.domain.OutStockoutVo;
@@ -65,4 +67,6 @@ public interface IOutStockoutService
public String saveBill(OutStockoutVo outStockoutVo); public String saveBill(OutStockoutVo outStockoutVo);
public String updateOutStockoutStatus(String[] stockoutIds, String status,String newStatus); public String updateOutStockoutStatus(String[] stockoutIds, String status,String newStatus);
AjaxResult autoAllot(String stockoutId);
} }

View File

@@ -7,6 +7,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import com.ruoyi.bas.basJobId.service.IBasJobIdService; import com.ruoyi.bas.basJobId.service.IBasJobIdService;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.uuid.UUID; import com.ruoyi.common.utils.uuid.UUID;
import com.ruoyi.out.outStockout.domain.OutStockoutVo; import com.ruoyi.out.outStockout.domain.OutStockoutVo;
import com.ruoyi.out.outStockoutDetail.domain.OutStockoutDetail; import com.ruoyi.out.outStockoutDetail.domain.OutStockoutDetail;
@@ -36,6 +37,8 @@ public class OutStockoutServiceImpl implements IOutStockoutService
@Autowired @Autowired
private OutStockoutDetailMapper outStockoutDetailMapper; private OutStockoutDetailMapper outStockoutDetailMapper;
@Autowired
private IOutStockoutDetailService outStockoutDetailService;
/** /**
* 查询出库主单 * 查询出库主单
@@ -149,4 +152,24 @@ public class OutStockoutServiceImpl implements IOutStockoutService
} }
return stringBuilder.toString(); return stringBuilder.toString();
} }
@Override
public AjaxResult autoAllot(String stockoutId) {
HashMap<String, String> map = new HashMap<>();
StringBuilder stringBuilder = new StringBuilder();
OutStockoutDetail outStockoutDetail = new OutStockoutDetail();
outStockoutDetail.setStockoutId(stockoutId);
List<OutStockoutDetail> outStockoutDetails = outStockoutDetailService.selectOutStockoutDetailList(outStockoutDetail);
for (OutStockoutDetail detail : outStockoutDetails) {
map.put("v_stockout_detail_id", detail.getStockoutDetailId());
outStockoutMapper.autoAllot(map);
if (!"10".equals(map.get("v_result"))){
stringBuilder.append(",").append(map.get("v_resultString"));
}
}
if (stringBuilder.length()>0){
return AjaxResult.warn(stringBuilder.toString());
}
return AjaxResult.success();
}
} }

View File

@@ -148,4 +148,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
) )
} }
</select> </select>
<select id="autoAllot" parameterType="java.util.Map" statementType="CALLABLE">
{
call proc_update_outbill_status(
#{v_stockout_detail_id,mode=IN,jdbcType=VARCHAR},
#{v_result,mode=OUT,jdbcType=VARCHAR},
#{v_resultString,mode=OUT,jdbcType=VARCHAR}
)
}
</select>
</mapper> </mapper>

View File

@@ -56,5 +56,13 @@ export function getOutStockoutDetail(query) {
}) })
} }
export function autoAllot(data) {
return request({
url: '/out/outStockout/autoAllot',
method: 'get',
params: data
})
}

View File

@@ -189,7 +189,7 @@
</template> </template>
<script> <script>
import { listOutStockout } from "@/api/out/outStockout" import { listOutStockout,autoAllot } from "@/api/out/outStockout"
import { getOutStockoutDetail,updateOutStockStatus } from "@/api/out/outStockout" import { getOutStockoutDetail,updateOutStockStatus } from "@/api/out/outStockout"
export default { export default {
@@ -319,8 +319,14 @@ export default {
return return
} }
const stockoutIds = this.selectedRows.map(row => row.stockoutId) const stockoutIds = this.selectedRows.map(row => row.stockoutId)
// TODO: 调用自动分配接口
console.log("自动分配:", stockoutIds) console.log("自动分配:", stockoutIds)
let data = {
stockoutIds: stockoutIds
}
autoAllot(data).then(response => {
this.$modal.msgSuccess(response)
this.getList()
})
}, },
/** 手动分配按钮操作 */ /** 手动分配按钮操作 */
handleManualAllot() { handleManualAllot() {