移动端接口代码

This commit is contained in:
yinjinlu-pc\尹金路 2023-03-05 14:23:20 +08:00
parent 03de020440
commit c74b73cefe
14 changed files with 344 additions and 58 deletions

View File

@ -10,6 +10,10 @@ import com.ktg.framework.web.service.MobileLoginService;
import com.ktg.framework.web.service.TokenService; import com.ktg.framework.web.service.TokenService;
import com.ktg.system.domain.LoginParams; import com.ktg.system.domain.LoginParams;
import com.ktg.system.service.ISysUserService; import com.ktg.system.service.ISysUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -21,6 +25,7 @@ import javax.servlet.http.HttpServletRequest;
* @author SK * @author SK
* @since 2018/6/13 * @since 2018/6/13
*/ */
@Api("用户信息")
@RestController @RestController
@RequestMapping("/mobile/user") @RequestMapping("/mobile/user")
public class UserController { public class UserController {
@ -57,6 +62,10 @@ public class UserController {
* *
* @return 用户信息 * @return 用户信息
*/ */
@ApiOperation("获取用户信息")
@ApiResponses({
@ApiResponse(code = 200,message = "查询成功",response = AjaxResult.class),
})
@GetMapping("getUserInfo") @GetMapping("getUserInfo")
public AjaxResult getUserInfo(HttpServletRequest request) { public AjaxResult getUserInfo(HttpServletRequest request) {
LoginUser loginUser = tokenService.getLoginUser(request); LoginUser loginUser = tokenService.getLoginUser(request);

View File

@ -85,6 +85,7 @@ public class UserConstants
public static final String TASK_CODE="TASK_CODE"; public static final String TASK_CODE="TASK_CODE";
public static final String DEFECT_CODE = "DEFECT_CODE"; public static final String DEFECT_CODE = "DEFECT_CODE";
public static final String SN_CODE = "SN_CODE"; public static final String SN_CODE = "SN_CODE";
public static final String TRANS_ORDER_CODE ="TRANS_ORDER_CODE";
/** /**
* 单据的状态类型 * 单据的状态类型
@ -202,5 +203,6 @@ public class UserConstants
public static final String BARCODE_TYPE_MACHINERY = "MACHINERY"; public static final String BARCODE_TYPE_MACHINERY = "MACHINERY";
public static final String BARCODE_TYPE_WORKSTATION = "WORKSTATION"; public static final String BARCODE_TYPE_WORKSTATION = "WORKSTATION";
public static final String BARCODE_TYPE_WAREHOUSE = "WAREHOUSE"; public static final String BARCODE_TYPE_WAREHOUSE = "WAREHOUSE";
public static final String BARCODE_TYPE_TRANSORDER= "TRANSORDER";
} }

View File

@ -1,5 +1,6 @@
package com.ktg.framework.web.service; package com.ktg.framework.web.service;
import com.ktg.system.strategy.PhoneUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -33,7 +34,15 @@ public class UserDetailsServiceImpl implements UserDetailsService
@Override @Override
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException
{ {
SysUser user = userService.selectUserByUserName(username); SysUser user = null;
if(PhoneUtils.isMobile(username)){
user = userService.selectUserByMobile(username);
}
if(!StringUtils.isNotNull(user)){
user = userService.selectUserByUserName(username);
}
if (StringUtils.isNull(user)) if (StringUtils.isNull(user))
{ {
log.info("登录用户:{} 不存在.", username); log.info("登录用户:{} 不存在.", username);

View File

@ -1,27 +1,110 @@
package com.ktg.mes.md.controller; package com.ktg.mes.md.controller;
import cn.hutool.core.collection.CollectionUtil;
import com.ktg.common.constant.UserConstants;
import com.ktg.common.core.controller.BaseController; import com.ktg.common.core.controller.BaseController;
import com.ktg.common.core.domain.AjaxResult; import com.ktg.common.core.domain.AjaxResult;
import com.ktg.common.core.domain.entity.SysUser;
import com.ktg.common.core.domain.model.LoginUser;
import com.ktg.common.utils.StringUtils;
import com.ktg.framework.web.service.TokenService;
import com.ktg.mes.md.domain.MdWorkstation; import com.ktg.mes.md.domain.MdWorkstation;
import com.ktg.mes.md.service.IMdWorkstationService; import com.ktg.mes.md.service.IMdWorkstationService;
import com.ktg.mes.pro.domain.ProFeedback;
import com.ktg.mes.pro.domain.ProUserWorkstation;
import com.ktg.mes.pro.domain.ProWorkrecord;
import com.ktg.mes.pro.service.IProUserWorkstationService;
import com.ktg.mes.pro.service.IProWorkrecordService;
import com.ktg.system.service.ISysUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.List; import java.util.List;
@Api
@RestController @RestController
@RequestMapping("/mobile/md/workstation") @RequestMapping("/mobile/md/workstation")
public class MdWorkstationMobController extends BaseController { public class MdWorkstationMobController extends BaseController {
@Autowired
private TokenService tokenService;
@Autowired
private ISysUserService sysUserService;
@Autowired @Autowired
private IMdWorkstationService mdWorkstationService; private IMdWorkstationService mdWorkstationService;
@Autowired
private IProWorkrecordService workrecordService;
@Autowired
private IProUserWorkstationService userWorkstationService;
@ApiOperation("工作站查询接口")
@GetMapping("/getWorkstationList") @GetMapping("/getWorkstationList")
public AjaxResult getWorkstationList(MdWorkstation mdWorkstation){ public AjaxResult getWorkstationList(MdWorkstation mdWorkstation){
List<MdWorkstation> list = mdWorkstationService.selectMdWorkstationList(mdWorkstation); List<MdWorkstation> list = mdWorkstationService.selectMdWorkstationList(mdWorkstation);
return AjaxResult.success(list); return AjaxResult.success(list);
} }
@ApiOperation("获取当前用户绑定的工作站")
@GetMapping("/getMyWorkstation")
public AjaxResult getBindWorkstation(HttpServletRequest request){
LoginUser loginUser = tokenService.getLoginUser(request);
SysUser user = sysUserService.selectUserById(loginUser.getUser().getUserId());
ProUserWorkstation param = new ProUserWorkstation();
param.setUserId(user.getUserId());
List<ProUserWorkstation> uw = userWorkstationService.selectProUserWorkstationList(param);
if(!CollectionUtil.isEmpty(uw)){
return AjaxResult.success(uw.get(0));
}
return AjaxResult.success();
}
@ApiOperation("上工/下工记录")
@PutMapping()
@Transactional
public AjaxResult bindWorkstation(@RequestBody ProWorkrecord workrecord){
MdWorkstation param = new MdWorkstation();
param.setWorkstationCode(workrecord.getWorkstationCode());
List<MdWorkstation> workstations = mdWorkstationService.selectMdWorkstationList(param);
MdWorkstation workstation = null;
if(!CollectionUtil.isEmpty(workstations)){
workstation = workstations.get(0);
}
if(!StringUtils.isNotNull(workstation)){
return AjaxResult.error("未能找到对应的工作站");
}
SysUser user = sysUserService.selectUserById(workrecord.getUserId());
workrecord.setUserName(user.getUserName());
workrecord.setWorkstationId(workstation.getWorkstationId());
workrecord.setWorkstationName(workstation.getWorkstationName());
workrecordService.insertProWorkrecord(workrecord);
ProUserWorkstation uw = new ProUserWorkstation();
uw.setUserId(workrecord.getUserId());
uw.setUserName(workrecord.getUserName());
uw.setNickName(workrecord.getNickName());
uw.setWorkstationId(workstation.getWorkstationId());
uw.setWorkstationCode(workstation.getWorkstationCode());
uw.setWorkstationName(workstation.getWorkstationName());
if(UserConstants.YES.equals(workrecord.getOperationFlag())){
//如果是绑定
userWorkstationService.deleteByUserName(workrecord.getUserName());
userWorkstationService.insertProUserWorkstation(uw);
}else{
userWorkstationService.deleteByUserName(workrecord.getUserName());
}
return AjaxResult.success();
}
} }

View File

@ -3,6 +3,7 @@ package com.ktg.mes.pro.controller;
import com.ktg.common.annotation.Log; import com.ktg.common.annotation.Log;
import com.ktg.common.core.controller.BaseController; import com.ktg.common.core.controller.BaseController;
import com.ktg.common.core.domain.AjaxResult; import com.ktg.common.core.domain.AjaxResult;
import com.ktg.common.core.page.TableDataInfo;
import com.ktg.common.enums.BusinessType; import com.ktg.common.enums.BusinessType;
import com.ktg.mes.md.domain.MdWorkstation; import com.ktg.mes.md.domain.MdWorkstation;
import com.ktg.mes.md.service.IMdWorkstationService; import com.ktg.mes.md.service.IMdWorkstationService;
@ -14,6 +15,8 @@ import com.ktg.mes.pro.service.IProTaskIssueService;
import com.ktg.mes.pro.service.IProTaskService; import com.ktg.mes.pro.service.IProTaskService;
import com.ktg.mes.wm.service.IWmIssueHeaderService; import com.ktg.mes.wm.service.IWmIssueHeaderService;
import com.ktg.mes.wm.service.IWmIssueLineService; import com.ktg.mes.wm.service.IWmIssueLineService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -22,6 +25,7 @@ import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Api
@RestController @RestController
@RequestMapping("/mobile/pro/protask") @RequestMapping("/mobile/pro/protask")
public class ProTaskMobController extends BaseController { public class ProTaskMobController extends BaseController {
@ -44,6 +48,7 @@ public class ProTaskMobController extends BaseController {
@Autowired @Autowired
private IWmIssueLineService wmIssueLineService; private IWmIssueLineService wmIssueLineService;
@GetMapping("/getlist") @GetMapping("/getlist")
public AjaxResult getIssueList(ProTaskIssue proTaskIssue) { public AjaxResult getIssueList(ProTaskIssue proTaskIssue) {
List<ProTaskIssue> list = proTaskIssueService.selectProTaskIssueList(proTaskIssue); List<ProTaskIssue> list = proTaskIssueService.selectProTaskIssueList(proTaskIssue);
@ -53,18 +58,21 @@ public class ProTaskMobController extends BaseController {
/** /**
* 查询工作站的生产任务 * 查询工作站的生产任务
*/ */
@ApiOperation("查询状态未完成的生产任务接口")
@PreAuthorize("@ss.hasPermi('mes:pro:protask:list')") @PreAuthorize("@ss.hasPermi('mes:pro:protask:list')")
@GetMapping("/getTaskList") @GetMapping("/getTaskList")
public AjaxResult list(ProTask proTask) public TableDataInfo list(ProTask proTask)
{ {
List<ProTask> list = proTaskService.selectProTaskList(proTask); List<ProTask> list = proTaskService.selectProTaskList(proTask);
List<ProTask> l = list.stream().filter(t ->!"FINISHED".equals(t.getStatus())).collect(Collectors.toList()); List<ProTask> l = list.stream().filter(t ->!"FINISHED".equals(t.getStatus())).collect(Collectors.toList());
return AjaxResult.success(l); return getDataTable(l);
} }
/** /**
* 获取生产任务详细信息 * 获取生产任务详细信息
*/ */
@ApiOperation("查询生产任务详情接口")
@PreAuthorize("@ss.hasPermi('mes:pro:protask:query')") @PreAuthorize("@ss.hasPermi('mes:pro:protask:query')")
@GetMapping(value = "/{taskId}") @GetMapping(value = "/{taskId}")
public AjaxResult getInfo(@PathVariable("taskId") Long taskId) public AjaxResult getInfo(@PathVariable("taskId") Long taskId)
@ -76,6 +84,7 @@ public class ProTaskMobController extends BaseController {
/** /**
* 修改生产任务状态 * 修改生产任务状态
*/ */
@ApiOperation("修改生产任务状态接口")
@Log(title = "生产任务", businessType = BusinessType.UPDATE) @Log(title = "生产任务", businessType = BusinessType.UPDATE)
@PostMapping("/change") @PostMapping("/change")
@ResponseBody @ResponseBody

View File

@ -1,25 +1,150 @@
package com.ktg.mes.pro.controller; package com.ktg.mes.pro.controller;
import cn.hutool.core.collection.CollectionUtil;
import com.ktg.common.annotation.Log;
import com.ktg.common.constant.UserConstants;
import com.ktg.common.core.controller.BaseController; import com.ktg.common.core.controller.BaseController;
import com.ktg.common.core.domain.AjaxResult; import com.ktg.common.core.domain.AjaxResult;
import com.ktg.common.enums.BusinessType;
import com.ktg.common.utils.StringUtils;
import com.ktg.mes.pro.domain.ProTask;
import com.ktg.mes.pro.domain.ProTransOrder; import com.ktg.mes.pro.domain.ProTransOrder;
import com.ktg.mes.pro.service.IProTaskService;
import com.ktg.mes.pro.service.IProTransOrderService;
import com.ktg.mes.wm.domain.WmBarcode;
import com.ktg.mes.wm.service.IWmBarcodeService;
import com.ktg.system.strategy.AutoCodeUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.*;
@Api("用户信息管理") import java.util.List;
@Api("流转单接口")
@RestController @RestController
@RequestMapping("/mobile/pro/transorder") @RequestMapping("/mobile/pro/transorder")
public class ProTransOrderMobController extends BaseController { public class ProTransOrderMobController extends BaseController {
@Autowired
private IProTransOrderService proTransOrderService;
@Autowired
private AutoCodeUtil autoCodeUtil;
@Autowired
private IProTaskService proTaskService;
@Autowired
private IWmBarcodeService wmBarcodeService;
@ApiOperation("获取流转单清单") @ApiOperation("获取流转单清单")
@GetMapping("/getList") @GetMapping("/getList")
public AjaxResult getList(ProTransOrder proTransOrder){ public AjaxResult getList(ProTransOrder proTransOrder){
return AjaxResult.success(); return AjaxResult.success();
} }
/**
* 获取流转单详细信息
*/
@ApiOperation("流转单详情查询接口")
@PreAuthorize("@ss.hasPermi('mes:pro:transorder:query')")
@GetMapping("/getInfo")
public AjaxResult getInfo(ProTransOrder proTransOrder)
{
ProTransOrder order = null;
if(StringUtils.isNotNull(proTransOrder.getTransOrderId())){
order = proTransOrderService.selectProTransOrderByTransOrderId(proTransOrder.getTransOrderId());
}
if(StringUtils.isNotNull(proTransOrder.getTransOrderCode())){
ProTransOrder param = new ProTransOrder();
param.setTransOrderCode(proTransOrder.getTransOrderCode());
List<ProTransOrder> orders =proTransOrderService.selectProTransOrderList(param);
if(!CollectionUtil.isEmpty(orders)){
order = orders.get(0);
}
}
return AjaxResult.success(order);
}
/**
* 新增流转单
*/
@ApiOperation("流转单新增接口")
@PreAuthorize("@ss.hasPermi('mes:pro:transorder:add')")
@Log(title = "流转单", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ProTransOrder proTransOrder)
{
if(!StringUtils.isNotNull(proTransOrder.getTransOrderCode())){
String transOrderCdoe = autoCodeUtil.genSerialCode(UserConstants.TRANS_ORDER_CODE,"");
proTransOrder.setTransOrderCode(transOrderCdoe);
}
if(StringUtils.isNotNull(proTransOrder.getTaskId())){
ProTask task =proTaskService.selectProTaskByTaskId(proTransOrder.getTaskId());
proTransOrder.setTaskCode(task.getTaskCode());
proTransOrder.setWorkstationId(task.getWorkstationId());
proTransOrder.setWorkstationCode(task.getWorkstationCode());
proTransOrder.setWorkstationName(task.getWorkstationName());
proTransOrder.setProcessId(task.getProcessId());
proTransOrder.setProcessCode(task.getProcessCode());
proTransOrder.setProcessName(task.getProcessName());
proTransOrder.setWorkorderId(task.getWorkorderId());
proTransOrder.setWorkorderCode(task.getWorkorderCode());
proTransOrder.setWorkorderName(task.getWorkorderName());
//TODO:批次信息的获取
proTransOrder.setItemId(task.getItemId());
proTransOrder.setItemCode(task.getItemCode());
proTransOrder.setItemName(task.getItemName());
proTransOrder.setUnitOfMeasure(task.getUnitOfMeasure());
proTransOrder.setSpecification(task.getSpecification());
}else{
return AjaxResult.error("请提供生产任务数据");
}
if(StringUtils.isNotNull(proTransOrder.getQuantityTransfered())){
return AjaxResult.error("请填写报工数量");
}
proTransOrderService.insertProTransOrder(proTransOrder);
//自动生成条码
WmBarcode code = new WmBarcode();
code.setBarcodeType(UserConstants.BARCODE_TYPE_TRANSORDER);
code.setBarcodeContent("TRANSORDER-"+proTransOrder.getTransOrderCode());
code.setBarcodeFormart(UserConstants.QR_CODE);
code.setBussinessId(proTransOrder.getTransOrderId());
code.setBussinessCode(proTransOrder.getTransOrderCode());
code.setEnableFlag(UserConstants.YES);
String path =wmBarcodeService.generateBarcode(code);
code.setBarcodeUrl(path);
wmBarcodeService.updateWmBarcode(code);
proTransOrder.setBarCodeUrl(path);
proTransOrderService.updateProTransOrder(proTransOrder);
return AjaxResult.success(proTransOrder);
}
/**
* 修改流转单
*/
@ApiOperation("流转单修改接口")
@PreAuthorize("@ss.hasPermi('mes:pro:transorder:edit')")
@Log(title = "流转单", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ProTransOrder proTransOrder)
{
return toAjax(proTransOrderService.updateProTransOrder(proTransOrder));
}
} }

View File

@ -93,6 +93,8 @@ public class ProTransOrder extends BaseEntity
@Excel(name = "单位") @Excel(name = "单位")
private String unitOfMeasure; private String unitOfMeasure;
private String barCodeUrl;
/** 流转数量 */ /** 流转数量 */
@Excel(name = "流转数量") @Excel(name = "流转数量")
private BigDecimal quantityTransfered; private BigDecimal quantityTransfered;
@ -340,39 +342,43 @@ public class ProTransOrder extends BaseEntity
return attr4; return attr4;
} }
public String getBarCodeUrl() {
return barCodeUrl;
}
public void setBarCodeUrl(String barCodeUrl) {
this.barCodeUrl = barCodeUrl;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return "ProTransOrder{" +
.append("transOrderId", getTransOrderId()) "transOrderId=" + transOrderId +
.append("transOrderCode", getTransOrderCode()) ", transOrderCode='" + transOrderCode + '\'' +
.append("taskId", getTaskId()) ", taskId=" + taskId +
.append("taskCode", getTaskCode()) ", taskCode='" + taskCode + '\'' +
.append("workstationId", getWorkstationId()) ", workstationId=" + workstationId +
.append("workstationCode", getWorkstationCode()) ", workstationCode='" + workstationCode + '\'' +
.append("workstationName", getWorkstationName()) ", workstationName='" + workstationName + '\'' +
.append("processId", getProcessId()) ", processId=" + processId +
.append("processCode", getProcessCode()) ", processCode='" + processCode + '\'' +
.append("processName", getProcessName()) ", processName='" + processName + '\'' +
.append("workorderId", getWorkorderId()) ", workorderId=" + workorderId +
.append("workorderCode", getWorkorderCode()) ", workorderCode='" + workorderCode + '\'' +
.append("workorderName", getWorkorderName()) ", workorderName='" + workorderName + '\'' +
.append("batchCode", getBatchCode()) ", batchCode='" + batchCode + '\'' +
.append("itemId", getItemId()) ", itemId=" + itemId +
.append("itemCode", getItemCode()) ", itemCode='" + itemCode + '\'' +
.append("itemName", getItemName()) ", itemName='" + itemName + '\'' +
.append("specification", getSpecification()) ", specification='" + specification + '\'' +
.append("unitOfMeasure", getUnitOfMeasure()) ", unitOfMeasure='" + unitOfMeasure + '\'' +
.append("quantityTransfered", getQuantityTransfered()) ", barCodeUrl='" + barCodeUrl + '\'' +
.append("produceDate", getProduceDate()) ", quantityTransfered=" + quantityTransfered +
.append("remark", getRemark()) ", produceDate=" + produceDate +
.append("attr1", getAttr1()) ", attr1='" + attr1 + '\'' +
.append("attr2", getAttr2()) ", attr2='" + attr2 + '\'' +
.append("attr3", getAttr3()) ", attr3=" + attr3 +
.append("attr4", getAttr4()) ", attr4=" + attr4 +
.append("createBy", getCreateBy()) '}';
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
} }
} }

View File

@ -141,23 +141,36 @@ public class WmWarehouseServiceImpl implements IWmWarehouseService
@Override @Override
public WmWarehouse initVirtualWarehouse() { public WmWarehouse initVirtualWarehouse() {
WmWarehouse warehouse = new WmWarehouse();
warehouse.setWarehouseCode(UserConstants.VIRTUAL_WH);
warehouse.setWarehouseName("线边库-虚拟");
wmWarehouseMapper.insertWmWarehouse(warehouse);
WmStorageLocation location = new WmStorageLocation(); WmWarehouse warehouse = wmWarehouseMapper.selectWmWarehouseByWarehouseCode(UserConstants.VIRTUAL_WH);
location.setWarehouseId(warehouse.getWarehouseId()); if(!StringUtils.isNotNull(warehouse)){
location.setLocationCode(UserConstants.VIRTUAL_WS); warehouse = new WmWarehouse();
location.setLocationName("线边库库区-虚拟"); warehouse.setWarehouseCode(UserConstants.VIRTUAL_WH);
location.setAreaFlag(UserConstants.YES); warehouse.setWarehouseName("线边库-虚拟");
wmStorageLocationMapper.insertWmStorageLocation(location); wmWarehouseMapper.insertWmWarehouse(warehouse);
}
WmStorageLocation location = wmStorageLocationMapper.selectWmStorageLocationByLocationCode(UserConstants.VIRTUAL_WS);
if(!StringUtils.isNotNull(location)){
location = new WmStorageLocation();
location.setWarehouseId(warehouse.getWarehouseId());
location.setLocationCode(UserConstants.VIRTUAL_WS);
location.setLocationName("线边库库区-虚拟");
location.setAreaFlag(UserConstants.YES);
wmStorageLocationMapper.insertWmStorageLocation(location);
}
WmStorageArea area = wmStorageAreaMapper.selectWmStorageAreaByAreaCode(UserConstants.VIRTUAL_WA);
if(!StringUtils.isNotNull(area)){
area = new WmStorageArea();
area.setLocationId(location.getLocationId());
area.setAreaCode(UserConstants.VIRTUAL_WA);
area.setAreaName("线边库库位-虚拟");
wmStorageAreaMapper.insertWmStorageArea(area);
}
WmStorageArea area = new WmStorageArea();
area.setLocationId(location.getLocationId());
area.setAreaCode(UserConstants.VIRTUAL_WA);
area.setAreaName("线边库库位-虚拟");
wmStorageAreaMapper.insertWmStorageArea(area);
return warehouse; return warehouse;
} }
} }

