Commit 72168f79 by yyq1988

Merge remote-tracking branch 'origin/master'

parents a220dfb9 95997a0d
......@@ -26,6 +26,8 @@ public class MaterialRequisition extends DataEntity<MaterialRequisition> {
// private String receiver; // 领用人
private Office office; // 领用机构
private Date time; // 领用时间
private Date beginOutboundTime; // 开始 领用时间
private Date endOutboundTime; // 结束 领用时间
private List<MaterialRequisitionInfo> materialRequisitionInfoList = Lists.newArrayList(); // 子表列表
public MaterialRequisition() {
......@@ -74,6 +76,22 @@ public class MaterialRequisition extends DataEntity<MaterialRequisition> {
this.time = time;
}
public Date getBeginOutboundTime() {
return beginOutboundTime;
}
public void setBeginOutboundTime(Date beginOutboundTime) {
this.beginOutboundTime = beginOutboundTime;
}
public Date getEndOutboundTime() {
return endOutboundTime;
}
public void setEndOutboundTime(Date endOutboundTime) {
this.endOutboundTime = endOutboundTime;
}
public List<MaterialRequisitionInfo> getMaterialRequisitionInfoList() {
return materialRequisitionInfoList;
}
......
......@@ -6,18 +6,24 @@
a.id AS "id",
a.material_requisition_id AS "materialRequisition.id",
a.ledger_info_id AS "ledgerInfo.id",
a.receiver AS "receiver.id",
a.create_by AS "createBy.id",
a.create_date AS "createDate",
a.update_by AS "updateBy.id",
a.update_date AS "updateDate",
a.remarks AS "remarks",
a.del_flag AS "delFlag",
ledgerInfo.name AS "ledgerInfo.name",
ledgerInfo.code AS "ledgerInfo.code",
ledgerInfo.type_id AS "ledgerInfo.typeId",
ledgerInfo.model AS "ledgerInfo.model",
ledgerInfo.amount AS "ledgerInfo.amount",
a.remarks AS "remarks",
a.receiver AS "receiver.id",
receiver.name AS "receiver.name"
</sql>
<sql id="materialRequisitionInfoJoins">
LEFT JOIN sys_user receiver ON receiver.id = a.receiver
LEFT JOIN t_wh_ledger_info ledgerInfo ON ledgerInfo.id = a.ledger_info_id
</sql>
......
......@@ -46,6 +46,13 @@
<if test="operator != null and operator.id != null and operator.id != ''">
AND a.operator = #{operator.id}
</if>
<if test="beginOutboundTime != null and endOutboundTime != null ">
AND a.time BETWEEN #{beginOutboundTime} AND #{endOutboundTime}
</if>
<if test="office != null and office.id != null and office.id != ''">
AND a.collecting_office_id = #{office.id}
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
......
......@@ -261,21 +261,5 @@ public class MaterialRequisitionController extends BaseController {
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
......@@ -11,6 +11,11 @@
a.update_by AS "updateBy.id",
a.update_date AS "updateDate",
a.remarks AS "remarks",
ledgerInfo.name AS "ledgerInfo.name",
ledgerInfo.code AS "ledgerInfo.code",
ledgerInfo.type_id AS "ledgerInfo.typeId",
ledgerInfo.model AS "ledgerInfo.model",
ledgerInfo.amount AS "ledgerInfo.amount",
a.del_flag AS "delFlag"
</sql>
......
......@@ -3,6 +3,7 @@
*/
package com.jeeplus.modules.warehouse.profitwarehousing.entity;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.List;
......@@ -10,6 +11,7 @@ import com.google.common.collect.Lists;
import com.jeeplus.core.persistence.DataEntity;
import com.jeeplus.common.utils.excel.annotation.ExcelField;
import com.jeeplus.modules.sys.entity.User;
/**
* 盘盈入库单Entity
......@@ -20,10 +22,11 @@ public class ProfitWarehousing extends DataEntity<ProfitWarehousing> {
private static final long serialVersionUID = 1L;
private String number; // 盘盈入库单号
private String operator; // 操作人
private User operator; // 操作人
private Date time; // 时间
private Date beginTime; // 开始 时间
private Date endTime; // 结束 时间
private BigDecimal sum; // 总价
private List<ProfitWarehousingInfo> profitWarehousingInfoList = Lists.newArrayList(); // 子表列表
public ProfitWarehousing() {
......@@ -44,11 +47,11 @@ public class ProfitWarehousing extends DataEntity<ProfitWarehousing> {
}
@ExcelField(title="操作人", align=2, sort=2)
public String getOperator() {
public User getOperator() {
return operator;
}
public void setOperator(String operator) {
public void setOperator(User operator) {
this.operator = operator;
}
......@@ -57,6 +60,14 @@ public class ProfitWarehousing extends DataEntity<ProfitWarehousing> {
public Date getTime() {
return time;
}
@ExcelField(title="总价", align=2, sort=4)
public BigDecimal getSum() {
return sum;
}
public void setSum(BigDecimal sum) {
this.sum = sum;
}
public void setTime(Date time) {
this.time = time;
......
......@@ -3,10 +3,17 @@
*/
package com.jeeplus.modules.warehouse.profitwarehousing.entity;
import com.jeeplus.modules.warehouse.materialtype.entity.MaterialType;
import com.jeeplus.modules.warehouse.outbound.entity.Outbound;
import com.jeeplus.modules.warehouse.qrcode.entity.QrCode;
import com.jeeplus.modules.warehouse.shelves.entity.Shelves;
import com.jeeplus.core.persistence.DataEntity;
import com.jeeplus.common.utils.excel.annotation.ExcelField;
import com.jeeplus.modules.warehouse.storage.entity.Storage;
import com.jeeplus.modules.warehouse.warehouse.entity.Warehouse;
import java.math.BigDecimal;
/**
* 盘盈入库单明细表Entity
......@@ -18,10 +25,18 @@ public class ProfitWarehousingInfo extends DataEntity<ProfitWarehousingInfo> {
private static final long serialVersionUID = 1L;
private ProfitWarehousing profitWarehousing; // 盘盈入库主表ID
private String name; // 名称
private String type; // 类型
private MaterialType type; // 类型
private String marking; // 型号
private Shelves shelves; // 货架ID
private Warehouse warehouse; // 仓库外键
private BigDecimal amount; // 单价
private QrCode qrCode; // 前端保存入库单时使用的临时二维码对象
public ProfitWarehousingInfo(String id, ProfitWarehousing profitWarehousing) {
super(id);
this.profitWarehousing = profitWarehousing;
}
public ProfitWarehousingInfo() {
super();
}
......@@ -53,11 +68,11 @@ public class ProfitWarehousingInfo extends DataEntity<ProfitWarehousingInfo> {
}
@ExcelField(title="类型", align=2, sort=3)
public String getType() {
public MaterialType getType() {
return type;
}
public void setType(String type) {
public void setType(MaterialType type) {
this.type = type;
}
......@@ -79,4 +94,27 @@ public class ProfitWarehousingInfo extends DataEntity<ProfitWarehousingInfo> {
this.shelves = shelves;
}
public Warehouse getWarehouse() {
return warehouse;
}
public void setWarehouse(Warehouse warehouse) {
this.warehouse = warehouse;
}
public BigDecimal getAmount() {
return amount;
}
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
public QrCode getQrCode() {
return qrCode;
}
public void setQrCode(QrCode qrCode) {
this.qrCode = qrCode;
}
}
\ No newline at end of file
......@@ -6,9 +6,13 @@
a.id AS "id",
a.profit_warehousing_id AS "profitWarehousing.id",
a.name AS "name",
a.type AS "type",
a.type AS "type.id",
a.marking AS "marking",
a.shelves_id AS "shelves.id",
a.warehouse_id AS "warehouse.id",
warehouse.name AS "warehouse.name",
a.qr_id AS "qrCode.id",
a.amount AS "amount",
a.create_by AS "createBy.id",
a.create_date AS "createDate",
a.update_by AS "updateBy.id",
......@@ -18,7 +22,8 @@
</sql>
<sql id="profitWarehousingInfoJoins">
LEFT JOIN t_wh_material_type type ON type.id = a.type
LEFT JOIN t_wh_warehouse warehouse ON warehouse.id = a.warehouse_id
</sql>
......@@ -79,6 +84,9 @@
type,
marking,
shelves_id,
warehouse_id,
qr_id,
amount,
create_by,
create_date,
update_by,
......@@ -89,9 +97,12 @@
#{id},
#{profitWarehousing.id},
#{name},
#{type},
#{type.id},
#{marking},
#{shelves.id},
#{warehouse.id},
#{qrCode.id},
#{amount},
#{createBy.id},
#{createDate},
#{updateBy.id},
......@@ -108,6 +119,9 @@
type = #{type},
marking = #{marking},
shelves_id = #{shelves.id},
qr_id = #{qrCode.id},
warehouse_id = #{warehouse.id},
amount = #{amount},
update_by = #{updateBy.id},
update_date = #{updateDate},
remarks = #{remarks}
......
......@@ -5,8 +5,9 @@
<sql id="profitWarehousingColumns">
a.id AS "id",
a.number AS "number",
a.operator AS "operator",
a.operator AS "operator.id",
a.time AS "time",
a.sum AS "sum",
a.create_by AS "createBy.id",
a.create_date AS "createDate",
a.update_by AS "updateBy.id",
......@@ -16,7 +17,7 @@
</sql>
<sql id="profitWarehousingJoins">
LEFT JOIN sys_user operator ON operator.id = a.operator
</sql>
......@@ -78,6 +79,7 @@
number,
operator,
time,
sum,
create_by,
create_date,
update_by,
......@@ -87,8 +89,9 @@
) VALUES (
#{id},
#{number},
#{operator},
#{operator.id},
#{time},
#{sum},
#{createBy.id},
#{createDate},
#{updateBy.id},
......@@ -101,8 +104,9 @@
<update id="update">
UPDATE t_wh_profit_warehousing SET
number = #{number},
operator = #{operator},
operator = #{operator.id},
time = #{time},
sum = #{sum},
update_by = #{updateBy.id},
update_date = #{updateDate},
remarks = #{remarks}
......
......@@ -51,18 +51,18 @@ public class ProfitWarehousingService extends CrudService<ProfitWarehousingMappe
}
@Transactional(readOnly = false)
public void save(ProfitWarehousing profitWarehousing) {
profitWarehousing.setNumber(createPYDH());
super.save(profitWarehousing);
for (ProfitWarehousingInfo profitWarehousingInfo : profitWarehousing.getProfitWarehousingInfoList()){
profitWarehousingInfo.setProfitWarehousing(profitWarehousing);
if (profitWarehousingInfo.getId() == null){
continue;
}
if (ProfitWarehousingInfo.DEL_FLAG_NORMAL.equals(profitWarehousingInfo.getDelFlag())){
if (StringUtils.isBlank(profitWarehousingInfo.getId())){
profitWarehousingInfo.setProfitWarehousing(profitWarehousing);
profitWarehousingInfo.preInsert();
profitWarehousingInfoMapper.insert(profitWarehousingInfo);
}else{
profitWarehousingInfo.setProfitWarehousing(profitWarehousing);
profitWarehousingInfo.preUpdate();
profitWarehousingInfoMapper.update(profitWarehousingInfo);
}
......
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