移动端接口代码
This commit is contained in:
parent
03de020440
commit
c74b73cefe
Binary file not shown.
@ -10,6 +10,10 @@ import com.ktg.framework.web.service.MobileLoginService;
|
||||
import com.ktg.framework.web.service.TokenService;
|
||||
import com.ktg.system.domain.LoginParams;
|
||||
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.web.bind.annotation.*;
|
||||
|
||||
@ -21,6 +25,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
* @author SK
|
||||
* @since 2018/6/13
|
||||
*/
|
||||
@Api("用户信息")
|
||||
@RestController
|
||||
@RequestMapping("/mobile/user")
|
||||
public class UserController {
|
||||
@ -57,6 +62,10 @@ public class UserController {
|
||||
*
|
||||
* @return 用户信息
|
||||
*/
|
||||
@ApiOperation("获取用户信息")
|
||||
@ApiResponses({
|
||||
@ApiResponse(code = 200,message = "查询成功",response = AjaxResult.class),
|
||||
})
|
||||
@GetMapping("getUserInfo")
|
||||
public AjaxResult getUserInfo(HttpServletRequest request) {
|
||||
LoginUser loginUser = tokenService.getLoginUser(request);
|
||||
|
@ -85,6 +85,7 @@ public class UserConstants
|
||||
public static final String TASK_CODE="TASK_CODE";
|
||||
public static final String DEFECT_CODE = "DEFECT_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_WORKSTATION = "WORKSTATION";
|
||||
public static final String BARCODE_TYPE_WAREHOUSE = "WAREHOUSE";
|
||||
public static final String BARCODE_TYPE_TRANSORDER= "TRANSORDER";
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.ktg.framework.web.service;
|
||||
|
||||
import com.ktg.system.strategy.PhoneUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -33,7 +34,15 @@ public class UserDetailsServiceImpl implements UserDetailsService
|
||||
@Override
|
||||
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))
|
||||
{
|
||||
log.info("登录用户:{} 不存在.", username);
|
||||
|
@ -1,27 +1,110 @@
|
||||
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.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.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.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
@Api
|
||||
@RestController
|
||||
@RequestMapping("/mobile/md/workstation")
|
||||
public class MdWorkstationMobController extends BaseController {
|
||||
@Autowired
|
||||
private TokenService tokenService;
|
||||
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
@Autowired
|
||||
private IMdWorkstationService mdWorkstationService;
|
||||
|
||||
@Autowired
|
||||
private IProWorkrecordService workrecordService;
|
||||
|
||||
@Autowired
|
||||
private IProUserWorkstationService userWorkstationService;
|
||||
|
||||
@ApiOperation("工作站查询接口")
|
||||
@GetMapping("/getWorkstationList")
|
||||
public AjaxResult getWorkstationList(MdWorkstation mdWorkstation){
|
||||
List<MdWorkstation> list = mdWorkstationService.selectMdWorkstationList(mdWorkstation);
|
||||
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();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package com.ktg.mes.pro.controller;
|
||||
import com.ktg.common.annotation.Log;
|
||||
import com.ktg.common.core.controller.BaseController;
|
||||
import com.ktg.common.core.domain.AjaxResult;
|
||||
import com.ktg.common.core.page.TableDataInfo;
|
||||
import com.ktg.common.enums.BusinessType;
|
||||
import com.ktg.mes.md.domain.MdWorkstation;
|
||||
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.wm.service.IWmIssueHeaderService;
|
||||
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.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -22,6 +25,7 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Api
|
||||
@RestController
|
||||
@RequestMapping("/mobile/pro/protask")
|
||||
public class ProTaskMobController extends BaseController {
|
||||
@ -44,6 +48,7 @@ public class ProTaskMobController extends BaseController {
|
||||
@Autowired
|
||||
private IWmIssueLineService wmIssueLineService;
|
||||
|
||||
|
||||
@GetMapping("/getlist")
|
||||
public AjaxResult getIssueList(ProTaskIssue proTaskIssue) {
|
||||
List<ProTaskIssue> list = proTaskIssueService.selectProTaskIssueList(proTaskIssue);
|
||||
@ -53,18 +58,21 @@ public class ProTaskMobController extends BaseController {
|
||||
/**
|
||||
* 查询工作站的生产任务
|
||||
*/
|
||||
@ApiOperation("查询状态未完成的生产任务接口")
|
||||
@PreAuthorize("@ss.hasPermi('mes:pro:protask:list')")
|
||||
@GetMapping("/getTaskList")
|
||||
public AjaxResult list(ProTask proTask)
|
||||
public TableDataInfo list(ProTask proTask)
|
||||
{
|
||||
List<ProTask> list = proTaskService.selectProTaskList(proTask);
|
||||
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')")
|
||||
@GetMapping(value = "/{taskId}")
|
||||
public AjaxResult getInfo(@PathVariable("taskId") Long taskId)
|
||||
@ -76,6 +84,7 @@ public class ProTaskMobController extends BaseController {
|
||||
/**
|
||||
* 修改生产任务状态
|
||||
*/
|
||||
@ApiOperation("修改生产任务状态接口")
|
||||
@Log(title = "生产任务", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/change")
|
||||
@ResponseBody
|
||||
|
@ -1,25 +1,150 @@
|
||||
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.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.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.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@Api("用户信息管理")
|
||||
import java.util.List;
|
||||
|
||||
@Api("流转单接口")
|
||||
@RestController
|
||||
@RequestMapping("/mobile/pro/transorder")
|
||||
public class ProTransOrderMobController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IProTransOrderService proTransOrderService;
|
||||
|
||||
@Autowired
|
||||
private AutoCodeUtil autoCodeUtil;
|
||||
|
||||
@Autowired
|
||||
private IProTaskService proTaskService;
|
||||
|
||||
@Autowired
|
||||
private IWmBarcodeService wmBarcodeService;
|
||||
|
||||
@ApiOperation("获取流转单清单")
|
||||
@GetMapping("/getList")
|
||||
public AjaxResult getList(ProTransOrder proTransOrder){
|
||||
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -93,6 +93,8 @@ public class ProTransOrder extends BaseEntity
|
||||
@Excel(name = "单位")
|
||||
private String unitOfMeasure;
|
||||
|
||||
private String barCodeUrl;
|
||||
|
||||
/** 流转数量 */
|
||||
@Excel(name = "流转数量")
|
||||
private BigDecimal quantityTransfered;
|
||||
@ -340,39 +342,43 @@ public class ProTransOrder extends BaseEntity
|
||||
return attr4;
|
||||
}
|
||||
|
||||
public String getBarCodeUrl() {
|
||||
return barCodeUrl;
|
||||
}
|
||||
|
||||
public void setBarCodeUrl(String barCodeUrl) {
|
||||
this.barCodeUrl = barCodeUrl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("transOrderId", getTransOrderId())
|
||||
.append("transOrderCode", getTransOrderCode())
|
||||
.append("taskId", getTaskId())
|
||||
.append("taskCode", getTaskCode())
|
||||
.append("workstationId", getWorkstationId())
|
||||
.append("workstationCode", getWorkstationCode())
|
||||
.append("workstationName", getWorkstationName())
|
||||
.append("processId", getProcessId())
|
||||
.append("processCode", getProcessCode())
|
||||
.append("processName", getProcessName())
|
||||
.append("workorderId", getWorkorderId())
|
||||
.append("workorderCode", getWorkorderCode())
|
||||
.append("workorderName", getWorkorderName())
|
||||
.append("batchCode", getBatchCode())
|
||||
.append("itemId", getItemId())
|
||||
.append("itemCode", getItemCode())
|
||||
.append("itemName", getItemName())
|
||||
.append("specification", getSpecification())
|
||||
.append("unitOfMeasure", getUnitOfMeasure())
|
||||
.append("quantityTransfered", getQuantityTransfered())
|
||||
.append("produceDate", getProduceDate())
|
||||
.append("remark", getRemark())
|
||||
.append("attr1", getAttr1())
|
||||
.append("attr2", getAttr2())
|
||||
.append("attr3", getAttr3())
|
||||
.append("attr4", getAttr4())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
return "ProTransOrder{" +
|
||||
"transOrderId=" + transOrderId +
|
||||
", transOrderCode='" + transOrderCode + '\'' +
|
||||
", taskId=" + taskId +
|
||||
", taskCode='" + taskCode + '\'' +
|
||||
", workstationId=" + workstationId +
|
||||
", workstationCode='" + workstationCode + '\'' +
|
||||
", workstationName='" + workstationName + '\'' +
|
||||
", processId=" + processId +
|
||||
", processCode='" + processCode + '\'' +
|
||||
", processName='" + processName + '\'' +
|
||||
", workorderId=" + workorderId +
|
||||
", workorderCode='" + workorderCode + '\'' +
|
||||
", workorderName='" + workorderName + '\'' +
|
||||
", batchCode='" + batchCode + '\'' +
|
||||
", itemId=" + itemId +
|
||||
", itemCode='" + itemCode + '\'' +
|
||||
", itemName='" + itemName + '\'' +
|
||||
", specification='" + specification + '\'' +
|
||||
", unitOfMeasure='" + unitOfMeasure + '\'' +
|
||||
", barCodeUrl='" + barCodeUrl + '\'' +
|
||||
", quantityTransfered=" + quantityTransfered +
|
||||
", produceDate=" + produceDate +
|
||||
", attr1='" + attr1 + '\'' +
|
||||
", attr2='" + attr2 + '\'' +
|
||||
", attr3=" + attr3 +
|
||||
", attr4=" + attr4 +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
@ -141,23 +141,36 @@ public class WmWarehouseServiceImpl implements IWmWarehouseService
|
||||
|
||||
@Override
|
||||
public WmWarehouse initVirtualWarehouse() {
|
||||
WmWarehouse warehouse = new WmWarehouse();
|
||||
|
||||
WmWarehouse warehouse = wmWarehouseMapper.selectWmWarehouseByWarehouseCode(UserConstants.VIRTUAL_WH);
|
||||
if(!StringUtils.isNotNull(warehouse)){
|
||||
warehouse = new WmWarehouse();
|
||||
warehouse.setWarehouseCode(UserConstants.VIRTUAL_WH);
|
||||
warehouse.setWarehouseName("线边库-虚拟");
|
||||
wmWarehouseMapper.insertWmWarehouse(warehouse);
|
||||
}
|
||||
|
||||
WmStorageLocation location = new WmStorageLocation();
|
||||
|
||||
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 = new WmStorageArea();
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
return warehouse;
|
||||
}
|
||||
}
|
||||
|
@ -24,6 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="itemName" column="item_name" />
|
||||
<result property="specification" column="specification" />
|
||||
<result property="unitOfMeasure" column="unit_of_measure" />
|
||||
<result property="barCodeUrl" column="barcode_url" ></result>
|
||||
<result property="quantityTransfered" column="quantity_transfered" />
|
||||
<result property="produceDate" column="produce_date" />
|
||||
<result property="remark" column="remark" />
|
||||
@ -38,7 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<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>
|
||||
|
||||
<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="specification != null and specification != ''"> and specification = #{specification}</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="produceDate != null "> and produce_date = #{produceDate}</if>
|
||||
</where>
|
||||
@ -93,6 +95,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="itemName != null and itemName != ''">item_name,</if>
|
||||
<if test="specification != null">specification,</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="produceDate != null">produce_date,</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="specification != null">#{specification},</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="produceDate != null">#{produceDate},</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="specification != null">specification = #{specification},</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="produceDate != null">produce_date = #{produceDate},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
|
@ -43,6 +43,13 @@ public interface SysUserMapper
|
||||
*/
|
||||
public SysUser selectUserByUserName(String userName);
|
||||
|
||||
/**
|
||||
* 根据手机号码查询
|
||||
* @param mobile
|
||||
* @return
|
||||
*/
|
||||
public SysUser selectUserByMobile(String mobile);
|
||||
|
||||
/**
|
||||
* 通过用户ID查询用户
|
||||
*
|
||||
|
@ -42,6 +42,13 @@ public interface ISysUserService
|
||||
*/
|
||||
public SysUser selectUserByUserName(String userName);
|
||||
|
||||
/**
|
||||
* 通过手机号码查询用户
|
||||
* @param mobile
|
||||
* @return
|
||||
*/
|
||||
public SysUser selectUserByMobile(String mobile);
|
||||
|
||||
/**
|
||||
* 通过用户ID查询用户
|
||||
*
|
||||
|
@ -112,6 +112,12 @@ public class SysUserServiceImpl implements ISysUserService
|
||||
return userMapper.selectUserByUserName(userName);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public SysUser selectUserByMobile(String mobile) {
|
||||
return userMapper.selectUserByMobile(mobile);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过用户ID查询用户
|
||||
*
|
||||
|
@ -124,6 +124,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where u.user_name = #{userName}
|
||||
</select>
|
||||
|
||||
<select id="selectUserByMobile" parameterType="String" resultMap="SysUserResult">
|
||||
<include refid="selectUserVo"/>
|
||||
where u.phonenumber = #{phonenumber}
|
||||
</select>
|
||||
|
||||
<select id="selectUserById" parameterType="Long" resultMap="SysUserResult">
|
||||
<include refid="selectUserVo"/>
|
||||
where u.user_id = #{userId}
|
||||
|
Loading…
Reference in New Issue
Block a user