View File

@ -24,6 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="itemName" column="item_name" /> <result property="itemName" column="item_name" />
<result property="specification" column="specification" /> <result property="specification" column="specification" />
<result property="unitOfMeasure" column="unit_of_measure" /> <result property="unitOfMeasure" column="unit_of_measure" />
<result property="barCodeUrl" column="barcode_url" ></result>
<result property="quantityTransfered" column="quantity_transfered" /> <result property="quantityTransfered" column="quantity_transfered" />
<result property="produceDate" column="produce_date" /> <result property="produceDate" column="produce_date" />
<result property="remark" column="remark" /> <result property="remark" column="remark" />
@ -38,7 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectProTransOrderVo"> <sql id="selectProTransOrderVo">
select trans_order_id, trans_order_code, task_id, task_code, workstation_id, workstation_code, workstation_name, process_id, process_code, process_name, workorder_id, workorder_code, workorder_name, batch_code, item_id, item_code, item_name, specification, unit_of_measure, quantity_transfered, produce_date, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from pro_trans_order select trans_order_id, trans_order_code, task_id, task_code, workstation_id, workstation_code, workstation_name, process_id, process_code, process_name, workorder_id, workorder_code, workorder_name, batch_code, item_id, item_code, item_name, specification, unit_of_measure,barcode_url, quantity_transfered, produce_date, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from pro_trans_order
</sql> </sql>
<select id="selectProTransOrderList" parameterType="ProTransOrder" resultMap="ProTransOrderResult"> <select id="selectProTransOrderList" parameterType="ProTransOrder" resultMap="ProTransOrderResult">
@ -62,6 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="itemName != null and itemName != ''"> and item_name like concat('%', #{itemName}, '%')</if> <if test="itemName != null and itemName != ''"> and item_name like concat('%', #{itemName}, '%')</if>
<if test="specification != null and specification != ''"> and specification = #{specification}</if> <if test="specification != null and specification != ''"> and specification = #{specification}</if>
<if test="unitOfMeasure != null and unitOfMeasure != ''"> and unit_of_measure = #{unitOfMeasure}</if> <if test="unitOfMeasure != null and unitOfMeasure != ''"> and unit_of_measure = #{unitOfMeasure}</if>
<if test="barCodeUrl != null and barCodeUrl != ''"> and barcode_url = #{barCodeUrl}</if>
<if test="quantityTransfered != null "> and quantity_transfered = #{quantityTransfered}</if> <if test="quantityTransfered != null "> and quantity_transfered = #{quantityTransfered}</if>
<if test="produceDate != null "> and produce_date = #{produceDate}</if> <if test="produceDate != null "> and produce_date = #{produceDate}</if>
</where> </where>
@ -93,6 +95,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="itemName != null and itemName != ''">item_name,</if> <if test="itemName != null and itemName != ''">item_name,</if>
<if test="specification != null">specification,</if> <if test="specification != null">specification,</if>
<if test="unitOfMeasure != null and unitOfMeasure != ''">unit_of_measure,</if> <if test="unitOfMeasure != null and unitOfMeasure != ''">unit_of_measure,</if>
<if test="barCodeUrl != null and barCodeUrl != ''">barcode_url,</if>
<if test="quantityTransfered != null">quantity_transfered,</if> <if test="quantityTransfered != null">quantity_transfered,</if>
<if test="produceDate != null">produce_date,</if> <if test="produceDate != null">produce_date,</if>
<if test="remark != null">remark,</if> <if test="remark != null">remark,</if>
@ -124,6 +127,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="itemName != null and itemName != ''">#{itemName},</if> <if test="itemName != null and itemName != ''">#{itemName},</if>
<if test="specification != null">#{specification},</if> <if test="specification != null">#{specification},</if>
<if test="unitOfMeasure != null and unitOfMeasure != ''">#{unitOfMeasure},</if> <if test="unitOfMeasure != null and unitOfMeasure != ''">#{unitOfMeasure},</if>
<if test="barCodeUrl != null and barCodeUrl != ''">#{barCodeUrl},</if>
<if test="quantityTransfered != null">#{quantityTransfered},</if> <if test="quantityTransfered != null">#{quantityTransfered},</if>
<if test="produceDate != null">#{produceDate},</if> <if test="produceDate != null">#{produceDate},</if>
<if test="remark != null">#{remark},</if> <if test="remark != null">#{remark},</if>
@ -159,6 +163,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="itemName != null and itemName != ''">item_name = #{itemName},</if> <if test="itemName != null and itemName != ''">item_name = #{itemName},</if>
<if test="specification != null">specification = #{specification},</if> <if test="specification != null">specification = #{specification},</if>
<if test="unitOfMeasure != null and unitOfMeasure != ''">unit_of_measure = #{unitOfMeasure},</if> <if test="unitOfMeasure != null and unitOfMeasure != ''">unit_of_measure = #{unitOfMeasure},</if>
<if test="barCodeUrl != null and barCodeUrl != ''">barcode_url = #{barCodeUrl},</if>
<if test="quantityTransfered != null">quantity_transfered = #{quantityTransfered},</if> <if test="quantityTransfered != null">quantity_transfered = #{quantityTransfered},</if>
<if test="produceDate != null">produce_date = #{produceDate},</if> <if test="produceDate != null">produce_date = #{produceDate},</if>
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>

View File

@ -43,6 +43,13 @@ public interface SysUserMapper
*/ */
public SysUser selectUserByUserName(String userName); public SysUser selectUserByUserName(String userName);
/**
* 根据手机号码查询
* @param mobile
* @return
*/
public SysUser selectUserByMobile(String mobile);
/** /**
* 通过用户ID查询用户 * 通过用户ID查询用户
* *

View File

@ -42,6 +42,13 @@ public interface ISysUserService
*/ */
public SysUser selectUserByUserName(String userName); public SysUser selectUserByUserName(String userName);
/**
* 通过手机号码查询用户
* @param mobile
* @return
*/
public SysUser selectUserByMobile(String mobile);
/** /**
* 通过用户ID查询用户 * 通过用户ID查询用户
* *

View File

@ -112,6 +112,12 @@ public class SysUserServiceImpl implements ISysUserService
return userMapper.selectUserByUserName(userName); return userMapper.selectUserByUserName(userName);
} }
@Override
public SysUser selectUserByMobile(String mobile) {
return userMapper.selectUserByMobile(mobile);
}
/** /**
* 通过用户ID查询用户 * 通过用户ID查询用户
* *

View File

@ -123,6 +123,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectUserVo"/> <include refid="selectUserVo"/>
where u.user_name = #{userName} where u.user_name = #{userName}
</select> </select>
<select id="selectUserByMobile" parameterType="String" resultMap="SysUserResult">
<include refid="selectUserVo"/>
where u.phonenumber = #{phonenumber}
</select>
<select id="selectUserById" parameterType="Long" resultMap="SysUserResult"> <select id="selectUserById" parameterType="Long" resultMap="SysUserResult">
<include refid="selectUserVo"/> <include refid="selectUserVo"/>