Commit 893853a2 authored by 温志超's avatar 温志超

更新查询

parent 580d9e16
......@@ -114,14 +114,19 @@ public class MdWorkunitWorkerController extends BaseController {
@Log(title = "岗位资源", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody List<MdWorkunitWorker> mdWorkunitWorkerData) {
StringBuilder stringBuilder = new StringBuilder();
for (MdWorkunitWorker mdWorkunitWorker : mdWorkunitWorkerData){
QueryWrapper<MdWorkunitWorker> proWorkorderQueryWrapper = new QueryWrapper<>();
proWorkorderQueryWrapper.eq("t1.user_id", mdWorkunitWorker.getUserId());
proWorkorderQueryWrapper.eq("t1.workunit_id", mdWorkunitWorker.getWorkunitId());
List<MdWorkunitWorker> mdWorkunitWorkers = mdWorkunitWorkerMapper.selectListByQw(proWorkorderQueryWrapper);
ExceptionUtil.checkTrueThrowException(CollectionUtil.isNotEmpty(mdWorkunitWorkers), MessageUtils.message("md.workUnit.error.repeat.bind"));
if(CollectionUtil.isNotEmpty(mdWorkunitWorkers)){
stringBuilder.append(mdWorkunitWorker.getWorkunitName()+",");
break;
}
int rows = mdWorkunitWorkerService.insertObj(mdWorkunitWorker);
}
ExceptionUtil.checkTrueThrowException(StringUtils.isNotEmpty(stringBuilder), MessageUtils.message("md.workUnit.error.repeat.bind") + stringBuilder);
return toAjax(mdWorkunitWorkerData.size());
}
......
......@@ -13,8 +13,10 @@ import com.ximai.system.service.ISysUserService;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import javax.annotation.Tainted;
import java.math.BigDecimal;
import java.util.List;
......@@ -108,6 +110,7 @@ public class MdWorkunitWorkerServiceImpl implements IMdWorkunitWorkerService {
}
@Override
@Transactional
public int insertObj(MdWorkunitWorker mdWorkunitWorker) {
SysUser sysUser = sysUserService.selectUserById(mdWorkunitWorker.getUserId());
ExceptionUtil.checkTrueThrowException(sysUser == null, MessageUtils.message("md.workUnit.error.bind.not.user"));
......
......@@ -454,12 +454,12 @@ public class ProTaskWorkunitServiceImpl implements IProTaskWorkunitService {
query.like(StringUtils.isNotEmpty(proTaskWorkunit.getProductCode()), "wo.product_code",
proTaskWorkunit.getProductCode());
query.like(StringUtils.isNotEmpty(proTaskWorkunit.getOrderCode()), "wo.order_code",
proTaskWorkunit.getOrderCode());
// query.like(StringUtils.isNotEmpty(proTaskWorkunit.getOrderCode()), "wo.order_code",
// proTaskWorkunit.getOrderCode());
query.like(StringUtils.isNotEmpty(proTaskWorkunit.getOrderSerial()), "wo.order_serial",
proTaskWorkunit.getOrderSerial());
query.like(StringUtils.isNotEmpty(proTaskWorkunit.getCustomerProjectNo()), "wo.customer_drawing_no",
proTaskWorkunit.getCustomerProjectNo());
query.like(StringUtils.isNotEmpty(proTaskWorkunit.getCustomerDrawingNo()), "wo.customer_drawing_no",
proTaskWorkunit.getCustomerDrawingNo());
query.gt("ptw.quantity",0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment