物料管理修改

Leon 4 years ago
parent 1b1680f2f6
commit 20011e5be5

@ -32,11 +32,11 @@ public class IssueItemController {
@ResponseBody @ResponseBody
@GetMapping("/scanIssueInventory") @GetMapping("/scanIssueInventory")
public R scanIssueInventory(String item, String inventory){ public R scanIssueInventory(String item, String inventory, Boolean oddments){
Map<String, Object> result; Map<String, Object> result;
try { try {
String site = CommonMethods.getSite(); String site = CommonMethods.getSite();
result = issueItemService.scanIssueInventory(site, item, inventory); result = issueItemService.scanIssueInventory(site, item, inventory, oddments);
} catch (Exception e) { } catch (Exception e) {
return R.failed(e.getMessage()); return R.failed(e.getMessage());
} }

@ -0,0 +1,126 @@
package com.foreverwin.mesnac.dispatch.controller;
import com.foreverwin.modular.core.util.R;
import com.foreverwin.modular.core.util.FrontPage;
import com.foreverwin.modular.core.util.CommonMethods;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.foreverwin.mesnac.dispatch.service.SurplusInventoryService;
import com.foreverwin.mesnac.dispatch.model.SurplusInventory;
import java.util.List;
/**
*
* @author Leon.L
* @since 2021-07-19
*/
@RestController
@RequestMapping("/Z-SURPLUS-INVENTORY")
public class SurplusInventoryController {
@Autowired
public SurplusInventoryService surplusInventoryService;
/**
* id
*
* @param id
* @return
*/
@ResponseBody
@GetMapping("/{id:.+}")
public R getSurplusInventoryById(@PathVariable String id) {
return R.ok( surplusInventoryService.getById(id));
}
/**
*
*
* @return
*/
@ResponseBody
@GetMapping("")
public R getSurplusInventoryList(SurplusInventory surplusInventory){
List<SurplusInventory> result;
QueryWrapper<SurplusInventory> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(surplusInventory);
result = surplusInventoryService.list(queryWrapper);
return R.ok(result);
}
/**
*
*
* @param frontPage
* @return
*/
@ResponseBody
@GetMapping("/page")
public R page(FrontPage<SurplusInventory> frontPage, SurplusInventory surplusInventory){
IPage result;
QueryWrapper<SurplusInventory> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(surplusInventory);
if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
//TODO modify global query
queryWrapper.lambda().and(wrapper -> wrapper
.like(SurplusInventory::getHandle, frontPage.getGlobalQuery())
.or().like(SurplusInventory::getSite, frontPage.getGlobalQuery())
.or().like(SurplusInventory::getParentInventory, frontPage.getGlobalQuery())
.or().like(SurplusInventory::getInventory, frontPage.getGlobalQuery())
.or().like(SurplusInventory::getItemBo, frontPage.getGlobalQuery())
.or().like(SurplusInventory::getLenght, frontPage.getGlobalQuery())
.or().like(SurplusInventory::getWidth, frontPage.getGlobalQuery())
.or().like(SurplusInventory::getCreateUser, frontPage.getGlobalQuery())
.or().like(SurplusInventory::getModifyUser, frontPage.getGlobalQuery())
);
}
result = surplusInventoryService.page(frontPage.getPagePlus(), queryWrapper);
return R.ok(result);
}
/**
*
* @param surplusInventory
* @return null
*/
@PostMapping
public R save(@RequestBody SurplusInventory surplusInventory) {
return R.ok(surplusInventoryService.save(surplusInventory));
}
/**
*
* @param surplusInventory
* @return null
*/
@PutMapping
public R updateById(@RequestBody SurplusInventory surplusInventory) {
return R.ok(surplusInventoryService.updateById(surplusInventory));
}
/**
* id
* @param id ID
* @return 0 1
*/
@ResponseBody
@RequestMapping(method = RequestMethod.DELETE, value = "/{id:.+}")
public R removeById(@PathVariable("id") String id){
return R.ok(surplusInventoryService.removeById(id));
}
/**
*
* @param ids ID
* @return 0 1
*/
@ResponseBody
@RequestMapping(method = RequestMethod.POST, value = "/delete-batch")
public R removeByIds(List<String> ids){
return R.ok(surplusInventoryService.removeByIds(ids));
}
}

@ -11,8 +11,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
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.*;
import com.foreverwin.mesnac.dispatch.service.SurplusItemReturnService; import com.foreverwin.mesnac.dispatch.service.SurplusReturnService;
import com.foreverwin.mesnac.dispatch.model.SurplusItemReturn; import com.foreverwin.mesnac.dispatch.model.SurplusReturn;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.List; import java.util.List;
@ -21,15 +21,14 @@ import java.util.Map;
/** /**
* *
* @author Leon.L * @author Leon.L
* @since 2021-07-10 * @since 2021-07-19
*/ */
@RestController @RestController
@RequestMapping("/Z-SURPLUS-ITEM-RETURN") @RequestMapping("/Z-SURPLUS-RETURN")
public class SurplusItemReturnController { public class SurplusReturnController {
@Autowired @Autowired
public SurplusItemReturnService surplusItemReturnService; public SurplusReturnService surplusReturnService;
@ResponseBody @ResponseBody
@GetMapping("/{inventory:.+}") @GetMapping("/{inventory:.+}")
@ -42,7 +41,7 @@ public class SurplusItemReturnController {
} }
String site = CommonMethods.getSite(); String site = CommonMethods.getSite();
result = surplusItemReturnService.getInventoryData(site, inventory); result = surplusReturnService.getInventoryData(site, inventory);
} catch (Exception e) { } catch (Exception e) {
return R.failed(e.getMessage()); return R.failed(e.getMessage());
} }
@ -66,7 +65,7 @@ public class SurplusItemReturnController {
String site = CommonMethods.getSite(); String site = CommonMethods.getSite();
String user = CommonMethods.getUser(); String user = CommonMethods.getUser();
surplusItemReturnService.surplusReturn(site, user, inventory, length, width, new BigDecimal(numbers), new BigDecimal(qty)); surplusReturnService.surplusReturn(site, user, inventory, length, width, new BigDecimal(numbers), new BigDecimal(qty));
} catch (Exception e) { } catch (Exception e) {
return R.failed(e.getMessage()); return R.failed(e.getMessage());
} }

@ -4,8 +4,10 @@ import com.foreverwin.mesnac.dispatch.dto.IssueItemDto;
import com.foreverwin.mesnac.dispatch.model.CallItem; import com.foreverwin.mesnac.dispatch.model.CallItem;
import com.foreverwin.mesnac.dispatch.model.IssueItem; import com.foreverwin.mesnac.dispatch.model.IssueItem;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.math.BigDecimal;
import java.util.List; import java.util.List;
/** /**
@ -18,4 +20,6 @@ import java.util.List;
*/ */
@Repository @Repository
public interface IssueItemMapper extends BaseMapper<IssueItem> { public interface IssueItemMapper extends BaseMapper<IssueItem> {
BigDecimal selectInvIssueQty(@Param("site") String site, @Param("inventory") String inventory);
} }

@ -0,0 +1,22 @@
package com.foreverwin.mesnac.dispatch.mapper;
import com.foreverwin.mesnac.dispatch.model.SurplusInventory;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* <p>
* Mapper
* </p>
*
* @author Leon.L
* @since 2021-07-19
*/
@Repository
public interface SurplusInventoryMapper extends BaseMapper<SurplusInventory> {
}

