Commit 805a2680 by zhanglt

盘盈入库,物资盘亏相关接口调整

parent 20bbfaf0
...@@ -6,6 +6,12 @@ ...@@ -6,6 +6,12 @@
a.id AS "id", a.id AS "id",
a.material_loss_id AS "materialLoss.id", a.material_loss_id AS "materialLoss.id",
a.ledger_info_id AS "ledgerInfo.id", a.ledger_info_id AS "ledgerInfo.id",
ledgerInfo.name AS "ledgerInfo.name",
ledgerInfo.code AS "ledgerInfo.code",
ledgerInfo.type_id AS "ledgerInfo.type.id",
tpye.name AS "ledgerInfo.type.name",
ledgerInfo.model AS "ledgerInfo.model",
ledgerInfo.amount AS "ledgerInfo.amount",
a.remarks AS "remarks", a.remarks AS "remarks",
a.create_by AS "createBy.id", a.create_by AS "createBy.id",
a.create_date AS "createDate", a.create_date AS "createDate",
...@@ -16,6 +22,7 @@ ...@@ -16,6 +22,7 @@
<sql id="materialLossInfoJoins"> <sql id="materialLossInfoJoins">
left join t_wh_ledger_info ledgerInfo on a.ledger_info_id = ledgerInfo.id left join t_wh_ledger_info ledgerInfo on a.ledger_info_id = ledgerInfo.id
LEFT JOIN t_wh_material_type tpye ON ledgerInfo.type_id = tpye.id
</sql> </sql>
......
...@@ -5,11 +5,13 @@ package com.jeeplus.modules.warehouse.materialloss.web; ...@@ -5,11 +5,13 @@ package com.jeeplus.modules.warehouse.materialloss.web;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.validation.ConstraintViolationException; import javax.validation.ConstraintViolationException;
import com.jeeplus.modules.sys.utils.UserUtils;
import org.apache.shiro.authz.annotation.Logical; import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -86,6 +88,14 @@ public class MaterialLossController extends BaseController { ...@@ -86,6 +88,14 @@ public class MaterialLossController extends BaseController {
@RequiresPermissions(value={"warehouse:materialloss:materialLoss:view","warehouse:materialloss:materialLoss:add","warehouse:materialloss:materialLoss:edit"},logical=Logical.OR) @RequiresPermissions(value={"warehouse:materialloss:materialLoss:view","warehouse:materialloss:materialLoss:add","warehouse:materialloss:materialLoss:edit"},logical=Logical.OR)
@RequestMapping(value = "form/{mode}") @RequestMapping(value = "form/{mode}")
public String form(@PathVariable String mode, MaterialLoss materialLoss, Model model) { public String form(@PathVariable String mode, MaterialLoss materialLoss, Model model) {
if(mode != null && mode.equals("add")){
if(Objects.equals(materialLoss.getNumber(), "")||materialLoss.getNumber()==null){
materialLoss.setNumber(materialLossService.createPKDH());
}
if(materialLoss.getOperator() == null){
materialLoss.setOperator(UserUtils.getUser());
}
}
model.addAttribute("materialLoss", materialLoss); model.addAttribute("materialLoss", materialLoss);
model.addAttribute("mode", mode); model.addAttribute("mode", mode);
return "modules/warehouse/materialloss/materialLossForm"; return "modules/warehouse/materialloss/materialLossForm";
......
...@@ -10,9 +10,12 @@ ...@@ -10,9 +10,12 @@
a.type AS "type.id", a.type AS "type.id",
a.marking AS "marking", a.marking AS "marking",
a.shelves_id AS "shelves.id", a.shelves_id AS "shelves.id",
shelves.name AS "shelves.name",
a.warehouse_id AS "warehouse.id", a.warehouse_id AS "warehouse.id",
warehouse.name AS "warehouse.name", warehouse.name AS "warehouse.name",
a.qr_id AS "qrCode.id", a.qr_id AS "qrCode.id",
qrCode.state AS "qrCode.state",
qrCode.code AS "qrCode.code",
a.amount AS "amount", a.amount AS "amount",
a.create_by AS "createBy.id", a.create_by AS "createBy.id",
a.create_date AS "createDate", a.create_date AS "createDate",
...@@ -25,7 +28,9 @@ ...@@ -25,7 +28,9 @@
<sql id="profitWarehousingInfoJoins"> <sql id="profitWarehousingInfoJoins">
LEFT JOIN t_wh_material_type type ON type.id = a.type LEFT JOIN t_wh_material_type type ON type.id = a.type
LEFT JOIN t_wh_warehouse warehouse ON warehouse.id = a.warehouse_id LEFT JOIN t_wh_warehouse warehouse ON warehouse.id = a.warehouse_id
LEFT JOIN t_profit_warehousing profitWarehousing ON profitWarehousing.id = a.profit_warehousing_id LEFT JOIN t_wh_shelves shelves ON shelves.id = a.shelves_id
LEFT JOIN t_wh_qr qrCode ON qrCode.id = a.qr_id
LEFT JOIN t_wh_profit_warehousing profitWarehousing ON profitWarehousing.id = a.profit_warehousing_id
</sql> </sql>
......
...@@ -98,7 +98,7 @@ public class ProfitWarehousingController extends BaseController { ...@@ -98,7 +98,7 @@ public class ProfitWarehousingController extends BaseController {
@RequiresPermissions(value={"warehouse:profitwarehousing:profitWarehousing:view","warehouse:profitwarehousing:profitWarehousing:add","warehouse:profitwarehousing:profitWarehousing:edit"},logical=Logical.OR) @RequiresPermissions(value={"warehouse:profitwarehousing:profitWarehousing:view","warehouse:profitwarehousing:profitWarehousing:add","warehouse:profitwarehousing:profitWarehousing:edit"},logical=Logical.OR)
@RequestMapping(value = "form/{mode}") @RequestMapping(value = "form/{mode}")
public String form(@PathVariable String mode, ProfitWarehousing profitWarehousing, Model model) { public String form(@PathVariable String mode, ProfitWarehousing profitWarehousing, Model model) {
if(mode !=null ||Objects.equals(mode, "add")){ if(mode !=null && Objects.equals(mode, "add")){
if(profitWarehousing.getNumber()==null|| Objects.equals(profitWarehousing.getNumber(), "")){ if(profitWarehousing.getNumber()==null|| Objects.equals(profitWarehousing.getNumber(), "")){
profitWarehousing.setNumber(profitWarehousingService.createPYDH()); profitWarehousing.setNumber(profitWarehousingService.createPYDH());
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment