Commit bf01d28c by zhanglt

盘盈入库,物资盘亏代码

parent aa2ec242
...@@ -14,6 +14,18 @@ public class StaticNumSeq { ...@@ -14,6 +14,18 @@ public class StaticNumSeq {
* 购置备案 * 购置备案
* */ * */
public final static String GZBA = "GZBA"; public final static String GZBA = "GZBA";
/**
* 领用单号
* */
public final static String LYDH = "LYDH";
/**
* 出库单号
* */
public final static String CKDH = "CKDH";
/**
* 出库单号
* */
public final static String PKDH = "PKDH";
public static List<String> seqList(){ public static List<String> seqList(){
List<String> seqList = new ArrayList<>(); List<String> seqList = new ArrayList<>();
......
...@@ -9,7 +9,7 @@ import com.google.common.collect.Lists; ...@@ -9,7 +9,7 @@ import com.google.common.collect.Lists;
import com.jeeplus.core.persistence.DataEntity; import com.jeeplus.core.persistence.DataEntity;
import com.jeeplus.common.utils.excel.annotation.ExcelField; import com.jeeplus.common.utils.excel.annotation.ExcelField;
import javax.xml.crypto.Data; import java.util.Date;
/** /**
* 物资盘亏记录Entity * 物资盘亏记录Entity
...@@ -21,7 +21,7 @@ public class MaterialLoss extends DataEntity<MaterialLoss> { ...@@ -21,7 +21,7 @@ public class MaterialLoss extends DataEntity<MaterialLoss> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private String number; // 盘亏单号 private String number; // 盘亏单号
private String operator; // 操作人 private String operator; // 操作人
private Data time; // 盘亏时间 private Date time; // 盘亏时间
private String beginTime; // 开始 盘亏时间 private String beginTime; // 开始 盘亏时间
private String endTime; // 结束 盘亏时间 private String endTime; // 结束 盘亏时间
private List<MaterialLossInfo> materialLossInfoList = Lists.newArrayList(); // 子表列表 private List<MaterialLossInfo> materialLossInfoList = Lists.newArrayList(); // 子表列表
...@@ -53,11 +53,11 @@ public class MaterialLoss extends DataEntity<MaterialLoss> { ...@@ -53,11 +53,11 @@ public class MaterialLoss extends DataEntity<MaterialLoss> {
} }
@ExcelField(title="盘亏时间", align=2, sort=3) @ExcelField(title="盘亏时间", align=2, sort=3)
public Data getTime() { public Date getTime() {
return time; return time;
} }
public void setTime(Data time) { public void setTime(Date time) {
this.time = time; this.time = time;
} }
......
...@@ -3,8 +3,18 @@ ...@@ -3,8 +3,18 @@
*/ */
package com.jeeplus.modules.warehouse.materialloss.service; package com.jeeplus.modules.warehouse.materialloss.service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Objects;
import com.jeeplus.modules.warehouse.code.util.CodeUtil;
import com.jeeplus.modules.warehouse.code.util.StaticNumSeq;
import com.jeeplus.modules.warehouse.materialrequisition.entity.MaterialRequisition;
import com.jeeplus.modules.warehouse.materialrequisition.entity.MaterialRequisitionInfo;
import com.jeeplus.modules.warehouse.outbound.entity.Outbound;
import com.jeeplus.modules.warehouse.outbound.entity.OutboundInfo;
import com.jeeplus.modules.warehouse.outbound.service.OutboundService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -28,7 +38,9 @@ public class MaterialLossService extends CrudService<MaterialLossMapper, Materia ...@@ -28,7 +38,9 @@ public class MaterialLossService extends CrudService<MaterialLossMapper, Materia
@Autowired @Autowired
private MaterialLossInfoMapper materialLossInfoMapper; private MaterialLossInfoMapper materialLossInfoMapper;
@Autowired
private OutboundService outboundService;
public MaterialLoss get(String id) { public MaterialLoss get(String id) {
MaterialLoss materialLoss = super.get(id); MaterialLoss materialLoss = super.get(id);
materialLoss.setMaterialLossInfoList(materialLossInfoMapper.findList(new MaterialLossInfo(materialLoss))); materialLoss.setMaterialLossInfoList(materialLossInfoMapper.findList(new MaterialLossInfo(materialLoss)));
...@@ -71,5 +83,45 @@ public class MaterialLossService extends CrudService<MaterialLossMapper, Materia ...@@ -71,5 +83,45 @@ public class MaterialLossService extends CrudService<MaterialLossMapper, Materia
super.delete(materialLoss); super.delete(materialLoss);
materialLossInfoMapper.delete(new MaterialLossInfo(materialLoss)); materialLossInfoMapper.delete(new MaterialLossInfo(materialLoss));
} }
@Transactional(readOnly = false)
public String createLYDH() {
String pkdh = CodeUtil.code("PKDH", StaticNumSeq.PKDH);
return pkdh;
}
//物资盘亏后生成 对应的 出库记录
@Transactional(readOnly = false)
public void delivery(MaterialLoss materialLoss) {
if(materialLoss.getNumber() == null || Objects.equals(materialLoss.getNumber(), "")){
materialLoss.setNumber(this.createLYDH());
}
this.save(materialLoss);
Outbound outbound = new Outbound();
//设置相关表单id为物资盘亏主表的ID
outbound.setRelationId(materialLoss.getId());
//查询当前记录是否已经出库
List<Outbound> list = outboundService.findList(outbound);
if(list != null && list.size()>0){
return;
}
//设置当 前的操作人 与 发放物资的操作人相同
outbound.setOperator(materialLoss.getOperator());
//当前出库时间
outbound.setOutboundTime(new Date());
//出库类型为 领用出库
outbound.setType("2");
List<OutboundInfo> outboundInfoList = new ArrayList<>();
List<MaterialLossInfo> materialLossInfoList = materialLoss.getMaterialLossInfoList();
for (MaterialLossInfo one:materialLossInfoList) {
OutboundInfo outboundInfo = new OutboundInfo();
String ledgerInfoId = one.getLedgerInfo().getId();
String sql = "UPDATE t_wh_ledger_info SET del_flag = 1 WHERE id = " + ledgerInfoId ;
outboundInfo.setId("");
outboundInfo.setOutbound(outbound);
outboundInfo.setLedgerInfo(one.getLedgerInfo());
outboundInfoList.add(outboundInfo);
this.executeUpdateSql(sql);
}
outbound.setOutboundInfoList(outboundInfoList);
outboundService.save(outbound);
}
} }
\ No newline at end of file
...@@ -109,7 +109,8 @@ public class MaterialLossController extends BaseController { ...@@ -109,7 +109,8 @@ public class MaterialLossController extends BaseController {
return j; return j;
} }
//新增或编辑表单保存 //新增或编辑表单保存
materialLossService.save(materialLoss);//保存 // materialLossService.save(materialLoss);//保存
materialLossService.delivery(materialLoss);//保存
j.setSuccess(true); j.setSuccess(true);
j.setMsg("保存物资盘亏记录成功"); j.setMsg("保存物资盘亏记录成功");
return j; return j;
...@@ -228,6 +229,29 @@ public class MaterialLossController extends BaseController { ...@@ -228,6 +229,29 @@ public class MaterialLossController extends BaseController {
} }
return j; return j;
} }
/**
* 保存物资盘亏记录
*/
@ResponseBody
@RequiresPermissions(value={"warehouse:materialloss:materialLoss:add","warehouse:materialloss:materialLoss:edit"},logical=Logical.OR)
@RequestMapping(value = "delivery")
public AjaxJson delivery(MaterialLoss materialLoss, Model model) throws Exception{
AjaxJson j = new AjaxJson();
/**
* 后台hibernate-validation插件校验
*/
String errMsg = beanValidator(materialLoss);
if (StringUtils.isNotBlank(errMsg)){
j.setSuccess(false);
j.setMsg(errMsg);
return j;
}
//新增或编辑表单保存
// materialLossService.save(materialLoss);//保存
materialLossService.delivery(materialLoss);//保存
j.setSuccess(true);
j.setMsg("保存物资盘亏记录成功");
return j;
}
} }
\ No newline at end of file
...@@ -22,7 +22,7 @@ public class MaterialRequisition extends DataEntity<MaterialRequisition> { ...@@ -22,7 +22,7 @@ public class MaterialRequisition extends DataEntity<MaterialRequisition> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private String number; // 领用单号 private String number; // 领用单号
private String operator; // 操作人 private String operator; // 操作人
private String receiver; // 领用人 // private String receiver; // 领用人
private Office office; // 领用机构 private Office office; // 领用机构
private Date time; // 领用时间 private Date time; // 领用时间
private List<MaterialRequisitionInfo> materialRequisitionInfoList = Lists.newArrayList(); // 子表列表 private List<MaterialRequisitionInfo> materialRequisitionInfoList = Lists.newArrayList(); // 子表列表
...@@ -52,15 +52,7 @@ public class MaterialRequisition extends DataEntity<MaterialRequisition> { ...@@ -52,15 +52,7 @@ public class MaterialRequisition extends DataEntity<MaterialRequisition> {
public void setOperator(String operator) { public void setOperator(String operator) {
this.operator = operator; this.operator = operator;
} }
@ExcelField(title="领用人", align=2, sort=3)
public String getReceiver() {
return receiver;
}
public void setReceiver(String receiver) {
this.receiver = receiver;
}
@ExcelField(title="领用机构", fieldType=Office.class, value="", align=2, sort=4) @ExcelField(title="领用机构", fieldType=Office.class, value="", align=2, sort=4)
public Office getOffice() { public Office getOffice() {
......
...@@ -17,6 +17,7 @@ public class MaterialRequisitionInfo extends DataEntity<MaterialRequisitionInfo> ...@@ -17,6 +17,7 @@ public class MaterialRequisitionInfo extends DataEntity<MaterialRequisitionInfo>
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private MaterialRequisition materialRequisition; // 物资领用主表ID private MaterialRequisition materialRequisition; // 物资领用主表ID
private String receiver; // 领用人
private LedgerInfo ledgerInfo; // 物资台账明细ID private LedgerInfo ledgerInfo; // 物资台账明细ID
public MaterialRequisitionInfo() { public MaterialRequisitionInfo() {
...@@ -44,6 +45,14 @@ public class MaterialRequisitionInfo extends DataEntity<MaterialRequisitionInfo> ...@@ -44,6 +45,14 @@ public class MaterialRequisitionInfo extends DataEntity<MaterialRequisitionInfo>
public LedgerInfo getLedgerInfo() { public LedgerInfo getLedgerInfo() {
return ledgerInfo; return ledgerInfo;
} }
@ExcelField(title="领用人", align=2, sort=3)
public String getReceiver() {
return receiver;
}
public void setReceiver(String receiver) {
this.receiver = receiver;
}
public void setLedgerInfo(LedgerInfo ledgerInfo) { public void setLedgerInfo(LedgerInfo ledgerInfo) {
this.ledgerInfo = ledgerInfo; this.ledgerInfo = ledgerInfo;
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
a.id AS "id", a.id AS "id",
a.material_requisition_id AS "materialRequisition.id", a.material_requisition_id AS "materialRequisition.id",
a.ledger_info_id AS "ledgerInfo.id", a.ledger_info_id AS "ledgerInfo.id",
a.receiver AS "receiver",
a.create_by AS "createBy.id", a.create_by AS "createBy.id",
a.create_date AS "createDate", a.create_date AS "createDate",
a.update_by AS "updateBy.id", a.update_by AS "updateBy.id",
...@@ -76,6 +77,7 @@ ...@@ -76,6 +77,7 @@
INSERT INTO t_wh_material_requisition_info( INSERT INTO t_wh_material_requisition_info(
id, id,
material_requisition_id, material_requisition_id,
receiver,
ledger_info_id, ledger_info_id,
create_by, create_by,
create_date, create_date,
...@@ -86,6 +88,7 @@ ...@@ -86,6 +88,7 @@
) VALUES ( ) VALUES (
#{id}, #{id},
#{materialRequisition.id}, #{materialRequisition.id},
#{receiver},
#{ledgerInfo.id}, #{ledgerInfo.id},
#{createBy.id}, #{createBy.id},
#{createDate}, #{createDate},
...@@ -100,6 +103,7 @@ ...@@ -100,6 +103,7 @@
UPDATE t_wh_material_requisition_info SET UPDATE t_wh_material_requisition_info SET
material_requisition_id = #{materialRequisition.id}, material_requisition_id = #{materialRequisition.id},
ledger_info_id = #{ledgerInfo.id}, ledger_info_id = #{ledgerInfo.id},
receiver = #{receiver},
update_by = #{updateBy.id}, update_by = #{updateBy.id},
update_date = #{updateDate}, update_date = #{updateDate},
remarks = #{remarks} remarks = #{remarks}
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
a.id AS "id", a.id AS "id",
a.number AS "number", a.number AS "number",
a.operator AS "operator", a.operator AS "operator",
a.receiver AS "receiver",
a.collecting_office_id AS "office.id", a.collecting_office_id AS "office.id",
a.time AS "time", a.time AS "time",
a.create_by AS "createBy.id", a.create_by AS "createBy.id",
...@@ -46,9 +45,6 @@ ...@@ -46,9 +45,6 @@
<if test="operator != null and operator != ''"> <if test="operator != null and operator != ''">
AND a.operator = #{operator} AND a.operator = #{operator}
</if> </if>
<if test="receiver != null and receiver != ''">
AND a.receiver = #{receiver}
</if>
</where> </where>
<choose> <choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''"> <when test="page !=null and page.orderBy != null and page.orderBy != ''">
...@@ -84,7 +80,6 @@ ...@@ -84,7 +80,6 @@
id, id,
number, number,
operator, operator,
receiver,
collecting_office_id, collecting_office_id,
time, time,
create_by, create_by,
...@@ -97,7 +92,6 @@ ...@@ -97,7 +92,6 @@
#{id}, #{id},
#{number}, #{number},
#{operator}, #{operator},
#{receiver},
#{office.id}, #{office.id},
#{time}, #{time},
#{createBy.id}, #{createBy.id},
...@@ -113,7 +107,6 @@ ...@@ -113,7 +107,6 @@
UPDATE t_wh_material_requisition SET UPDATE t_wh_material_requisition SET
number = #{number}, number = #{number},
operator = #{operator}, operator = #{operator},
receiver = #{receiver},
collecting_office_id = #{office.id}, collecting_office_id = #{office.id},
time = #{time}, time = #{time},
update_by = #{updateBy.id}, update_by = #{updateBy.id},
......
...@@ -3,8 +3,16 @@ ...@@ -3,8 +3,16 @@
*/ */
package com.jeeplus.modules.warehouse.materialrequisition.service; package com.jeeplus.modules.warehouse.materialrequisition.service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Objects;
import com.jeeplus.modules.warehouse.code.util.CodeUtil;
import com.jeeplus.modules.warehouse.code.util.StaticNumSeq;
import com.jeeplus.modules.warehouse.outbound.entity.Outbound;
import com.jeeplus.modules.warehouse.outbound.entity.OutboundInfo;
import com.jeeplus.modules.warehouse.outbound.service.OutboundService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -28,6 +36,9 @@ public class MaterialRequisitionService extends CrudService<MaterialRequisitionM ...@@ -28,6 +36,9 @@ public class MaterialRequisitionService extends CrudService<MaterialRequisitionM
@Autowired @Autowired
private MaterialRequisitionInfoMapper materialRequisitionInfoMapper; private MaterialRequisitionInfoMapper materialRequisitionInfoMapper;
@Autowired
private OutboundService outboundService;
public MaterialRequisition get(String id) { public MaterialRequisition get(String id) {
MaterialRequisition materialRequisition = super.get(id); MaterialRequisition materialRequisition = super.get(id);
...@@ -70,5 +81,49 @@ public class MaterialRequisitionService extends CrudService<MaterialRequisitionM ...@@ -70,5 +81,49 @@ public class MaterialRequisitionService extends CrudService<MaterialRequisitionM
super.delete(materialRequisition); super.delete(materialRequisition);
materialRequisitionInfoMapper.delete(new MaterialRequisitionInfo(materialRequisition)); materialRequisitionInfoMapper.delete(new MaterialRequisitionInfo(materialRequisition));
} }
@Transactional(readOnly = false)
public String createLYDH() {
String lydh = CodeUtil.code("LYDH", StaticNumSeq.LYDH);
return lydh;
}
//物资领用后生成 对应的 出库记录
@Transactional(readOnly = false)
public void delivery(MaterialRequisition materialRequisition) {
if(materialRequisition.getNumber() == null &&Objects.equals(materialRequisition.getNumber(), "")){
materialRequisition.setNumber(this.createLYDH());
}
this.save(materialRequisition);
Outbound outbound = new Outbound();
//设置相关表单id为领用主表的ID
outbound.setRelationId(materialRequisition.getId());
//查询当前记录是否已经出库
List<Outbound> list = outboundService.findList(outbound);
if(list != null && list.size()>0){
return;
}
//设置当 前的操作人 与 发放物资的操作人相同
outbound.setOperator(materialRequisition.getOperator());
//当前出库时间
outbound.setOutboundTime(new Date());
//出库类型为 领用出库
outbound.setType("1");
List<OutboundInfo> outboundInfoList = new ArrayList<>();
List<MaterialRequisitionInfo> materialRequisitionInfoList = materialRequisition.getMaterialRequisitionInfoList();
if(materialRequisitionInfoList != null ){
for (MaterialRequisitionInfo one:materialRequisitionInfoList) {
OutboundInfo outboundInfo = new OutboundInfo();
String ledgerInfoId = one.getLedgerInfo().getId();
String sql = "UPDATE t_wh_ledger_info SET del_flag = 1 WHERE id = " + ledgerInfoId ;
outboundInfo.setId("");
outboundInfo.setOutbound(outbound);
outboundInfo.setLedgerInfo(one.getLedgerInfo());
outboundInfoList.add(outboundInfo);
this.executeUpdateSql(sql);
}
outbound.setOutboundInfoList(outboundInfoList);
outboundService.save(outbound);
}
}
} }
\ No newline at end of file
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
*/ */
package com.jeeplus.modules.warehouse.materialrequisition.web; package com.jeeplus.modules.warehouse.materialrequisition.web;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -10,6 +11,8 @@ import javax.servlet.http.HttpServletRequest; ...@@ -10,6 +11,8 @@ 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.entity.User;
import com.jeeplus.modules.sys.service.SystemService;
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;
...@@ -46,6 +49,9 @@ public class MaterialRequisitionController extends BaseController { ...@@ -46,6 +49,9 @@ public class MaterialRequisitionController extends BaseController {
@Autowired @Autowired
private MaterialRequisitionService materialRequisitionService; private MaterialRequisitionService materialRequisitionService;
@Autowired
private SystemService systemService;
@ModelAttribute @ModelAttribute
public MaterialRequisition get(@RequestParam(required=false) String id) { public MaterialRequisition get(@RequestParam(required=false) String id) {
...@@ -109,7 +115,9 @@ public class MaterialRequisitionController extends BaseController { ...@@ -109,7 +115,9 @@ public class MaterialRequisitionController extends BaseController {
return j; return j;
} }
//新增或编辑表单保存 //新增或编辑表单保存
materialRequisitionService.save(materialRequisition);//保存 // materialRequisitionService.save(materialRequisition);//保存
materialRequisitionService.delivery(materialRequisition);
j.setSuccess(true); j.setSuccess(true);
j.setMsg("保存物资领用成功"); j.setMsg("保存物资领用成功");
return j; return j;
...@@ -228,6 +236,46 @@ public class MaterialRequisitionController extends BaseController { ...@@ -228,6 +236,46 @@ public class MaterialRequisitionController extends BaseController {
} }
return j; return j;
} }
/**
* 生成对应的 出库记录 领用后出库
*/
@ResponseBody
@RequiresPermissions(value={"warehouse:materialrequisition:materialRequisition:add","warehouse:materialrequisition:materialRequisition:edit"},logical=Logical.OR)
@RequestMapping(value = "delivery")
public AjaxJson delivery(MaterialRequisition materialRequisition, Model model) throws Exception{
AjaxJson j = new AjaxJson();
/**
* 后台hibernate-validation插件校验
*/
String errMsg = beanValidator(materialRequisition);
if (StringUtils.isNotBlank(errMsg)){
j.setSuccess(false);
j.setMsg(errMsg);
return j;
}
//新增或编辑表单保存
// materialRequisitionService.save(materialRequisition);//保存
materialRequisitionService.delivery(materialRequisition);
j.setSuccess(true);
j.setMsg("保存物资领用成功");
return j;
}
/**
* 获取 领用机构下的 所有用户
*/
@ResponseBody
@RequestMapping(value = "getUserListByOfficeId")
public List<User> getUserListByOfficeId(String officeId) throws Exception{
/**
* 后台hibernate-validation插件校验
*/
List<User> list = new ArrayList<>();
if (StringUtils.isBlank(officeId)){
return list;
}
list = systemService.findUserByOfficeId(officeId);
return list;
}
} }
\ No newline at end of file
...@@ -4,7 +4,10 @@ ...@@ -4,7 +4,10 @@
package com.jeeplus.modules.warehouse.outbound.service; package com.jeeplus.modules.warehouse.outbound.service;
import java.util.List; import java.util.List;
import java.util.Objects;
import com.jeeplus.modules.warehouse.code.util.CodeUtil;
import com.jeeplus.modules.warehouse.code.util.StaticNumSeq;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -45,6 +48,9 @@ public class OutboundService extends CrudService<OutboundMapper, Outbound> { ...@@ -45,6 +48,9 @@ public class OutboundService extends CrudService<OutboundMapper, Outbound> {
@Transactional(readOnly = false) @Transactional(readOnly = false)
public void save(Outbound outbound) { public void save(Outbound outbound) {
if(outbound.getNumber() == null || Objects.equals(outbound.getNumber(), "")){
outbound.setNumber(this.createCKDH());
}
super.save(outbound); super.save(outbound);
for (OutboundInfo outboundInfo : outbound.getOutboundInfoList()){ for (OutboundInfo outboundInfo : outbound.getOutboundInfoList()){
if (outboundInfo.getId() == null){ if (outboundInfo.getId() == null){
...@@ -66,7 +72,11 @@ public class OutboundService extends CrudService<OutboundMapper, Outbound> { ...@@ -66,7 +72,11 @@ public class OutboundService extends CrudService<OutboundMapper, Outbound> {
} }
} }
} }
@Transactional(readOnly = false)
public String createCKDH() {
String ckdh = CodeUtil.code("CKDH", StaticNumSeq.CKDH);
return ckdh;
}
@Transactional(readOnly = false) @Transactional(readOnly = false)
public void delete(Outbound outbound) { public void delete(Outbound outbound) {
super.delete(outbound); super.delete(outbound);
......
...@@ -10,6 +10,8 @@ import javax.servlet.http.HttpServletRequest; ...@@ -10,6 +10,8 @@ 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.warehouse.warehouse.entity.Warehouse;
import com.jeeplus.modules.warehouse.warehouse.service.WarehouseService;
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;
...@@ -46,7 +48,9 @@ public class ShelvesController extends BaseController { ...@@ -46,7 +48,9 @@ public class ShelvesController extends BaseController {
@Autowired @Autowired
private ShelvesService shelvesService; private ShelvesService shelvesService;
@Autowired
private WarehouseService warehouseService;
@ModelAttribute @ModelAttribute
public Shelves get(@RequestParam(required=false) String id) { public Shelves get(@RequestParam(required=false) String id) {
Shelves entity = null; Shelves entity = null;
...@@ -66,6 +70,9 @@ public class ShelvesController extends BaseController { ...@@ -66,6 +70,9 @@ public class ShelvesController extends BaseController {
@RequestMapping(value = {"list", ""}) @RequestMapping(value = {"list", ""})
public String list(Shelves shelves, Model model) { public String list(Shelves shelves, Model model) {
model.addAttribute("shelves", shelves); model.addAttribute("shelves", shelves);
Warehouse warehouse = new Warehouse();
List<Warehouse> warehouseList = warehouseService.findList(warehouse);
model.addAttribute("warehouseList", warehouseList);
return "modules/warehouse/shelves/shelvesList"; return "modules/warehouse/shelves/shelvesList";
} }
...@@ -87,6 +94,9 @@ public class ShelvesController extends BaseController { ...@@ -87,6 +94,9 @@ public class ShelvesController extends BaseController {
@RequestMapping(value = "form/{mode}") @RequestMapping(value = "form/{mode}")
public String form(@PathVariable String mode, Shelves shelves, Model model) { public String form(@PathVariable String mode, Shelves shelves, Model model) {
model.addAttribute("shelves", shelves); model.addAttribute("shelves", shelves);
Warehouse warehouse = new Warehouse();
List<Warehouse> warehouseList = warehouseService.findList(warehouse);
model.addAttribute("warehouseList", warehouseList);
model.addAttribute("mode", mode); model.addAttribute("mode", mode);
return "modules/warehouse/shelves/shelvesForm"; return "modules/warehouse/shelves/shelvesForm";
} }
......
...@@ -85,16 +85,11 @@ ...@@ -85,16 +85,11 @@
<form:input path="operator" htmlEscape="false" class="form-control "/> <form:input path="operator" htmlEscape="false" class="form-control "/>
</div> </div>
</div> </div>
<div class="form-group">
<label class="col-sm-2 control-label">领用人:</label>
<div class="col-sm-10">
<form:input path="receiver" htmlEscape="false" class="form-control "/>
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-2 control-label">领用机构:</label> <label class="col-sm-2 control-label">领用机构:</label>
<div class="col-sm-10"> <div class="col-sm-10">
<sys:treeselect id="office" name="office.id" value="${materialRequisition.office.id}" labelName="" labelValue="${materialRequisition.office.id}" <sys:treeselect id="office" name="office.id" value="${materialRequisition.office.id}" labelName="" labelValue="${materialRequisition.office.name}"
title="部门" url="/sys/office/treeData?type=2" cssClass="form-control " allowClear="true" notAllowSelectParent="true"/> title="部门" url="/sys/office/treeData?type=2" cssClass="form-control " allowClear="true" notAllowSelectParent="true"/>
</div> </div>
</div> </div>
...@@ -129,6 +124,7 @@ ...@@ -129,6 +124,7 @@
<th class="hide"></th> <th class="hide"></th>
<th>物资领用主表ID</th> <th>物资领用主表ID</th>
<th>物资台账明细ID</th> <th>物资台账明细ID</th>
<th>领用人</th>
<th>备注信息</th> <th>备注信息</th>
<th width="10">&nbsp;</th> <th width="10">&nbsp;</th>
</tr> </tr>
...@@ -152,7 +148,10 @@ ...@@ -152,7 +148,10 @@
<input id="materialRequisitionInfoList{{idx}}_ledgerInfo" name="materialRequisitionInfoList[{{idx}}].ledgerInfo.id" type="text" value="{{row.ledgerInfo.id}}" class="form-control "/> <input id="materialRequisitionInfoList{{idx}}_ledgerInfo" name="materialRequisitionInfoList[{{idx}}].ledgerInfo.id" type="text" value="{{row.ledgerInfo.id}}" class="form-control "/>
</td> </td>
<td>
<input id="materialRequisitionInfoList{{idx}}_receiver" name="materialRequisitionInfoList[{{idx}}].receiver" type="text" value="{{row.receiver}}" class="form-control "/>
</td>
<td> <td>
<textarea id="materialRequisitionInfoList{{idx}}_remarks" name="materialRequisitionInfoList[{{idx}}].remarks" rows="4" class="form-control ">{{row.remarks}}</textarea> <textarea id="materialRequisitionInfoList{{idx}}_remarks" name="materialRequisitionInfoList[{{idx}}].remarks" rows="4" class="form-control ">{{row.remarks}}</textarea>
</td> </td>
......
...@@ -117,17 +117,10 @@ $(document).ready(function() { ...@@ -117,17 +117,10 @@ $(document).ready(function() {
} }
,{ ,{
field: 'receiver', field: 'office.name',
title: '领用人',
sortable: true,
sortName: 'receiver'
}
,{
field: '',
title: '领用机构', title: '领用机构',
sortable: true, sortable: true,
sortName: '' sortName: 'o.name'
} }
,{ ,{
...@@ -309,6 +302,7 @@ $(document).ready(function() { ...@@ -309,6 +302,7 @@ $(document).ready(function() {
<tr> <tr>
<th>物资领用主表ID</th> <th>物资领用主表ID</th>
<th>物资台账明细ID</th> <th>物资台账明细ID</th>
<th>领用人</th>
<th>备注信息</th> <th>备注信息</th>
</tr> </tr>
</thead> </thead>
...@@ -327,6 +321,9 @@ $(document).ready(function() { ...@@ -327,6 +321,9 @@ $(document).ready(function() {
{{row.ledgerInfo.id}} {{row.ledgerInfo.id}}
</td> </td>
<td> <td>
{{row.receiver}}
</td>
<td>
{{row.remarks}} {{row.remarks}}
</td> </td>
</tr>//--> </tr>//-->
......
...@@ -29,10 +29,6 @@ ...@@ -29,10 +29,6 @@
<label class="label-item single-overflow pull-left" title="操作人:">操作人:</label> <label class="label-item single-overflow pull-left" title="操作人:">操作人:</label>
<form:input path="operator" htmlEscape="false" maxlength="64" class=" form-control"/> <form:input path="operator" htmlEscape="false" maxlength="64" class=" form-control"/>
</div> </div>
<div class="col-xs-12 col-sm-6 col-md-4">
<label class="label-item single-overflow pull-left" title="领用人:">领用人:</label>
<form:input path="receiver" htmlEscape="false" maxlength="64" class=" form-control"/>
</div>
<div class="col-xs-12 col-sm-6 col-md-4"> <div class="col-xs-12 col-sm-6 col-md-4">
<div style="margin-top:26px"> <div style="margin-top:26px">
<a id="search" class="btn btn-primary btn-rounded btn-bordered btn-sm"><i class="fa fa-search"></i> 查询</a> <a id="search" class="btn btn-primary btn-rounded btn-bordered btn-sm"><i class="fa fa-search"></i> 查询</a>
......
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
<div class="col-sm-10"> <div class="col-sm-10">
<form:select path="type" class="form-control "> <form:select path="type" class="form-control ">
<form:option value="" label=""/> <form:option value="" label=""/>
<form:options items="${fns:getDictList('')}" itemLabel="label" itemValue="value" htmlEscape="false"/> <form:options items="${fns:getDictList('wh_delivery_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
</form:select> </form:select>
</div> </div>
</div> </div>
......
...@@ -129,7 +129,7 @@ $(document).ready(function() { ...@@ -129,7 +129,7 @@ $(document).ready(function() {
sortable: true, sortable: true,
sortName: 'type', sortName: 'type',
formatter:function(value, row , index){ formatter:function(value, row , index){
return jp.getDictLabel(${fns:toJson(fns:getDictList(''))}, value, "-"); return jp.getDictLabel(${fns:toJson(fns:getDictList('wh_delivery_type'))}, value, "-");
} }
} }
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
<label class="label-item single-overflow pull-left" title="出库分类:">出库分类:</label> <label class="label-item single-overflow pull-left" title="出库分类:">出库分类:</label>
<form:select path="type" class="form-control m-b"> <form:select path="type" class="form-control m-b">
<form:option value="" label=""/> <form:option value="" label=""/>
<form:options items="${fns:getDictList('')}" itemLabel="label" itemValue="value" htmlEscape="false"/> <form:options items="${fns:getDictList('wh_delivery_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
</form:select> </form:select>
</div> </div>
<div class="col-xs-12 col-sm-6 col-md-4"> <div class="col-xs-12 col-sm-6 col-md-4">
......
...@@ -9,7 +9,7 @@ $(document).ready(function() { ...@@ -9,7 +9,7 @@ $(document).ready(function() {
dataType: "json", dataType: "json",
contentType: "application/x-www-form-urlencoded", contentType: "application/x-www-form-urlencoded",
//显示检索按钮 //显示检索按钮
showSearch: true, showSearch: true,
//显示刷新按钮 //显示刷新按钮
showRefresh: true, showRefresh: true,
//显示切换手机试图按钮 //显示切换手机试图按钮
......
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