@ -1,6 +1,6 @@
package com.foreverwin.mesnac.dispatch.mapper; package com.foreverwin.mesnac.dispatch.mapper;
import com.foreverwin.mesnac.dispatch.model.SurplusItemReturn; import com.foreverwin.mesnac.dispatch.model.SurplusReturn;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
@ -13,10 +13,10 @@ import java.util.Map;
* </p> * </p>
* *
* @author Leon.L * @author Leon.L
* @since 2021-07-15 * @since 2021-07-19
*/ */
@Repository @Repository
public interface SurplusItemReturnMapper extends BaseMapper<SurplusItemReturn> { public interface SurplusReturnMapper extends BaseMapper<SurplusReturn> {
/** /**

@ -0,0 +1,234 @@
package com.foreverwin.mesnac.dispatch.model;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.IdType;
/**
* <p>
*
* </p>
*
* @author Leon.L
* @since 2021-07-19
*/
@TableName("Z_SURPLUS_INVENTORY")
public class SurplusInventory extends Model<SurplusInventory> {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId(value = "HANDLE", type = IdType.INPUT)
private String handle;
/**
*
*/
@TableField("SITE")
private String site;
/**
*
*/
@TableField("PARENT_INVENTORY")
private String parentInventory;
/**
*
*/
@TableField("INVENTORY")
private String inventory;
/**
*
*/
@TableField("ITEM_BO")
private String itemBo;
/**
*
*/
@TableField("LENGHT")
private String lenght;
/**
*
*/
@TableField("WIDTH")
private String width;
/**
*
*/
@TableField("QTY")
private BigDecimal qty;
/**
*
*/
@TableField("CREATE_USER")
private String createUser;
/**
*
*/
@TableField("CREATED_DATE_TIME")
private LocalDateTime createdDateTime;
/**
*
*/
@TableField("MODIFY_USER")
private String modifyUser;
/**
*
*/
@TableField("MODIFIED_DATE_TIME")
private LocalDateTime modifiedDateTime;
public String getHandle() {
return handle;
}
public void setHandle(String handle) {
this.handle = handle;
}
public String getSite() {
return site;
}
public void setSite(String site) {
this.site = site;
}
public String getParentInventory() {
return parentInventory;
}
public void setParentInventory(String parentInventory) {
this.parentInventory = parentInventory;
}
public String getInventory() {
return inventory;
}
public void setInventory(String inventory) {
this.inventory = inventory;
}
public String getItemBo() {
return itemBo;
}
public void setItemBo(String itemBo) {
this.itemBo = itemBo;
}
public String getLenght() {
return lenght;
}
public void setLenght(String lenght) {
this.lenght = lenght;
}
public String getWidth() {
return width;
}
public void setWidth(String width) {
this.width = width;
}
public BigDecimal getQty() {
return qty;
}
public void setQty(BigDecimal qty) {
this.qty = qty;
}
public String getCreateUser() {
return createUser;
}
public void setCreateUser(String createUser) {
this.createUser = createUser;
}
public LocalDateTime getCreatedDateTime() {
return createdDateTime;
}
public void setCreatedDateTime(LocalDateTime createdDateTime) {
this.createdDateTime = createdDateTime;
}
public String getModifyUser() {
return modifyUser;
}
public void setModifyUser(String modifyUser) {
this.modifyUser = modifyUser;
}
public LocalDateTime getModifiedDateTime() {
return modifiedDateTime;
}
public void setModifiedDateTime(LocalDateTime modifiedDateTime) {
this.modifiedDateTime = modifiedDateTime;
}
public static final String HANDLE = "HANDLE";
public static final String SITE = "SITE";
public static final String PARENT_INVENTORY = "PARENT_INVENTORY";
public static final String INVENTORY = "INVENTORY";
public static final String ITEM_BO = "ITEM_BO";
public static final String LENGHT = "LENGHT";
public static final String WIDTH = "WIDTH";
public static final String QTY = "QTY";
public static final String CREATE_USER = "CREATE_USER";
public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME";
public static final String MODIFY_USER = "MODIFY_USER";
public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME";
@Override
protected Serializable pkVal() {
return this.handle;
}
@Override
public String toString() {
return "SurplusInventory{" +
"handle = " + handle +
", site = " + site +
", parentInventory = " + parentInventory +
", inventory = " + inventory +
", itemBo = " + itemBo +
", lenght = " + lenght +
", width = " + width +
", qty = " + qty +
", createUser = " + createUser +
", createdDateTime = " + createdDateTime +
", modifyUser = " + modifyUser +
", modifiedDateTime = " + modifiedDateTime +
"}";
}
}

@ -18,11 +18,11 @@ import com.baomidou.mybatisplus.annotation.IdType;
* </p> * </p>
* *
* @author Leon.L * @author Leon.L
* @since 2021-07-15 * @since 2021-07-19
*/ */
@TableName("Z_SURPLUS_ITEM_RETURN") @TableName("Z_SURPLUS_RETURN")
public class SurplusItemReturn extends Model<SurplusItemReturn> { public class SurplusReturn extends Model<SurplusReturn> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -36,16 +36,16 @@ public class SurplusItemReturn extends Model<SurplusItemReturn> {
*/ */
@TableField("SITE") @TableField("SITE")
private String site; private String site;
/**
*
*/
@TableField("INVENTORY")
private String inventory;
/** /**
* *
*/ */
@TableField("PARENT_INVENTORY") @TableField("PARENT_INVENTORY")
private String parentInventory; private String parentInventory;
/**
*
*/
@TableField("INVENTORY")
private String inventory;
/** /**
* *
*/ */
@ -109,14 +109,6 @@ public class SurplusItemReturn extends Model<SurplusItemReturn> {
this.site = site; this.site = site;
} }
public String getInventory() {
return inventory;
}
public void setInventory(String inventory) {
this.inventory = inventory;
}
public String getParentInventory() { public String getParentInventory() {
return parentInventory; return parentInventory;
} }
@ -125,6 +117,14 @@ public class SurplusItemReturn extends Model<SurplusItemReturn> {
this.parentInventory = parentInventory; this.parentInventory = parentInventory;
} }
public String getInventory() {
return inventory;
}
public void setInventory(String inventory) {
this.inventory = inventory;
}
public String getItemBo() { public String getItemBo() {
return itemBo; return itemBo;
} }
@ -197,31 +197,31 @@ public class SurplusItemReturn extends Model<SurplusItemReturn> {
this.modifiedDateTime = modifiedDateTime; this.modifiedDateTime = modifiedDateTime;
} }
public static final String HANDLE = "HANDLE"; public static final String HANDLE = "HANDLE";
public static final String SITE = "SITE"; public static final String SITE = "SITE";
public static final String INVENTORY = "INVENTORY"; public static final String PARENT_INVENTORY = "PARENT_INVENTORY";
public static final String PARENT_INVENTORY = "PARENT_INVENTORY"; public static final String INVENTORY = "INVENTORY";
public static final String ITEM_BO = "ITEM_BO"; public static final String ITEM_BO = "ITEM_BO";
public static final String LENGHT = "LENGHT"; public static final String LENGHT = "LENGHT";
public static final String WIDTH = "WIDTH"; public static final String WIDTH = "WIDTH";
public static final String NUMBERS = "NUMBERS"; public static final String NUMBERS = "NUMBERS";
public static final String QTY = "QTY"; public static final String QTY = "QTY";
public static final String CREATE_USER = "CREATE_USER"; public static final String CREATE_USER = "CREATE_USER";
public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME"; public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME";
public static final String MODIFY_USER = "MODIFY_USER"; public static final String MODIFY_USER = "MODIFY_USER";
public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME"; public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME";
@Override @Override
@ -231,11 +231,11 @@ public class SurplusItemReturn extends Model<SurplusItemReturn> {
@Override @Override
public String toString() { public String toString() {
return "SurplusItemReturn{" + return "SurplusReturn{" +
"handle = " + handle + "handle = " + handle +
", site = " + site + ", site = " + site +
", inventory = " + inventory +
", parentInventory = " + parentInventory + ", parentInventory = " + parentInventory +
", inventory = " + inventory +
", itemBo = " + itemBo + ", itemBo = " + itemBo +
", lenght = " + lenght + ", lenght = " + lenght +
", width = " + width + ", width = " + width +

@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import com.foreverwin.mesnac.dispatch.model.IssueItem; import com.foreverwin.mesnac.dispatch.model.IssueItem;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import java.math.BigDecimal;
import java.util.Map; import java.util.Map;
@ -17,6 +18,15 @@ import java.util.Map;
*/ */
public interface IssueItemService extends IService<IssueItem> { public interface IssueItemService extends IService<IssueItem> {
/**
*
*
* @param site
* @param inventory
* @return
*/
BigDecimal getInvIssueQty(String site, String inventory);
/** /**
* *
* 1.-ERP * 1.-ERP
@ -28,7 +38,7 @@ public interface IssueItemService extends IService<IssueItem> {
* @param inventory * @param inventory
* @return * @return
*/ */
Map<String, Object> scanIssueInventory(String site, String item, String inventory); Map<String, Object> scanIssueInventory(String site, String item, String inventory, Boolean oddments);
/** /**
* *

@ -0,0 +1,28 @@
package com.foreverwin.mesnac.dispatch.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.dispatch.model.SurplusInventory;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.modular.core.util.FrontPage;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author Leon.L
* @since 2021-07-19
*/
public interface SurplusInventoryService extends IService<SurplusInventory> {
/**
*
* @param frontPage
* @return
*/
IPage<SurplusInventory> selectPage(FrontPage<SurplusInventory> frontPage, SurplusInventory surplusInventory);
List<SurplusInventory> selectList(SurplusInventory surplusInventory);
}

@ -1,8 +1,7 @@
package com.foreverwin.mesnac.dispatch.service; package com.foreverwin.mesnac.dispatch.service;
import com.foreverwin.mesnac.dispatch.model.SurplusItemReturn; import com.foreverwin.mesnac.dispatch.model.SurplusReturn;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Map; import java.util.Map;
@ -12,9 +11,9 @@ import java.util.Map;
* </p> * </p>
* *
* @author Leon.L * @author Leon.L
* @since 2021-07-10 * @since 2021-07-19
*/ */
public interface SurplusItemReturnService extends IService<SurplusItemReturn> { public interface SurplusReturnService extends IService<SurplusReturn> {
/** /**
* *
@ -40,4 +39,5 @@ public interface SurplusItemReturnService extends IService<SurplusItemReturn> {
* @param qty * @param qty
*/ */
void surplusReturn(String site, String user, String inventory, String length, String width, BigDecimal numbers, BigDecimal qty); void surplusReturn(String site, String user, String inventory, String length, String width, BigDecimal numbers, BigDecimal qty);
} }

@ -12,13 +12,17 @@ import com.foreverwin.mesnac.dispatch.model.CallItem;
import com.foreverwin.mesnac.dispatch.model.IssueItem; import com.foreverwin.mesnac.dispatch.model.IssueItem;
import com.foreverwin.mesnac.dispatch.mapper.IssueItemMapper; import com.foreverwin.mesnac.dispatch.mapper.IssueItemMapper;
import com.foreverwin.mesnac.dispatch.model.ItemBatch; import com.foreverwin.mesnac.dispatch.model.ItemBatch;
import com.foreverwin.mesnac.dispatch.model.SurplusInventory;
import com.foreverwin.mesnac.dispatch.service.CallItemService; import com.foreverwin.mesnac.dispatch.service.CallItemService;
import com.foreverwin.mesnac.dispatch.service.IssueItemService; import com.foreverwin.mesnac.dispatch.service.IssueItemService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.foreverwin.mesnac.dispatch.service.ItemBatchService; import com.foreverwin.mesnac.dispatch.service.ItemBatchService;
import com.foreverwin.mesnac.dispatch.service.SurplusInventoryService;
import com.foreverwin.mesnac.meapi.model.Inventory; import com.foreverwin.mesnac.meapi.model.Inventory;
import com.foreverwin.mesnac.meapi.model.InventoryAssyData;
import com.foreverwin.mesnac.meapi.model.Item; import com.foreverwin.mesnac.meapi.model.Item;
import com.foreverwin.mesnac.meapi.model.Sfc; import com.foreverwin.mesnac.meapi.model.Sfc;
import com.foreverwin.mesnac.meapi.service.InventoryAssyDataService;
import com.foreverwin.mesnac.meapi.service.InventoryService; import com.foreverwin.mesnac.meapi.service.InventoryService;
import com.foreverwin.mesnac.meapi.service.ItemService; import com.foreverwin.mesnac.meapi.service.ItemService;
import com.foreverwin.mesnac.meapi.service.SfcService; import com.foreverwin.mesnac.meapi.service.SfcService;
@ -53,15 +57,26 @@ public class IssueItemServiceImpl extends ServiceImpl<IssueItemMapper, IssueItem
@Autowired @Autowired
private ItemService itemService; private ItemService itemService;
@Autowired @Autowired
private IssueItemMapper issueItemMapper;
@Autowired
private CallItemService callItemService; private CallItemService callItemService;
@Autowired @Autowired
private ItemBatchService itemBatchService; private ItemBatchService itemBatchService;
@Autowired @Autowired
private InventoryService inventoryService; private InventoryService inventoryService;
@Autowired
private SurplusInventoryService surplusInventoryService;
@Override @Override
public Map<String, Object> scanIssueInventory(String site, String item, String inventory) { public BigDecimal getInvIssueQty(String site, String inventory) {
BigDecimal qty = issueItemMapper.selectInvIssueQty(site, inventory);
return qty = qty == null ? BigDecimal.ZERO : qty;
}
@Override
public Map<String, Object> scanIssueInventory(String site, String item, String inventory, Boolean oddments) {
Item itemModel = itemService.selectCurrent(site, item); Item itemModel = itemService.selectCurrent(site, item);
if (itemModel == null) { if (itemModel == null) {
throw BusinessException.build("物料【" +item+"】的当前版本不存在!"); throw BusinessException.build("物料【" +item+"】的当前版本不存在!");
@ -104,6 +119,15 @@ public class IssueItemServiceImpl extends ServiceImpl<IssueItemMapper, IssueItem
map.put("qty", inventoryModel.getQtyOnHand()); map.put("qty", inventoryModel.getQtyOnHand());
} }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//查询余料长宽
if (oddments && StringUtil.notBlank(inventory)) {
Map<String, Object> queryMap = new HashMap<>();
queryMap.put(SurplusInventory.SITE, site);
queryMap.put(SurplusInventory.PARENT_INVENTORY, inventory);
List<SurplusInventory> list = (List<SurplusInventory>) surplusInventoryService.listByMap(queryMap);
map.put("wlList", list);
}
return map; return map;
} }
@ -207,7 +231,10 @@ public class IssueItemServiceImpl extends ServiceImpl<IssueItemMapper, IssueItem
if (!inventoryModel.getItemBo().equals(itemBo)) { if (!inventoryModel.getItemBo().equals(itemBo)) {
throw BusinessException.build("扫描的物料条码【 "+ inventory +" 】不是物料【"+ item +"】的库存!"); throw BusinessException.build("扫描的物料条码【 "+ inventory +" 】不是物料【"+ item +"】的库存!");
} }
if (inventoryModel.getQtyOnHand().compareTo(issueInvQty) <= 0) {
BigDecimal issuedQty = this.getInvIssueQty(site, inventory);
BigDecimal qtyOnHand = inventoryModel.getQtyOnHand().subtract(issuedQty);
if (qtyOnHand.compareTo(issueInvQty) <= 0) {
throw BusinessException.build("扫描的物料条码【 "+ inventory +" 】的库存数量小于发料数量【" +issueInvQty+ "】!"); throw BusinessException.build("扫描的物料条码【 "+ inventory +" 】的库存数量小于发料数量【" +issueInvQty+ "】!");
} }
} }
@ -261,6 +288,83 @@ public class IssueItemServiceImpl extends ServiceImpl<IssueItemMapper, IssueItem
}//end for }//end for
} else { } else {
//余料发料 //余料发料
for (int i = 0; i < jsonArray.size(); i++) {
JSONObject _jsonObject = jsonArray.getJSONObject(i);
String inventory = _jsonObject.getString("inventory");
String qty = _jsonObject.getString("qty");
String width = _jsonObject.getString("width");
String length = _jsonObject.getString("length");
BigDecimal issueInvQty = new BigDecimal(qty);
if (StringUtil.isBlank(width) && StringUtil.isBlank(length)) {
throw BusinessException.build("请选择余料的长度和宽度!");
}
inventory = StringUtil.notBlank(length) ? inventory + "*" + length : inventory;
inventory = StringUtil.notBlank(width) ? inventory + "*" + width : inventory;
String inventoryBo = HandleEnum.INVENTORY.getHandle(site, inventory);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Inventory inventoryModel = inventoryService.getById(inventoryBo);
if (inventoryModel == null) {
throw BusinessException.build("扫描的物料条码【 "+ inventory +" 】不存在!");
}
if (!inventoryModel.getItemBo().equals(itemBo)) {
throw BusinessException.build("扫描的物料条码【 "+ inventory +" 】不是物料【"+ item +"】的库存!");
}
BigDecimal issuedQty = this.getInvIssueQty(site, inventory);
BigDecimal qtyOnHand = inventoryModel.getQtyOnHand().subtract(issuedQty);
if (qtyOnHand.compareTo(issueInvQty) <= 0) {
throw BusinessException.build("扫描的物料条码【 "+ inventory +" 】的库存数量小于发料数量【" +issueInvQty+ "】!");
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//查询匹配的叫料记录
List<CallItem> list = callItemService.findIssueMatchCallItemList(site, workOrder, blankingSize, resource, item);
if (list == null || list.size() <= 0) {
throw BusinessException.build("根据发料数据未找到发料记录!");
}
BigDecimal remainQty = new BigDecimal(qty);
for (CallItem callItem: list) {
BigDecimal issueQty = callItem.getIssueQty();
BigDecimal requiredQty = callItem.getRequiredQty();
//还需发料数量
requiredQty = requiredQty.subtract(issueQty);
if (remainQty.compareTo(requiredQty) == 1) {
issueQty = issueQty.add(requiredQty);
} else {
issueQty = issueQty.add(remainQty);
}
//叫料数据修改
if (issueQty.compareTo(requiredQty) >= 0) {
callItem.setStatus(Constants.CALL_ITEM_STATUS_ISSUED);
}
callItem.setIssueQty(issueQty);
callItem.setModifyUser(user);
callItem.setModifiedDateTime(dateTime);
callItemList.add(callItem);
remainQty = remainQty.subtract(requiredQty);
if (remainQty.compareTo(BigDecimal.ZERO) <= 0) {
break;
}
}
//发料明细记录
IssueItem issueItem = new IssueItem();
issueItem.setHandle("IssueItemBO:" + site + "," + UUID.randomUUID().toString());
issueItem.setSite(site);
issueItem.setItem(item);
issueItem.setInventory(inventory);
issueItem.setQty(new BigDecimal(qty));
issueItem.setCreateUser(user);
issueItem.setCreatedDateTime(dateTime);
issueItem.setModifyUser(user);
issueItem.setModifiedDateTime(dateTime);
issueItemList.add(issueItem);
}
} }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@ -0,0 +1,44 @@
package com.foreverwin.mesnac.dispatch.service.impl;
import com.foreverwin.modular.core.util.FrontPage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.dispatch.model.SurplusInventory;
import com.foreverwin.mesnac.dispatch.mapper.SurplusInventoryMapper;
import com.foreverwin.mesnac.dispatch.service.SurplusInventoryService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author Leon.L
* @since 2021-07-19
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class SurplusInventoryServiceImpl extends ServiceImpl<SurplusInventoryMapper, SurplusInventory> implements SurplusInventoryService {
@Autowired
private SurplusInventoryMapper surplusInventoryMapper;
@Override
public IPage<SurplusInventory> selectPage(FrontPage<SurplusInventory> frontPage, SurplusInventory surplusInventory) {
QueryWrapper<SurplusInventory> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(surplusInventory);
return super.page(frontPage.getPagePlus(), queryWrapper);
}
@Override
public List<SurplusInventory> selectList(SurplusInventory surplusInventory) {
QueryWrapper<SurplusInventory> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(surplusInventory);
return super.list(queryWrapper);
}
}

@ -1,20 +1,22 @@
package com.foreverwin.mesnac.dispatch.service.impl; package com.foreverwin.mesnac.dispatch.service.impl;
import com.foreverwin.mesnac.common.enums.HandleEnum; import com.foreverwin.mesnac.common.enums.HandleEnum;
import com.foreverwin.mesnac.common.util.ExcelUtils;
import com.foreverwin.mesnac.common.util.ExceptionUtil; import com.foreverwin.mesnac.common.util.ExceptionUtil;
import com.foreverwin.mesnac.common.util.NumberUtil; import com.foreverwin.mesnac.common.util.NumberUtil;
import com.foreverwin.mesnac.common.util.StringUtil; import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.dispatch.model.SurplusInventory;
import com.foreverwin.mesnac.dispatch.service.SurplusInventoryService;
import com.foreverwin.mesnac.meapi.model.Inventory; import com.foreverwin.mesnac.meapi.model.Inventory;
import com.foreverwin.mesnac.meapi.service.InventoryAssyDataService;
import com.foreverwin.mesnac.meapi.service.InventoryService; import com.foreverwin.mesnac.meapi.service.InventoryService;
import com.foreverwin.modular.core.exception.BusinessException; import com.foreverwin.modular.core.exception.BusinessException;
import com.foreverwin.modular.core.meext.MEServices; import com.foreverwin.modular.core.meext.MEServices;
import com.foreverwin.modular.core.util.FrontPage; import com.foreverwin.modular.core.util.FrontPage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.dispatch.model.SurplusItemReturn; import com.foreverwin.mesnac.dispatch.model.SurplusReturn;
import com.foreverwin.mesnac.dispatch.mapper.SurplusItemReturnMapper; import com.foreverwin.mesnac.dispatch.mapper.SurplusReturnMapper;
import com.foreverwin.mesnac.dispatch.service.SurplusItemReturnService; import com.foreverwin.mesnac.dispatch.service.SurplusReturnService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sap.me.inventory.InventoryServiceInterface; import com.sap.me.inventory.InventoryServiceInterface;
import com.sap.me.inventory.InventorySplitRequest; import com.sap.me.inventory.InventorySplitRequest;
@ -36,17 +38,19 @@ import java.util.UUID;
* </p> * </p>
* *
* @author Leon.L * @author Leon.L
* @since 2021-07-10 * @since 2021-07-19
*/ */
@Service @Service
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public class SurplusItemReturnServiceImpl extends ServiceImpl<SurplusItemReturnMapper, SurplusItemReturn> implements SurplusItemReturnService { public class SurplusReturnServiceImpl extends ServiceImpl<SurplusReturnMapper, SurplusReturn> implements SurplusReturnService {
@Autowired @Autowired
private InventoryService inventoryService; private InventoryService inventoryService;
@Autowired @Autowired
private SurplusItemReturnMapper surplusItemReturnMapper; private SurplusReturnMapper surplusReturnMapper;
@Autowired
private SurplusInventoryService surplusInventoryService;
@Override @Override
@ -61,7 +65,7 @@ public class SurplusItemReturnServiceImpl extends ServiceImpl<SurplusItemReturnM
} }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Map<String, Object> map = surplusItemReturnMapper.selectInventoryData(inventoryBo); Map<String, Object> map = surplusReturnMapper.selectInventoryData(inventoryBo);
if (map == null || map.size() <= 0) { if (map == null || map.size() <= 0) {
throw BusinessException.build("物料条码【" + inventory +"】不存在!"); throw BusinessException.build("物料条码【" + inventory +"】不存在!");
} }
@ -134,9 +138,33 @@ public class SurplusItemReturnServiceImpl extends ServiceImpl<SurplusItemReturnM
} }
LocalDateTime dateTime = LocalDateTime.now(); LocalDateTime dateTime = LocalDateTime.now();
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//记录余料库存批次
String surplusInventoryBo = HandleEnum.INVENTORY.getHandle(site, surplusInventory);
SurplusInventory surplusInventoryModel = surplusInventoryService.getById(surplusInventoryBo);
if (surplusInventoryModel == null) {
surplusInventoryModel = new SurplusInventory();
surplusInventoryModel.setHandle(surplusInventoryBo);
surplusInventoryModel.setSite(site);
surplusInventoryModel.setParentInventory(inventory);
surplusInventoryModel.setInventory(surplusInventory);
surplusInventoryModel.setLenght(length);
surplusInventoryModel.setWidth(width);
surplusInventoryModel.setItemBo(inventoryModel.getItemBo());
surplusInventoryModel.setCreateUser(user);
surplusInventoryModel.setCreatedDateTime(dateTime);
surplusInventoryModel.setModifyUser(user);
surplusInventoryModel.setModifiedDateTime(dateTime);
surplusInventoryService.save(surplusInventoryModel);
} else {
surplusInventoryModel.setModifyUser(user);
surplusInventoryModel.setModifiedDateTime(dateTime);
surplusInventoryService.updateById(surplusInventoryModel);
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//记录余料退回日志 //记录余料退回日志
SurplusItemReturn surplusItemReturn = new SurplusItemReturn(); SurplusReturn surplusItemReturn = new SurplusReturn();
surplusItemReturn.setHandle(UUID.randomUUID().toString()); surplusItemReturn.setHandle(UUID.randomUUID().toString());
surplusItemReturn.setSite(site); surplusItemReturn.setSite(site);
surplusItemReturn.setParentInventory(inventory); surplusItemReturn.setParentInventory(inventory);
@ -150,6 +178,6 @@ public class SurplusItemReturnServiceImpl extends ServiceImpl<SurplusItemReturnM
surplusItemReturn.setCreatedDateTime(dateTime); surplusItemReturn.setCreatedDateTime(dateTime);
surplusItemReturn.setModifyUser(user); surplusItemReturn.setModifyUser(user);
surplusItemReturn.setModifiedDateTime(dateTime); surplusItemReturn.setModifiedDateTime(dateTime);
surplusItemReturnMapper.insert(surplusItemReturn); surplusReturnMapper.insert(surplusItemReturn);
} }
} }

