rev:入库单创建人优化

This commit is contained in:
2024-08-21 17:30:05 +08:00
parent b52aeb2b18
commit e1801ce001
3 changed files with 199 additions and 144 deletions

View File

@@ -13,6 +13,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.nl.b_lms.pdm.bi.slittingproductionplan.service.IPdmBiSlittingproductionplanService; import org.nl.b_lms.pdm.bi.slittingproductionplan.service.IPdmBiSlittingproductionplanService;
@@ -52,6 +53,8 @@ import org.nl.wms.sch.service.dto.PointDto;
import org.nl.wms.sch.tasks.InTask; import org.nl.wms.sch.tasks.InTask;
import org.nl.wms.st.inbill.service.StorPublicService; import org.nl.wms.st.inbill.service.StorPublicService;
import org.nl.wms.st.returns.service.impl.InAndOutRetrunServiceImpl; import org.nl.wms.st.returns.service.impl.InAndOutRetrunServiceImpl;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@@ -61,6 +64,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.*; import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@@ -123,6 +127,8 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
private IpdmBiSubpackagerelationService ipdmBiSubpackagerelationService; private IpdmBiSubpackagerelationService ipdmBiSubpackagerelationService;
@Autowired
private RedissonClient redissonClient;
@Override @Override
public Object pageQuery(Map query, Pageable pageQuery) { public Object pageQuery(Map query, Pageable pageQuery) {
@@ -260,150 +266,163 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
@Override @Override
@Transactional @Transactional
@SneakyThrows
public void divStruct(Map whereJson) { public void divStruct(Map whereJson) {
// 仓位表 RLock lock = redissonClient.getLock(StIvtIostorinvServiceImpl.class.getName());
WQLObject attrTab = WQLObject.getWQLObject("st_ivt_structattr"); boolean tryLock = lock.tryLock(5, TimeUnit.SECONDS);
// 库区表 try {
WQLObject sectTab = WQLObject.getWQLObject("st_ivt_sectattr"); if (tryLock) {
// 参数类型转换 Map-> JSONObject // 仓位表
JSONObject jsonObject = JSONObject.parseObject(JSON.toJSONString(whereJson)); WQLObject attrTab = WQLObject.getWQLObject("st_ivt_structattr");
// 分配明细集合 // 库区表
ArrayList<HashMap> list = (ArrayList<HashMap>) whereJson.get("tableMater"); WQLObject sectTab = WQLObject.getWQLObject("st_ivt_sectattr");
// 类型转换linkenHashMap -> JSONObject // 参数类型转换 Map-> JSONObject
JSONObject jsonDis = list.stream() JSONObject jsonObject = JSONObject.parseObject(JSON.toJSONString(whereJson));
.map(row -> JSONObject.parseObject(JSON.toJSONString(row))) // 分配明细集合
.collect(Collectors.toList()).get(0); ArrayList<HashMap> list = (ArrayList<HashMap>) whereJson.get("tableMater");
// 判断当前木箱是否已经分配过货位 // 类型转换linkenHashMap -> JSONObject
StIvtIostorinvdis disDao = iStIvtIostorinvdisService.getById(jsonDis.getString("iostorinvdis_id")); JSONObject jsonDis = list.stream()
if (ObjectUtil.isNotEmpty(disDao.getStruct_id())) { .map(row -> JSONObject.parseObject(JSON.toJSONString(row)))
throw new BadRequestException("该木箱已经分配过货位,无法继续分配!"); .collect(Collectors.toList()).get(0);
} // 判断当前木箱是否已经分配过货位
// 主表实体类 StIvtIostorinvdis disDao = iStIvtIostorinvdisService.getById(jsonDis.getString("iostorinvdis_id"));
StIvtIostorinv mstDao = this.getById(disDao.getIostorinv_id()); if (ObjectUtil.isNotEmpty(disDao.getStruct_id())) {
// 用于锁定货位 throw new BadRequestException("该木箱已经分配过货位,无法继续分配!");
JSONObject jsonLock = new JSONObject(); }
ArrayList<String> paramLockList = new ArrayList<>(); // 主表实体类
// 仓位对象 StIvtIostorinv mstDao = this.getById(disDao.getIostorinv_id());
JSONObject jsonAttr; // 用于锁定货位
// 是否自动分配货位 JSONObject jsonLock = new JSONObject();
Boolean checked = jsonObject.getBoolean("checked"); ArrayList<String> paramLockList = new ArrayList<>();
String height = ""; // 仓位对象
if (ObjectUtil.isNotEmpty(checked) && checked) { JSONObject jsonAttr;
// 自动分配: 根据仓库、库区匹配一个合适的仓 // 是否自动分配
JSONObject attrParam = new JSONObject(); Boolean checked = jsonObject.getBoolean("checked");
attrParam.put("stor_id", jsonObject.getString("stor_id")); String height = "";
attrParam.put("sect_id", jsonObject.getString("sect_id")); if (ObjectUtil.isNotEmpty(checked) && checked) {
attrParam.put("material_id", disDao.getMaterial_id()); // 自动分配: 根据仓库、库区匹配一个合适的仓位
attrParam.put("box_no", disDao.getBox_no()); JSONObject attrParam = new JSONObject();
BstIvtBoxinfo boxDao = getBstIvtBoxinfo(whereJson); attrParam.put("stor_id", jsonObject.getString("stor_id"));
if (boxDao == null) { attrParam.put("sect_id", jsonObject.getString("sect_id"));
throw new BadRequestException("未找到该木箱信息!"); attrParam.put("material_id", disDao.getMaterial_id());
} attrParam.put("box_no", disDao.getBox_no());
jsonObject.put("box_no",boxDao.getBox_no()); BstIvtBoxinfo boxDao = getBstIvtBoxinfo(whereJson);
jsonObject.put("vehicle_type",boxDao.getVehicle_type()); if (boxDao == null) {
attrParam.put("vehicle_type", boxDao.getVehicle_type()); throw new BadRequestException("未找到该木箱信息!");
//根据木箱高度,判断入库仓位的高度 }
String heightLevel1 = iSysParamService.findByCode("height_level_1").getValue(); jsonObject.put("box_no",boxDao.getBox_no());
String heightLevel2 = iSysParamService.findByCode("height_level_2").getValue(); jsonObject.put("vehicle_type",boxDao.getVehicle_type());
String box_high = boxDao.getBox_high(); attrParam.put("vehicle_type", boxDao.getVehicle_type());
if (Integer.parseInt(box_high) <= Integer.parseInt(heightLevel1)) { //根据木箱高度,判断入库仓位的高度
height = "('1','2','3')"; String heightLevel1 = iSysParamService.findByCode("height_level_1").getValue();
} else if (Integer.parseInt(box_high) > Integer.parseInt(heightLevel1) && Integer.parseInt(box_high) <= Integer.parseInt(heightLevel2)) { String heightLevel2 = iSysParamService.findByCode("height_level_2").getValue();
height = "('2','3')"; String box_high = boxDao.getBox_high();
} else { if (Integer.parseInt(box_high) <= Integer.parseInt(heightLevel1)) {
height = "('3')"; height = "('1','2','3')";
} } else if (Integer.parseInt(box_high) > Integer.parseInt(heightLevel1) && Integer.parseInt(box_high) <= Integer.parseInt(heightLevel2)) {
attrParam.put("height", height); height = "('2','3')";
JSONObject jsonSect = sectTab.query("sect_id = '" + jsonObject.getString("sect_id") + "'").uniqueResult(0); } else {
// 判断是否是虚拟区 height = "('3')";
if (jsonSect.getString("sect_type_attr").equals(IOSEnum.SECT_TYPE.code("虚拟区"))) { }
jsonAttr = attrTab.query("sect_id = '" + jsonObject.getString("sect_id") + "' AND lock_type = '1' AND is_delete = '0' AND IFNULL( storagevehicle_code, '' ) = ''").uniqueResult(0); attrParam.put("height", height);
} else { JSONObject jsonSect = sectTab.query("sect_id = '" + jsonObject.getString("sect_id") + "'").uniqueResult(0);
jsonAttr = inBussManageService.getOneStruct(attrParam); // 判断是否是虚拟区
} if (jsonSect.getString("sect_type_attr").equals(IOSEnum.SECT_TYPE.code("虚拟区"))) {
} else { jsonAttr = attrTab.query("sect_id = '" + jsonObject.getString("sect_id") + "' AND lock_type = '1' AND is_delete = '0' AND IFNULL( storagevehicle_code, '' ) = ''").uniqueResult(0);
// 指定分配 } else {
jsonAttr = attrTab.query("struct_id = '" + jsonDis.getString("struct_id") + "'").uniqueResult(0); jsonAttr = inBussManageService.getOneStruct(attrParam);
} }
if (ObjectUtil.isEmpty(jsonAttr)) { } else {
throw new BadRequestException("没有可用仓位!"); // 指定分配
} jsonAttr = attrTab.query("struct_id = '" + jsonDis.getString("struct_id") + "'").uniqueResult(0);
// 调用业务处理类锁定货位 }
paramLockList.add(jsonAttr.getString("struct_code")); if (ObjectUtil.isEmpty(jsonAttr)) {
jsonLock.put("inv_type", mstDao.getBill_type()); throw new BadRequestException("没有可用仓位!");
jsonLock.put("inv_id", mstDao.getIostorinv_id()); }
jsonLock.put("inv_code", mstDao.getBill_code()); // 调用业务处理类锁定货位
jsonLock.put("lock_type", IOSEnum.LOCK_TYPE.code("入库锁")); paramLockList.add(jsonAttr.getString("struct_code"));
jsonLock.put("operate", IOSEnum.IO_TYPE.code("入库")); jsonLock.put("inv_type", mstDao.getBill_type());
inBussManageService.lockStruct(paramLockList, jsonLock); jsonLock.put("inv_id", mstDao.getIostorinv_id());
// 判断是否虚拟区 jsonLock.put("inv_code", mstDao.getBill_code());
String work_status; jsonLock.put("lock_type", IOSEnum.LOCK_TYPE.code("入库锁"));
Long task_id = null; jsonLock.put("operate", IOSEnum.IO_TYPE.code("入库"));
JSONObject jsonSect = sectTab.query("sect_id = '" + jsonAttr.getString("sect_id") + "'").uniqueResult(0); inBussManageService.lockStruct(paramLockList, jsonLock);
if (jsonSect.getString("sect_type_attr").equals(IOSEnum.SECT_TYPE.code("虚拟区"))) { // 判断是否虚拟区
// 虚拟区:执行状态为完成 String work_status;
work_status = IOSEnum.WORK_STATUS.code("完成"); Long task_id = null;
task_id = IdUtil.getLongId(); JSONObject jsonSect = sectTab.query("sect_id = '" + jsonAttr.getString("sect_id") + "'").uniqueResult(0);
} else { if (jsonSect.getString("sect_type_attr").equals(IOSEnum.SECT_TYPE.code("虚拟区"))) {
work_status = IOSEnum.WORK_STATUS.code("未生成"); // 虚拟区:执行状态为完成
} work_status = IOSEnum.WORK_STATUS.code("完成");
// 更新分配明细 task_id = IdUtil.getLongId();
iStIvtIostorinvdisService.update( } else {
new UpdateWrapper<StIvtIostorinvdis>().lambda() work_status = IOSEnum.WORK_STATUS.code("未生成");
.set(StIvtIostorinvdis::getStruct_id, jsonAttr.getString("struct_id")) }
.set(StIvtIostorinvdis::getStruct_code, jsonAttr.getString("struct_code")) // 更新分配明细
.set(StIvtIostorinvdis::getStruct_name, jsonAttr.getString("struct_name")) iStIvtIostorinvdisService.update(
.set(StIvtIostorinvdis::getSect_id, jsonAttr.getString("sect_id")) new UpdateWrapper<StIvtIostorinvdis>().lambda()
.set(StIvtIostorinvdis::getSect_code, jsonAttr.getString("sect_code")) .set(StIvtIostorinvdis::getStruct_id, jsonAttr.getString("struct_id"))
.set(StIvtIostorinvdis::getSect_name, jsonAttr.getString("sect_name")) .set(StIvtIostorinvdis::getStruct_code, jsonAttr.getString("struct_code"))
.set(StIvtIostorinvdis::getWork_status, work_status) .set(StIvtIostorinvdis::getStruct_name, jsonAttr.getString("struct_name"))
.set(StIvtIostorinvdis::getTask_id, task_id) .set(StIvtIostorinvdis::getSect_id, jsonAttr.getString("sect_id"))
.eq(StIvtIostorinvdis::getIostorinv_id, disDao.getIostorinv_id()) .set(StIvtIostorinvdis::getSect_code, jsonAttr.getString("sect_code"))
.eq(StIvtIostorinvdis::getBox_no, disDao.getBox_no()) .set(StIvtIostorinvdis::getSect_name, jsonAttr.getString("sect_name"))
); .set(StIvtIostorinvdis::getWork_status, work_status)
// 更新库存 .set(StIvtIostorinvdis::getTask_id, task_id)
List<StIvtIostorinvdis> disDaoList = iStIvtIostorinvdisService.list( .eq(StIvtIostorinvdis::getIostorinv_id, disDao.getIostorinv_id())
new QueryWrapper<StIvtIostorinvdis>().lambda() .eq(StIvtIostorinvdis::getBox_no, disDao.getBox_no())
.eq(StIvtIostorinvdis::getIostorinv_id, disDao.getIostorinv_id()) );
.eq(StIvtIostorinvdis::getBox_no, disDao.getBox_no()) // 更新库存
); List<StIvtIostorinvdis> disDaoList = iStIvtIostorinvdisService.list(
upateIvt(disDaoList, mstDao, IOSEnum.IVT_CHANGE.code("加待入")); new QueryWrapper<StIvtIostorinvdis>().lambda()
// 更新明细状态 .eq(StIvtIostorinvdis::getIostorinv_id, disDao.getIostorinv_id())
iStIvtIostorinvdtlService.updateStatus(disDao.getIostorinvdtl_id()); .eq(StIvtIostorinvdis::getBox_no, disDao.getBox_no())
// 更新主表状态 );
StIvtIostorinv mst = updateMstStatus(disDao.getIostorinv_id()); upateIvt(disDaoList, mstDao, IOSEnum.IVT_CHANGE.code("加待入"));
mst.setDis_optid(Long.parseLong(SecurityUtils.getCurrentUserId())); // 更新明细状态
mst.setDis_optname(SecurityUtils.getCurrentNickName()); iStIvtIostorinvdtlService.updateStatus(disDao.getIostorinvdtl_id());
mst.setDis_time(DateUtil.now()); // 更新主表状态
this.updateById(mst); StIvtIostorinv mst = updateMstStatus(disDao.getIostorinv_id());
// 判断是否自动下发任务 mst.setDis_optid(Long.parseLong(SecurityUtils.getCurrentUserId()));
if (jsonObject.getString("is_send").equals(IOSEnum.IS_NOTANDYES.code("")) && ObjectUtil.isNotEmpty(jsonObject.getString("is_send"))) { mst.setDis_optname(SecurityUtils.getCurrentNickName());
JSONObject jsonSend = new JSONObject(); mst.setDis_time(DateUtil.now());
StIvtIostorinvdtl dtlDao = iStIvtIostorinvdtlService.list( this.updateById(mst);
new QueryWrapper<StIvtIostorinvdtl>().lambda() // 判断是否自动下发任务
.eq(StIvtIostorinvdtl::getIostorinv_id, mst.getIostorinv_id()) if (jsonObject.getString("is_send").equals(IOSEnum.IS_NOTANDYES.code("")) && ObjectUtil.isNotEmpty(jsonObject.getString("is_send"))) {
).get(0); JSONObject jsonSend = new JSONObject();
List<LinkedHashMap> disList = iStIvtIostorinvdisService.list( StIvtIostorinvdtl dtlDao = iStIvtIostorinvdtlService.list(
new QueryWrapper<StIvtIostorinvdtl>().lambda()
.eq(StIvtIostorinvdtl::getIostorinv_id, mst.getIostorinv_id())
).get(0);
List<LinkedHashMap> disList = iStIvtIostorinvdisService.list(
new QueryWrapper<StIvtIostorinvdis>().lambda() new QueryWrapper<StIvtIostorinvdis>().lambda()
.eq(StIvtIostorinvdis::getIostorinv_id, mst.getIostorinv_id()) .eq(StIvtIostorinvdis::getIostorinv_id, mst.getIostorinv_id())
).stream().map(row -> JSONObject.parseObject(JSON.toJSONString(row), LinkedHashMap.class)) ).stream().map(row -> JSONObject.parseObject(JSON.toJSONString(row), LinkedHashMap.class))
.collect(Collectors.toList()); .collect(Collectors.toList());
jsonSend.put("dtl_row", JSONObject.parseObject(JSON.toJSONString(dtlDao))); jsonSend.put("dtl_row", JSONObject.parseObject(JSON.toJSONString(dtlDao)));
jsonSend.put("tableMater", disList); jsonSend.put("tableMater", disList);
jsonSend.put("point_code", jsonObject.getString("point_code")); jsonSend.put("point_code", jsonObject.getString("point_code"));
jsonSend.put("stor_id", mst.getStor_id()); jsonSend.put("stor_id", mst.getStor_id());
//成品入库托盘类型 //成品入库托盘类型
jsonSend.put("vehicle_code", jsonObject.getString("box_no")); jsonSend.put("vehicle_code", jsonObject.getString("box_no"));
jsonSend.put("vehicle_code2", jsonObject.getString("vehicle_code")); jsonSend.put("vehicle_code2", jsonObject.getString("vehicle_code"));
JSONObject param = new JSONObject(); JSONObject param = new JSONObject();
param.put("containerType", jsonObject.getString("vehicle_type")); param.put("containerType", jsonObject.getString("vehicle_type"));
param.put("heightLevel", height); param.put("heightLevel", height);
jsonSend.put("request_param", param.toString()); jsonSend.put("request_param", param.toString());
String task_id1 = this.setPoint(jsonSend); String task_id1 = this.setPoint(jsonSend);
// 下发任务 // 下发任务
JSONObject sendJson = new JSONObject(); JSONObject sendJson = new JSONObject();
sendJson.put("task_id", task_id1); sendJson.put("task_id", task_id1);
this.reIssueTask(sendJson); this.reIssueTask(sendJson);
}
} else {
throw new BadRequestException("有入库单据正在分配中,请稍后在试");
}
} finally {
if (tryLock) {
lock.unlock();
}
} }
} }
@@ -648,6 +667,20 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
*/ */
private StIvtIostorinv updataMst(Map whereJson, StIvtIostorinv mstDao) { private StIvtIostorinv updataMst(Map whereJson, StIvtIostorinv mstDao) {
// 明细-用于查找包装关系
ArrayList<HashMap> list = (ArrayList<HashMap>) whereJson.get("tableData");
List<JSONObject> rows = list.stream()
.map(row -> JSONObject.parseObject(JSON.toJSONString(row)))
.collect(Collectors.toList());
if (ObjectUtil.isEmpty(rows)) {
throw new BadRequestException("出入库明细不能为空!");
}
JSONObject jsonSub = WQLObject.getWQLObject("pdm_bi_subpackagerelation")
.query("package_box_sn = '" + rows.get(0).getString("package_box_sn") + "'")
.uniqueResult(0);
// 仓库信息 // 仓库信息
StorattrDto storattrDto = storattrService.findById(Long.parseLong((String) whereJson.get("stor_id"))); StorattrDto storattrDto = storattrService.findById(Long.parseLong((String) whereJson.get("stor_id")));
@@ -655,9 +688,14 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
String currentUserId = SecurityUtils.getCurrentUserId(); String currentUserId = SecurityUtils.getCurrentUserId();
String currentNickName = SecurityUtils.getCurrentNickName(); String currentNickName = SecurityUtils.getCurrentNickName();
if (currentUserId.equals(IOSEnum.EXT_ACS.code("acs"))) { if (currentUserId.equals(IOSEnum.EXT_ACS.code("acs"))) {
// 如果是外部系统创建人全部写系统参数 // 如果是外部系统创建人全部写系统参数: 如果包装关系上有创建人就用包装关系上的,如果没有就用默认的
currentUserId = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("IOS_CONFIRM_USER").getValue(); if (ObjectUtil.isEmpty(jsonSub) || ObjectUtil.isEmpty(jsonSub.getString("create_id"))) {
currentNickName = IOSEnum.EXT_ACS.code("kc"); currentUserId = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("IOS_CONFIRM_USER").getValue();
currentNickName = IOSEnum.EXT_ACS.code("kc");
} else {
currentUserId = jsonSub.getString("create_id");
currentNickName = jsonSub.getString("create_name");
}
} }
// 新增 // 新增

View File

@@ -315,10 +315,21 @@ public class InBoxManageServiceImpl implements InBoxManageService {
public void returnIn(JSONObject whereJson) { public void returnIn(JSONObject whereJson) {
// 载具表 // 载具表
//api/twoPda/vehicle/returnIn //api/twoPda/vehicle/returnIn
// 根据木箱号查询是否有托盘绑定关系,如果有则解绑
JSONObject jsonExt = WQLObject.getWQLObject("md_pb_storagevehicleext")
.query("pcsn = '" + whereJson.getString("box_no") + "'")
.uniqueResult(0);
if (ObjectUtil.isNotEmpty(jsonExt)) {
JSONObject param = new JSONObject();
param.put("pcsn", "");
WQLObject.getWQLObject("md_pb_storagevehicleext")
.update(param,"pcsn = '"+whereJson.getString("box_no")+"'");
}
/* /*
* 查询mes木箱信息插入木箱信息表 * 查询mes木箱信息插入木箱信息表
*/ */
JSONArray resultJSONArray = WQLObject.getWQLObject("pdm_bi_subpackagerelation").query("package_box_sn = '" + whereJson.getString("box_no") + "' AND status = '0'").getResultJSONArray(0); JSONArray resultJSONArray = WQLObject.getWQLObject("pdm_bi_subpackagerelation").query("package_box_sn = '" + whereJson.getString("box_no") + "' AND status = '0'").getResultJSONArray(0);
if (ObjectUtil.isEmpty(resultJSONArray)) { if (ObjectUtil.isEmpty(resultJSONArray)) {
throw new BadRequestException("未查询到子卷包装信息!"); throw new BadRequestException("未查询到子卷包装信息!");

View File

@@ -2032,6 +2032,12 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
} else { } else {
throw new BadRequestException("托盘号有误,无法找到对应的托盘类型!"); throw new BadRequestException("托盘号有误,无法找到对应的托盘类型!");
} }
// 更新子卷包装关系为生成
JSONObject param = new JSONObject();
param.put("status", IOSEnum.IS_NOTANDYES.code(""));
WQLObject.getWQLObject("pdm_bi_subpackagerelation")
.update(param,"package_box_sn = '"+jsonObject.getString("box_no")+"'");
jsonTaskParam.put("request_param", request_param); jsonTaskParam.put("request_param", request_param);
TwoExceptionInTask bean = SpringContextHolder.getBean(TwoExceptionInTask.class); TwoExceptionInTask bean = SpringContextHolder.getBean(TwoExceptionInTask.class);
bean.createTask(jsonTaskParam); bean.createTask(jsonTaskParam);