@ -338,4 +338,10 @@
<!-- BaseMapper标准查询/修改/删除 --> <!-- BaseMapper标准查询/修改/删除 -->
<select id="selectInvIssueQty" resultType="java.math.BigDecimal">
SELECT SUM(NVL(QTY, 0)) QTY
FROM Z_ISSUE_ITEM
WHERE SITE = #{site} AND INVENTORY = #{inventory}
GROUP BY SITE, INVENTORY
</select>
</mapper> </mapper>

@ -0,0 +1,433 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.foreverwin.mesnac.dispatch.mapper.SurplusInventoryMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.dispatch.model.SurplusInventory">
<id column="HANDLE" property="handle" />
<result column="SITE" property="site" />
<result column="PARENT_INVENTORY" property="parentInventory" />
<result column="INVENTORY" property="inventory" />
<result column="ITEM_BO" property="itemBo" />
<result column="LENGHT" property="lenght" />
<result column="WIDTH" property="width" />
<result column="QTY" property="qty" />
<result column="CREATE_USER" property="createUser" />
<result column="CREATED_DATE_TIME" property="createdDateTime" />
<result column="MODIFY_USER" property="modifyUser" />
<result column="MODIFIED_DATE_TIME" property="modifiedDateTime" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
HANDLE, SITE, PARENT_INVENTORY, INVENTORY, ITEM_BO, LENGHT, WIDTH, QTY, CREATE_USER, CREATED_DATE_TIME, MODIFY_USER, MODIFIED_DATE_TIME
</sql>
<!-- BaseMapper标准查询/修改/删除 -->
<select id="selectById" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_SURPLUS_INVENTORY WHERE HANDLE=#{handle}
</select>
<select id="selectByMap" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM Z_SURPLUS_INVENTORY
<if test="cm!=null and !cm.isEmpty">
<where>
<foreach collection="cm.keys" item="k" separator="AND">
<if test="cm[k] != null">
${k} = #{cm[${k}]}
</if>
</foreach>
</where>
</if>
</select>
<select id="selectBatchIds" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM Z_SURPLUS_INVENTORY WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>)
</select>
<select id="selectOne" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_SURPLUS_INVENTORY
<where>
<if test="ew.entity.handle!=null">
HANDLE=#{ew.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.parentInventory!=null"> AND PARENT_INVENTORY=#{ew.entity.parentInventory}</if>
<if test="ew.entity.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.lenght!=null"> AND LENGHT=#{ew.entity.lenght}</if>
<if test="ew.entity.width!=null"> AND WIDTH=#{ew.entity.width}</if>
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</where>
</select>
<select id="selectCount" resultType="Integer">
SELECT COUNT(1) FROM Z_SURPLUS_INVENTORY
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.parentInventory!=null"> AND PARENT_INVENTORY=#{ew.entity.parentInventory}</if>
<if test="ew.entity.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.lenght!=null"> AND LENGHT=#{ew.entity.lenght}</if>
<if test="ew.entity.width!=null"> AND WIDTH=#{ew.entity.width}</if>
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectList" resultMap="BaseResultMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_SURPLUS_INVENTORY
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.parentInventory!=null"> AND PARENT_INVENTORY=#{ew.entity.parentInventory}</if>
<if test="ew.entity.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.lenght!=null"> AND LENGHT=#{ew.entity.lenght}</if>
<if test="ew.entity.width!=null"> AND WIDTH=#{ew.entity.width}</if>
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectMaps" resultType="HashMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_SURPLUS_INVENTORY
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.parentInventory!=null"> AND PARENT_INVENTORY=#{ew.entity.parentInventory}</if>
<if test="ew.entity.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.lenght!=null"> AND LENGHT=#{ew.entity.lenght}</if>
<if test="ew.entity.width!=null"> AND WIDTH=#{ew.entity.width}</if>
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectObjs" resultType="Object">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_SURPLUS_INVENTORY
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.parentInventory!=null"> AND PARENT_INVENTORY=#{ew.entity.parentInventory}</if>
<if test="ew.entity.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.lenght!=null"> AND LENGHT=#{ew.entity.lenght}</if>
<if test="ew.entity.width!=null"> AND WIDTH=#{ew.entity.width}</if>
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectPage" resultMap="BaseResultMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_SURPLUS_INVENTORY
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.parentInventory!=null"> AND PARENT_INVENTORY=#{ew.entity.parentInventory}</if>
<if test="ew.entity.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.lenght!=null"> AND LENGHT=#{ew.entity.lenght}</if>
<if test="ew.entity.width!=null"> AND WIDTH=#{ew.entity.width}</if>
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectMapsPage" resultType="HashMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_SURPLUS_INVENTORY
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.parentInventory!=null"> AND PARENT_INVENTORY=#{ew.entity.parentInventory}</if>
<if test="ew.entity.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.lenght!=null"> AND LENGHT=#{ew.entity.lenght}</if>
<if test="ew.entity.width!=null"> AND WIDTH=#{ew.entity.width}</if>
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<insert id="insert" parameterType="com.foreverwin.mesnac.dispatch.model.SurplusInventory">
INSERT INTO Z_SURPLUS_INVENTORY
<trim prefix="(" suffix=")" suffixOverrides=",">
HANDLE,
<if test="site!=null">SITE,</if>
<if test="parentInventory!=null">PARENT_INVENTORY,</if>
<if test="inventory!=null">INVENTORY,</if>
<if test="itemBo!=null">ITEM_BO,</if>
<if test="lenght!=null">LENGHT,</if>
<if test="width!=null">WIDTH,</if>
<if test="qty!=null">QTY,</if>
<if test="createUser!=null">CREATE_USER,</if>
<if test="createdDateTime!=null">CREATED_DATE_TIME,</if>
<if test="modifyUser!=null">MODIFY_USER,</if>
<if test="modifiedDateTime!=null">MODIFIED_DATE_TIME,</if>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
<if test="site!=null">#{site},</if>
<if test="parentInventory!=null">#{parentInventory},</if>
<if test="inventory!=null">#{inventory},</if>
<if test="itemBo!=null">#{itemBo},</if>
<if test="lenght!=null">#{lenght},</if>
<if test="width!=null">#{width},</if>
<if test="qty!=null">#{qty},</if>
<if test="createUser!=null">#{createUser},</if>
<if test="createdDateTime!=null">#{createdDateTime},</if>
<if test="modifyUser!=null">#{modifyUser},</if>
<if test="modifiedDateTime!=null">#{modifiedDateTime},</if>
</trim>
</insert>
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.dispatch.model.SurplusInventory">
INSERT INTO Z_SURPLUS_INVENTORY
<trim prefix="(" suffix=")" suffixOverrides=",">
<include refid="Base_Column_List"></include>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
#{site},
#{parentInventory},
#{inventory},
#{itemBo},
#{lenght},
#{width},
#{qty},
#{createUser},
#{createdDateTime},
#{modifyUser},
#{modifiedDateTime},
</trim>
</insert>
<update id="updateById">
UPDATE Z_SURPLUS_INVENTORY <trim prefix="SET" suffixOverrides=",">
<if test="et.site!=null">SITE=#{et.site},</if>
<if test="et.parentInventory!=null">PARENT_INVENTORY=#{et.parentInventory},</if>
<if test="et.inventory!=null">INVENTORY=#{et.inventory},</if>
<if test="et.itemBo!=null">ITEM_BO=#{et.itemBo},</if>
<if test="et.lenght!=null">LENGHT=#{et.lenght},</if>
<if test="et.width!=null">WIDTH=#{et.width},</if>
<if test="et.qty!=null">QTY=#{et.qty},</if>
<if test="et.createUser!=null">CREATE_USER=#{et.createUser},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
<if test="et.modifyUser!=null">MODIFY_USER=#{et.modifyUser},</if>
<if test="et.modifiedDateTime!=null">MODIFIED_DATE_TIME=#{et.modifiedDateTime},</if>
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
</update>
<update id="updateAllColumnById">
UPDATE Z_SURPLUS_INVENTORY <trim prefix="SET" suffixOverrides=",">
SITE=#{et.site},
PARENT_INVENTORY=#{et.parentInventory},
INVENTORY=#{et.inventory},
ITEM_BO=#{et.itemBo},
LENGHT=#{et.lenght},
WIDTH=#{et.width},
QTY=#{et.qty},
CREATE_USER=#{et.createUser},
CREATED_DATE_TIME=#{et.createdDateTime},
MODIFY_USER=#{et.modifyUser},
MODIFIED_DATE_TIME=#{et.modifiedDateTime},
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
</update>
<update id="update">
UPDATE Z_SURPLUS_INVENTORY <trim prefix="SET" suffixOverrides=",">
<if test="et.site!=null">SITE=#{et.site},</if>
<if test="et.parentInventory!=null">PARENT_INVENTORY=#{et.parentInventory},</if>
<if test="et.inventory!=null">INVENTORY=#{et.inventory},</if>
<if test="et.itemBo!=null">ITEM_BO=#{et.itemBo},</if>
<if test="et.lenght!=null">LENGHT=#{et.lenght},</if>
<if test="et.width!=null">WIDTH=#{et.width},</if>
<if test="et.qty!=null">QTY=#{et.qty},</if>
<if test="et.createUser!=null">CREATE_USER=#{et.createUser},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
<if test="et.modifyUser!=null">MODIFY_USER=#{et.modifyUser},</if>
<if test="et.modifiedDateTime!=null">MODIFIED_DATE_TIME=#{et.modifiedDateTime},</if>
</trim>
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
HANDLE=#{ew.entity.handle}
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.parentInventory!=null"> AND PARENT_INVENTORY=#{ew.entity.parentInventory}</if>
<if test="ew.entity.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.lenght!=null"> AND LENGHT=#{ew.entity.lenght}</if>
<if test="ew.entity.width!=null"> AND WIDTH=#{ew.entity.width}</if>
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</update>
<delete id="deleteById">
DELETE FROM Z_SURPLUS_INVENTORY WHERE HANDLE=#{handle}
</delete>
<delete id="deleteByMap">
DELETE FROM Z_SURPLUS_INVENTORY
<if test="cm!=null and !cm.isEmpty">
<where>
<foreach collection="cm.keys" item="k" separator="AND">
<if test="cm[k] != null">
${k} = #{cm[${k}]}
</if>
</foreach>
</where>
</if>
</delete>
<delete id="delete">
DELETE FROM Z_SURPLUS_INVENTORY
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.parentInventory!=null"> AND PARENT_INVENTORY=#{ew.entity.parentInventory}</if>
<if test="ew.entity.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.lenght!=null"> AND LENGHT=#{ew.entity.lenght}</if>
<if test="ew.entity.width!=null"> AND WIDTH=#{ew.entity.width}</if>
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</delete>
<delete id="deleteBatchIds">
DELETE FROM Z_SURPLUS_INVENTORY WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>)
</delete>
<!-- BaseMapper标准查询/修改/删除 -->
</mapper>

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.foreverwin.mesnac.dispatch.mapper.SurplusItemReturnMapper"> <mapper namespace="com.foreverwin.mesnac.dispatch.mapper.SurplusReturnMapper">
<!-- 通用查询映射结果 --> <!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.dispatch.model.SurplusItemReturn"> <resultMap id="BaseResultMap" type="com.foreverwin.mesnac.dispatch.model.SurplusReturn">
<id column="HANDLE" property="handle" /> <id column="HANDLE" property="handle" />
<result column="SITE" property="site" /> <result column="SITE" property="site" />
<result column="INVENTORY" property="inventory" />
<result column="PARENT_INVENTORY" property="parentInventory" /> <result column="PARENT_INVENTORY" property="parentInventory" />
<result column="INVENTORY" property="inventory" />
<result column="ITEM_BO" property="itemBo" /> <result column="ITEM_BO" property="itemBo" />
<result column="LENGHT" property="lenght" /> <result column="LENGHT" property="lenght" />
<result column="WIDTH" property="width" /> <result column="WIDTH" property="width" />
@ -21,17 +21,17 @@
<!-- 通用查询结果列 --> <!-- 通用查询结果列 -->
<sql id="Base_Column_List"> <sql id="Base_Column_List">
HANDLE, SITE, INVENTORY, PARENT_INVENTORY, ITEM_BO, LENGHT, WIDTH, NUMBERS, QTY, CREATE_USER, CREATED_DATE_TIME, MODIFY_USER, MODIFIED_DATE_TIME HANDLE, SITE, PARENT_INVENTORY, INVENTORY, ITEM_BO, LENGHT, WIDTH, NUMBERS, QTY, CREATE_USER, CREATED_DATE_TIME, MODIFY_USER, MODIFIED_DATE_TIME
</sql> </sql>
<!-- BaseMapper标准查询/修改/删除 --> <!-- BaseMapper标准查询/修改/删除 -->
<select id="selectById" resultMap="BaseResultMap"> <select id="selectById" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_SURPLUS_ITEM_RETURN WHERE HANDLE=#{handle} SELECT <include refid="Base_Column_List"></include> FROM Z_SURPLUS_RETURN WHERE HANDLE=#{handle}
</select> </select>
<select id="selectByMap" resultMap="BaseResultMap"> <select id="selectByMap" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> SELECT <include refid="Base_Column_List"></include>
FROM Z_SURPLUS_ITEM_RETURN FROM Z_SURPLUS_RETURN
<if test="cm!=null and !cm.isEmpty"> <if test="cm!=null and !cm.isEmpty">
<where> <where>
<foreach collection="cm.keys" item="k" separator="AND"> <foreach collection="cm.keys" item="k" separator="AND">
@ -45,20 +45,20 @@
<select id="selectBatchIds" resultMap="BaseResultMap"> <select id="selectBatchIds" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> SELECT <include refid="Base_Column_List"></include>
FROM Z_SURPLUS_ITEM_RETURN WHERE HANDLE IN ( FROM Z_SURPLUS_RETURN WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item} <foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>) </foreach>)
</select> </select>
<select id="selectOne" resultMap="BaseResultMap"> <select id="selectOne" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_SURPLUS_ITEM_RETURN SELECT <include refid="Base_Column_List"></include> FROM Z_SURPLUS_RETURN
<where> <where>
<if test="ew.entity.handle!=null"> <if test="ew.entity.handle!=null">
HANDLE=#{ew.handle} HANDLE=#{ew.handle}
</if> </if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if> <if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
<if test="ew.entity.parentInventory!=null"> AND PARENT_INVENTORY=#{ew.entity.parentInventory}</if> <if test="ew.entity.parentInventory!=null"> AND PARENT_INVENTORY=#{ew.entity.parentInventory}</if>
<if test="ew.entity.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if> <if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.lenght!=null"> AND LENGHT=#{ew.entity.lenght}</if> <if test="ew.entity.lenght!=null"> AND LENGHT=#{ew.entity.lenght}</if>
<if test="ew.entity.width!=null"> AND WIDTH=#{ew.entity.width}</if> <if test="ew.entity.width!=null"> AND WIDTH=#{ew.entity.width}</if>
@ -72,25 +72,25 @@
</select> </select>
<select id="selectCount" resultType="Integer"> <select id="selectCount" resultType="Integer">
SELECT COUNT(1) FROM Z_SURPLUS_ITEM_RETURN SELECT COUNT(1) FROM Z_SURPLUS_RETURN
<where> <where>
<if test="ew!=null"> <if test="ew!=null">
<if test="ew.entity!=null"> <if test="ew.entity!=null">
<if test="ew.entity.handle!=null"> <if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle} HANDLE=#{ew.entity.handle}
</if> </if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if> <if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if> <if test="ew.entity.parentInventory!=null"> AND PARENT_INVENTORY=#{ew.entity.parentInventory}</if>
<if test="ew.entity.parentInventory!=null"> AND PARENT_INVENTORY=#{ew.entity.parentInventory}</if> <if test="ew.entity.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if> <if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.lenght!=null"> AND LENGHT=#{ew.entity.lenght}</if> <if test="ew.entity.lenght!=null"> AND LENGHT=#{ew.entity.lenght}</if>
<if test="ew.entity.width!=null"> AND WIDTH=#{ew.entity.width}</if> <if test="ew.entity.width!=null"> AND WIDTH=#{ew.entity.width}</if>
<if test="ew.entity.numbers!=null"> AND NUMBERS=#{ew.entity.numbers}</if> <if test="ew.entity.numbers!=null"> AND NUMBERS=#{ew.entity.numbers}</if>
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if> <if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if> <if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if> <if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if> <if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if> <if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if> </if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere"> <if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment} ${ew.sqlSegment}
@ -103,7 +103,7 @@
</select> </select>
<select id="selectList" resultMap="BaseResultMap"> <select id="selectList" resultMap="BaseResultMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_SURPLUS_ITEM_RETURN SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_SURPLUS_RETURN
<where> <where>
<if test="ew!=null"> <if test="ew!=null">
<if test="ew.entity!=null"> <if test="ew.entity!=null">
@ -111,8 +111,8 @@
HANDLE=#{ew.entity.handle} HANDLE=#{ew.entity.handle}
</if> </if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if> <if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
<if test="ew.entity.parentInventory!=null"> AND PARENT_INVENTORY=#{ew.entity.parentInventory}</if> <if test="ew.entity.parentInventory!=null"> AND PARENT_INVENTORY=#{ew.entity.parentInventory}</if>
<if test="ew.entity.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if> <if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.lenght!=null"> AND LENGHT=#{ew.entity.lenght}</if> <if test="ew.entity.lenght!=null"> AND LENGHT=#{ew.entity.lenght}</if>
<if test="ew.entity.width!=null"> AND WIDTH=#{ew.entity.width}</if> <if test="ew.entity.width!=null"> AND WIDTH=#{ew.entity.width}</if>
@ -134,7 +134,7 @@
</select> </select>
<select id="selectMaps" resultType="HashMap"> <select id="selectMaps" resultType="HashMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_SURPLUS_ITEM_RETURN SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_SURPLUS_RETURN
<where> <where>
<if test="ew!=null"> <if test="ew!=null">
<if test="ew.entity!=null"> <if test="ew.entity!=null">
@ -142,8 +142,8 @@
HANDLE=#{ew.entity.handle} HANDLE=#{ew.entity.handle}
</if> </if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if> <if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
<if test="ew.entity.parentInventory!=null"> AND PARENT_INVENTORY=#{ew.entity.parentInventory}</if> <if test="ew.entity.parentInventory!=null"> AND PARENT_INVENTORY=#{ew.entity.parentInventory}</if>
<if test="ew.entity.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if> <if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.lenght!=null"> AND LENGHT=#{ew.entity.lenght}</if> <if test="ew.entity.lenght!=null"> AND LENGHT=#{ew.entity.lenght}</if>
<if test="ew.entity.width!=null"> AND WIDTH=#{ew.entity.width}</if> <if test="ew.entity.width!=null"> AND WIDTH=#{ew.entity.width}</if>
@ -165,7 +165,7 @@
</select> </select>
<select id="selectObjs" resultType="Object"> <select id="selectObjs" resultType="Object">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_SURPLUS_ITEM_RETURN SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_SURPLUS_RETURN
<where> <where>
<if test="ew!=null"> <if test="ew!=null">
<if test="ew.entity!=null"> <if test="ew.entity!=null">
@ -173,8 +173,8 @@
HANDLE=#{ew.entity.handle} HANDLE=#{ew.entity.handle}
</if> </if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if> <if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
<if test="ew.entity.parentInventory!=null"> AND PARENT_INVENTORY=#{ew.entity.parentInventory}</if> <if test="ew.entity.parentInventory!=null"> AND PARENT_INVENTORY=#{ew.entity.parentInventory}</if>
<if test="ew.entity.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if> <if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.lenght!=null"> AND LENGHT=#{ew.entity.lenght}</if> <if test="ew.entity.lenght!=null"> AND LENGHT=#{ew.entity.lenght}</if>
<if test="ew.entity.width!=null"> AND WIDTH=#{ew.entity.width}</if> <if test="ew.entity.width!=null"> AND WIDTH=#{ew.entity.width}</if>
@ -196,7 +196,7 @@
</select> </select>
<select id="selectPage" resultMap="BaseResultMap"> <select id="selectPage" resultMap="BaseResultMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_SURPLUS_ITEM_RETURN SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_SURPLUS_RETURN
<where> <where>
<if test="ew!=null"> <if test="ew!=null">
<if test="ew.entity!=null"> <if test="ew.entity!=null">
@ -204,8 +204,8 @@
HANDLE=#{ew.entity.handle} HANDLE=#{ew.entity.handle}
</if> </if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if> <if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
<if test="ew.entity.parentInventory!=null"> AND PARENT_INVENTORY=#{ew.entity.parentInventory}</if> <if test="ew.entity.parentInventory!=null"> AND PARENT_INVENTORY=#{ew.entity.parentInventory}</if>
<if test="ew.entity.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if> <if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.lenght!=null"> AND LENGHT=#{ew.entity.lenght}</if> <if test="ew.entity.lenght!=null"> AND LENGHT=#{ew.entity.lenght}</if>
<if test="ew.entity.width!=null"> AND WIDTH=#{ew.entity.width}</if> <if test="ew.entity.width!=null"> AND WIDTH=#{ew.entity.width}</if>
@ -227,7 +227,7 @@
</select> </select>
<select id="selectMapsPage" resultType="HashMap"> <select id="selectMapsPage" resultType="HashMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_SURPLUS_ITEM_RETURN SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_SURPLUS_RETURN
<where> <where>
<if test="ew!=null"> <if test="ew!=null">
<if test="ew.entity!=null"> <if test="ew.entity!=null">
@ -235,8 +235,8 @@
HANDLE=#{ew.entity.handle} HANDLE=#{ew.entity.handle}
</if> </if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if> <if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
<if test="ew.entity.parentInventory!=null"> AND PARENT_INVENTORY=#{ew.entity.parentInventory}</if> <if test="ew.entity.parentInventory!=null"> AND PARENT_INVENTORY=#{ew.entity.parentInventory}</if>
<if test="ew.entity.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if> <if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.lenght!=null"> AND LENGHT=#{ew.entity.lenght}</if> <if test="ew.entity.lenght!=null"> AND LENGHT=#{ew.entity.lenght}</if>
<if test="ew.entity.width!=null"> AND WIDTH=#{ew.entity.width}</if> <if test="ew.entity.width!=null"> AND WIDTH=#{ew.entity.width}</if>
@ -257,13 +257,13 @@
</if> </if>
</select> </select>
<insert id="insert" parameterType="com.foreverwin.mesnac.dispatch.model.SurplusItemReturn"> <insert id="insert" parameterType="com.foreverwin.mesnac.dispatch.model.SurplusReturn">
INSERT INTO Z_SURPLUS_ITEM_RETURN INSERT INTO Z_SURPLUS_RETURN
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
HANDLE, HANDLE,
<if test="site!=null">SITE,</if> <if test="site!=null">SITE,</if>
<if test="inventory!=null">INVENTORY,</if>
<if test="parentInventory!=null">PARENT_INVENTORY,</if> <if test="parentInventory!=null">PARENT_INVENTORY,</if>
<if test="inventory!=null">INVENTORY,</if>
<if test="itemBo!=null">ITEM_BO,</if> <if test="itemBo!=null">ITEM_BO,</if>
<if test="lenght!=null">LENGHT,</if> <if test="lenght!=null">LENGHT,</if>
<if test="width!=null">WIDTH,</if> <if test="width!=null">WIDTH,</if>
@ -277,8 +277,8 @@
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
#{handle}, #{handle},
<if test="site!=null">#{site},</if> <if test="site!=null">#{site},</if>
<if test="inventory!=null">#{inventory},</if>
<if test="parentInventory!=null">#{parentInventory},</if> <if test="parentInventory!=null">#{parentInventory},</if>
<if test="inventory!=null">#{inventory},</if>
<if test="itemBo!=null">#{itemBo},</if> <if test="itemBo!=null">#{itemBo},</if>
<if test="lenght!=null">#{lenght},</if> <if test="lenght!=null">#{lenght},</if>
<if test="width!=null">#{width},</if> <if test="width!=null">#{width},</if>
@ -291,16 +291,16 @@
</trim> </trim>
</insert> </insert>
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.dispatch.model.SurplusItemReturn"> <insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.dispatch.model.SurplusReturn">
INSERT INTO Z_SURPLUS_ITEM_RETURN INSERT INTO Z_SURPLUS_RETURN
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<include refid="Base_Column_List"></include> <include refid="Base_Column_List"></include>
</trim> VALUES </trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
#{handle}, #{handle},
#{site}, #{site},
#{inventory},
#{parentInventory}, #{parentInventory},
#{inventory},
#{itemBo}, #{itemBo},
#{lenght}, #{lenght},
#{width}, #{width},
@ -315,10 +315,10 @@
<update id="updateById"> <update id="updateById">
UPDATE Z_SURPLUS_ITEM_RETURN <trim prefix="SET" suffixOverrides=","> UPDATE Z_SURPLUS_RETURN <trim prefix="SET" suffixOverrides=",">
<if test="et.site!=null">SITE=#{et.site},</if> <if test="et.site!=null">SITE=#{et.site},</if>
<if test="et.inventory!=null">INVENTORY=#{et.inventory},</if>
<if test="et.parentInventory!=null">PARENT_INVENTORY=#{et.parentInventory},</if> <if test="et.parentInventory!=null">PARENT_INVENTORY=#{et.parentInventory},</if>
<if test="et.inventory!=null">INVENTORY=#{et.inventory},</if>
<if test="et.itemBo!=null">ITEM_BO=#{et.itemBo},</if> <if test="et.itemBo!=null">ITEM_BO=#{et.itemBo},</if>
<if test="et.lenght!=null">LENGHT=#{et.lenght},</if> <if test="et.lenght!=null">LENGHT=#{et.lenght},</if>
<if test="et.width!=null">WIDTH=#{et.width},</if> <if test="et.width!=null">WIDTH=#{et.width},</if>
@ -328,15 +328,15 @@
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if> <if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
<if test="et.modifyUser!=null">MODIFY_USER=#{et.modifyUser},</if> <if test="et.modifyUser!=null">MODIFY_USER=#{et.modifyUser},</if>
<if test="et.modifiedDateTime!=null">MODIFIED_DATE_TIME=#{et.modifiedDateTime},</if> <if test="et.modifiedDateTime!=null">MODIFIED_DATE_TIME=#{et.modifiedDateTime},</if>
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if> </trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
</update> </update>
<update id="updateAllColumnById"> <update id="updateAllColumnById">
UPDATE Z_SURPLUS_ITEM_RETURN <trim prefix="SET" suffixOverrides=","> UPDATE Z_SURPLUS_RETURN <trim prefix="SET" suffixOverrides=",">
SITE=#{et.site}, SITE=#{et.site},
INVENTORY=#{et.inventory},
PARENT_INVENTORY=#{et.parentInventory}, PARENT_INVENTORY=#{et.parentInventory},
INVENTORY=#{et.inventory},
ITEM_BO=#{et.itemBo}, ITEM_BO=#{et.itemBo},
LENGHT=#{et.lenght}, LENGHT=#{et.lenght},
WIDTH=#{et.width}, WIDTH=#{et.width},
@ -346,15 +346,15 @@
CREATED_DATE_TIME=#{et.createdDateTime}, CREATED_DATE_TIME=#{et.createdDateTime},
MODIFY_USER=#{et.modifyUser}, MODIFY_USER=#{et.modifyUser},
MODIFIED_DATE_TIME=#{et.modifiedDateTime}, MODIFIED_DATE_TIME=#{et.modifiedDateTime},
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if> </trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
</update> </update>
<update id="update"> <update id="update">
UPDATE Z_SURPLUS_ITEM_RETURN <trim prefix="SET" suffixOverrides=","> UPDATE Z_SURPLUS_RETURN <trim prefix="SET" suffixOverrides=",">
<if test="et.site!=null">SITE=#{et.site},</if> <if test="et.site!=null">SITE=#{et.site},</if>
<if test="et.inventory!=null">INVENTORY=#{et.inventory},</if>
<if test="et.parentInventory!=null">PARENT_INVENTORY=#{et.parentInventory},</if> <if test="et.parentInventory!=null">PARENT_INVENTORY=#{et.parentInventory},</if>
<if test="et.inventory!=null">INVENTORY=#{et.inventory},</if>
<if test="et.itemBo!=null">ITEM_BO=#{et.itemBo},</if> <if test="et.itemBo!=null">ITEM_BO=#{et.itemBo},</if>
<if test="et.lenght!=null">LENGHT=#{et.lenght},</if> <if test="et.lenght!=null">LENGHT=#{et.lenght},</if>
<if test="et.width!=null">WIDTH=#{et.width},</if> <if test="et.width!=null">WIDTH=#{et.width},</if>
@ -370,8 +370,8 @@
<if test="ew.entity!=null"> <if test="ew.entity!=null">
HANDLE=#{ew.entity.handle} HANDLE=#{ew.entity.handle}
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if> <if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
<if test="ew.entity.parentInventory!=null"> AND PARENT_INVENTORY=#{ew.entity.parentInventory}</if> <if test="ew.entity.parentInventory!=null"> AND PARENT_INVENTORY=#{ew.entity.parentInventory}</if>
<if test="ew.entity.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if> <if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.lenght!=null"> AND LENGHT=#{ew.entity.lenght}</if> <if test="ew.entity.lenght!=null"> AND LENGHT=#{ew.entity.lenght}</if>
<if test="ew.entity.width!=null"> AND WIDTH=#{ew.entity.width}</if> <if test="ew.entity.width!=null"> AND WIDTH=#{ew.entity.width}</if>
@ -393,11 +393,11 @@
</update> </update>
<delete id="deleteById"> <delete id="deleteById">
DELETE FROM Z_SURPLUS_ITEM_RETURN WHERE HANDLE=#{handle} DELETE FROM Z_SURPLUS_RETURN WHERE HANDLE=#{handle}
</delete> </delete>
<delete id="deleteByMap"> <delete id="deleteByMap">
DELETE FROM Z_SURPLUS_ITEM_RETURN DELETE FROM Z_SURPLUS_RETURN
<if test="cm!=null and !cm.isEmpty"> <if test="cm!=null and !cm.isEmpty">
<where> <where>
<foreach collection="cm.keys" item="k" separator="AND"> <foreach collection="cm.keys" item="k" separator="AND">
@ -410,7 +410,7 @@
</delete> </delete>
<delete id="delete"> <delete id="delete">
DELETE FROM Z_SURPLUS_ITEM_RETURN DELETE FROM Z_SURPLUS_RETURN
<where> <where>
<if test="ew!=null"> <if test="ew!=null">
<if test="ew.entity!=null"> <if test="ew.entity!=null">
@ -418,8 +418,8 @@
HANDLE=#{ew.entity.handle} HANDLE=#{ew.entity.handle}
</if> </if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if> <if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
<if test="ew.entity.parentInventory!=null"> AND PARENT_INVENTORY=#{ew.entity.parentInventory}</if> <if test="ew.entity.parentInventory!=null"> AND PARENT_INVENTORY=#{ew.entity.parentInventory}</if>
<if test="ew.entity.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if> <if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.lenght!=null"> AND LENGHT=#{ew.entity.lenght}</if> <if test="ew.entity.lenght!=null"> AND LENGHT=#{ew.entity.lenght}</if>
<if test="ew.entity.width!=null"> AND WIDTH=#{ew.entity.width}</if> <if test="ew.entity.width!=null"> AND WIDTH=#{ew.entity.width}</if>
@ -441,13 +441,12 @@
</delete> </delete>
<delete id="deleteBatchIds"> <delete id="deleteBatchIds">
DELETE FROM Z_SURPLUS_ITEM_RETURN WHERE HANDLE IN ( DELETE FROM Z_SURPLUS_RETURN WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item} <foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>) </foreach>)
</delete> </delete>
<!-- BaseMapper标准查询/修改/删除 --> <!-- BaseMapper标准查询/修改/删除 -->
<select id="selectInventoryData" resultType="hashMap"> <select id="selectInventoryData" resultType="hashMap">
SELECT IV.HANDLE, IV.SITE, IV.INVENTORY_ID, IV.QTY_ON_HAND, IM.ITEM, IT.DESCRIPTION, CS1.VALUE PER_METER, CS2.VALUE PER_SQUARE_METER SELECT IV.HANDLE, IV.SITE, IV.INVENTORY_ID, IV.QTY_ON_HAND, IM.ITEM, IT.DESCRIPTION, CS1.VALUE PER_METER, CS2.VALUE PER_SQUARE_METER
FROM INVENTORY IV FROM INVENTORY IV

@ -2,7 +2,6 @@ package com.foreverwin.mesnac.integration.service.impl;
import com.foreverwin.mesnac.common.constant.Constants; import com.foreverwin.mesnac.common.constant.Constants;
import com.foreverwin.mesnac.common.constant.CustomFieldConstant; import com.foreverwin.mesnac.common.constant.CustomFieldConstant;
import com.foreverwin.mesnac.common.constant.DataImportConstant;
import com.foreverwin.mesnac.common.enums.HandleEnum; import com.foreverwin.mesnac.common.enums.HandleEnum;
import com.foreverwin.mesnac.common.util.StringUtil; import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.dispatch.model.ItemBatch; import com.foreverwin.mesnac.dispatch.model.ItemBatch;

@ -0,0 +1,18 @@
package com.foreverwin.mesnac.meapi.mapper;
import com.foreverwin.mesnac.meapi.model.InventoryAssyData;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* Mapper
* </p>
*
* @author Leon.L
* @since 2021-07-19
*/
@Repository
public interface InventoryAssyDataMapper extends BaseMapper<InventoryAssyData> {
}

@ -0,0 +1,104 @@
package com.foreverwin.mesnac.meapi.model;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.IdType;
/**
* <p>
*
* </p>
*
* @author Leon.L
* @since 2021-07-19
*/
@TableName("INVENTORY_ASSY_DATA")
public class InventoryAssyData extends Model<InventoryAssyData> {
private static final long serialVersionUID = 1L;
@TableId(value = "HANDLE", type = IdType.INPUT)
private String handle;
@TableField("INVENTORY_BO")
private String inventoryBo;
@TableField("SEQUENCE")
private Long sequence;
@TableField("DATA_FIELD")
private String dataField;
@TableField("DATA_ATTR")
private String dataAttr;
public String getHandle() {
return handle;
}
public void setHandle(String handle) {
this.handle = handle;
}
public String getInventoryBo() {
return inventoryBo;
}
public void setInventoryBo(String inventoryBo) {
this.inventoryBo = inventoryBo;
}
public Long getSequence() {
return sequence;
}
public void setSequence(Long sequence) {
this.sequence = sequence;
}
public String getDataField() {
return dataField;
}
public void setDataField(String dataField) {
this.dataField = dataField;
}
public String getDataAttr() {
return dataAttr;
}
public void setDataAttr(String dataAttr) {
this.dataAttr = dataAttr;
}
public static final String HANDLE = "HANDLE";
public static final String INVENTORY_BO = "INVENTORY_BO";
public static final String SEQUENCE = "SEQUENCE";
public static final String DATA_FIELD = "DATA_FIELD";
public static final String DATA_ATTR = "DATA_ATTR";
@Override
protected Serializable pkVal() {
return this.handle;
}
@Override
public String toString() {
return "InventoryAssyData{" +
"handle = " + handle +
", inventoryBo = " + inventoryBo +
", sequence = " + sequence +
", dataField = " + dataField +
", dataAttr = " + dataAttr +
"}";
}
}

@ -0,0 +1,30 @@
package com.foreverwin.mesnac.meapi.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.meapi.model.InventoryAssyData;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.modular.core.util.FrontPage;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author Leon.L
* @since 2021-07-19
*/
public interface InventoryAssyDataService extends IService<InventoryAssyData> {
/**
*
* @param frontPage
* @return
*/
IPage<InventoryAssyData> selectPage(FrontPage<InventoryAssyData> frontPage, InventoryAssyData inventoryAssyData);
List<InventoryAssyData> selectList(InventoryAssyData inventoryAssyData);
void saveOrUpdateInventoryData(String inventoryBo, String dataField, String dataAttr);
}

@ -0,0 +1,89 @@
package com.foreverwin.mesnac.meapi.service.impl;
import com.foreverwin.modular.core.util.FrontPage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.meapi.model.InventoryAssyData;
import com.foreverwin.mesnac.meapi.mapper.InventoryAssyDataMapper;
import com.foreverwin.mesnac.meapi.service.InventoryAssyDataService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* <p>
*
* </p>
*
* @author Leon.L
* @since 2021-07-19
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class InventoryAssyDataServiceImpl extends ServiceImpl<InventoryAssyDataMapper, InventoryAssyData> implements InventoryAssyDataService {
@Autowired
private InventoryAssyDataMapper inventoryAssyDataMapper;
@Override
public IPage<InventoryAssyData> selectPage(FrontPage<InventoryAssyData> frontPage, InventoryAssyData inventoryAssyData) {
QueryWrapper<InventoryAssyData> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(inventoryAssyData);
return super.page(frontPage.getPagePlus(), queryWrapper);
}
@Override
public List<InventoryAssyData> selectList(InventoryAssyData inventoryAssyData) {
QueryWrapper<InventoryAssyData> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(inventoryAssyData);
return super.list(queryWrapper);
}
@Override
public void saveOrUpdateInventoryData(String inventoryBo, String dataField, String dataAttr) {
Map<String, Object> map = new HashMap<>();
map.put(InventoryAssyData.INVENTORY_BO, inventoryBo);
List<InventoryAssyData> list = inventoryAssyDataMapper.selectByMap(map);
if (list == null || list.size() <= 0) {
Long sequence = new Long(10);
InventoryAssyData inventoryData = new InventoryAssyData();
inventoryData.setHandle("InventoryAssyDataBO:" + inventoryBo + "," + dataField);
inventoryData.setInventoryBo(inventoryBo);
inventoryData.setSequence(sequence);
inventoryData.setDataField(dataField);
inventoryData.setDataAttr(dataAttr);
this.save(inventoryData);
} else {
Boolean isExist = false;
for (int i = 0; i < list.size(); i++) {
InventoryAssyData inventoryAssyData = list.get(i);
if (dataField.equals(inventoryAssyData.getDataField())) {
inventoryAssyData.setDataAttr(dataAttr);
this.updateById(inventoryAssyData);
isExist = true; break;
}
}
if (!isExist) {
Long sequence = new Long(list.size()+1);
InventoryAssyData inventoryData = new InventoryAssyData();
inventoryData.setHandle("InventoryAssyDataBO:" + inventoryBo + "," + dataField);
inventoryData.setInventoryBo(inventoryBo);
inventoryData.setSequence(sequence);
inventoryData.setDataField(dataField);
inventoryData.setDataAttr(dataAttr);
this.save(inventoryData);
}
}
}
}

@ -0,0 +1,290 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.foreverwin.mesnac.meapi.mapper.InventoryAssyDataMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.meapi.model.InventoryAssyData">
<result column="HANDLE" property="handle" />
<result column="INVENTORY_BO" property="inventoryBo" />
<result column="SEQUENCE" property="sequence" />
<result column="DATA_FIELD" property="dataField" />
<result column="DATA_ATTR" property="dataAttr" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
HANDLE, INVENTORY_BO, SEQUENCE, DATA_FIELD, DATA_ATTR
</sql>
<!-- BaseMapper标准查询/修改/删除 -->
<select id="selectByMap" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM INVENTORY_ASSY_DATA
<if test="cm!=null and !cm.isEmpty">
<where>
<foreach collection="cm.keys" item="k" separator="AND">
<if test="cm[k] != null">
${k} = #{cm[${k}]}
</if>
</foreach>
</where>
</if>
</select>
<select id="selectOne" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM INVENTORY_ASSY_DATA
<where>
<if test="ew.entity.handle!=null">
HANDLE=#{ew.handle}
</if>
<if test="ew.entity.inventoryBo!=null"> AND INVENTORY_BO=#{ew.entity.inventoryBo}</if>
<if test="ew.entity.sequence!=null"> AND SEQUENCE=#{ew.entity.sequence}</if>
<if test="ew.entity.dataField!=null"> AND DATA_FIELD=#{ew.entity.dataField}</if>
<if test="ew.entity.dataAttr!=null"> AND DATA_ATTR=#{ew.entity.dataAttr}</if>
</where>
</select>
<select id="selectCount" resultType="Integer">
SELECT COUNT(1) FROM INVENTORY_ASSY_DATA
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.inventoryBo!=null"> AND INVENTORY_BO=#{ew.entity.inventoryBo}</if>
<if test="ew.entity.sequence!=null"> AND SEQUENCE=#{ew.entity.sequence}</if>
<if test="ew.entity.dataField!=null"> AND DATA_FIELD=#{ew.entity.dataField}</if>
<if test="ew.entity.dataAttr!=null"> AND DATA_ATTR=#{ew.entity.dataAttr}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectList" resultMap="BaseResultMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM INVENTORY_ASSY_DATA
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.inventoryBo!=null"> AND INVENTORY_BO=#{ew.entity.inventoryBo}</if>
<if test="ew.entity.sequence!=null"> AND SEQUENCE=#{ew.entity.sequence}</if>
<if test="ew.entity.dataField!=null"> AND DATA_FIELD=#{ew.entity.dataField}</if>
<if test="ew.entity.dataAttr!=null"> AND DATA_ATTR=#{ew.entity.dataAttr}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectMaps" resultType="HashMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM INVENTORY_ASSY_DATA
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.inventoryBo!=null"> AND INVENTORY_BO=#{ew.entity.inventoryBo}</if>
<if test="ew.entity.sequence!=null"> AND SEQUENCE=#{ew.entity.sequence}</if>
<if test="ew.entity.dataField!=null"> AND DATA_FIELD=#{ew.entity.dataField}</if>
<if test="ew.entity.dataAttr!=null"> AND DATA_ATTR=#{ew.entity.dataAttr}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectObjs" resultType="Object">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM INVENTORY_ASSY_DATA
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.inventoryBo!=null"> AND INVENTORY_BO=#{ew.entity.inventoryBo}</if>
<if test="ew.entity.sequence!=null"> AND SEQUENCE=#{ew.entity.sequence}</if>
<if test="ew.entity.dataField!=null"> AND DATA_FIELD=#{ew.entity.dataField}</if>
<if test="ew.entity.dataAttr!=null"> AND DATA_ATTR=#{ew.entity.dataAttr}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectPage" resultMap="BaseResultMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM INVENTORY_ASSY_DATA
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.inventoryBo!=null"> AND INVENTORY_BO=#{ew.entity.inventoryBo}</if>
<if test="ew.entity.sequence!=null"> AND SEQUENCE=#{ew.entity.sequence}</if>
<if test="ew.entity.dataField!=null"> AND DATA_FIELD=#{ew.entity.dataField}</if>
<if test="ew.entity.dataAttr!=null"> AND DATA_ATTR=#{ew.entity.dataAttr}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectMapsPage" resultType="HashMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM INVENTORY_ASSY_DATA
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.inventoryBo!=null"> AND INVENTORY_BO=#{ew.entity.inventoryBo}</if>
<if test="ew.entity.sequence!=null"> AND SEQUENCE=#{ew.entity.sequence}</if>
<if test="ew.entity.dataField!=null"> AND DATA_FIELD=#{ew.entity.dataField}</if>
<if test="ew.entity.dataAttr!=null"> AND DATA_ATTR=#{ew.entity.dataAttr}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<insert id="insert" parameterType="com.foreverwin.mesnac.meapi.model.InventoryAssyData">
INSERT INTO INVENTORY_ASSY_DATA
<trim prefix="(" suffix=")" suffixOverrides=",">
HANDLE,
<if test="inventoryBo!=null">INVENTORY_BO,</if>
<if test="sequence!=null">SEQUENCE,</if>
<if test="dataField!=null">DATA_FIELD,</if>
<if test="dataAttr!=null">DATA_ATTR,</if>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
<if test="inventoryBo!=null">#{inventoryBo},</if>
<if test="sequence!=null">#{sequence},</if>
<if test="dataField!=null">#{dataField},</if>
<if test="dataAttr!=null">#{dataAttr},</if>
</trim>
</insert>
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.meapi.model.InventoryAssyData">
INSERT INTO INVENTORY_ASSY_DATA
<trim prefix="(" suffix=")" suffixOverrides=",">
<include refid="Base_Column_List"></include>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
#{inventoryBo},
#{sequence},
#{dataField},
#{dataAttr},
</trim>
</insert>
<update id="update">
UPDATE INVENTORY_ASSY_DATA <trim prefix="SET" suffixOverrides=",">
<if test="et.handle!=null">HANDLE=#{et.handle},</if>
<if test="et.inventoryBo!=null">INVENTORY_BO=#{et.inventoryBo},</if>
<if test="et.sequence!=null">SEQUENCE=#{et.sequence},</if>
<if test="et.dataField!=null">DATA_FIELD=#{et.dataField},</if>
<if test="et.dataAttr!=null">DATA_ATTR=#{et.dataAttr},</if>
</trim>
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
HANDLE=#{ew.entity.handle}
<if test="ew.entity.inventoryBo!=null"> AND INVENTORY_BO=#{ew.entity.inventoryBo}</if>
<if test="ew.entity.sequence!=null"> AND SEQUENCE=#{ew.entity.sequence}</if>
<if test="ew.entity.dataField!=null"> AND DATA_FIELD=#{ew.entity.dataField}</if>
<if test="ew.entity.dataAttr!=null"> AND DATA_ATTR=#{ew.entity.dataAttr}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</update>
<delete id="deleteByMap">
DELETE FROM INVENTORY_ASSY_DATA
<if test="cm!=null and !cm.isEmpty">
<where>
<foreach collection="cm.keys" item="k" separator="AND">
<if test="cm[k] != null">
${k} = #{cm[${k}]}
</if>
</foreach>
</where>
</if>
</delete>
<delete id="delete">
DELETE FROM INVENTORY_ASSY_DATA
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.inventoryBo!=null"> AND INVENTORY_BO=#{ew.entity.inventoryBo}</if>
<if test="ew.entity.sequence!=null"> AND SEQUENCE=#{ew.entity.sequence}</if>
<if test="ew.entity.dataField!=null"> AND DATA_FIELD=#{ew.entity.dataField}</if>
<if test="ew.entity.dataAttr!=null"> AND DATA_ATTR=#{ew.entity.dataAttr}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</delete>
<!-- BaseMapper标准查询/修改/删除 -->
</mapper>
Loading…
Cancel
Save