Commit e53a38d6 by 胡懿

Merge branches 'hy' and 'master' of gitlab.yqdchina.com:huyi/warehouse into hy

parents 88bca503 802d2846
......@@ -23,9 +23,13 @@ public class StaticNumSeq {
* */
public final static String CKDH = "CKDH";
/**
* 出库单号
* 盘亏出库单号
* */
public final static String PKDH = "PKDH";
/**
* 盘盈利入库单号
* */
public final static String PYDH = "PYDH";
/**
* 批次号
......
......@@ -8,6 +8,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;
import java.util.Date;
......@@ -20,7 +21,7 @@ public class MaterialLoss extends DataEntity<MaterialLoss> {
private static final long serialVersionUID = 1L;
private String number; // 盘亏单号
private String operator; // 操作人
private User operator; // 操作人
private Date time; // 盘亏时间
private String beginTime; // 开始 盘亏时间
private String endTime; // 结束 盘亏时间
......@@ -44,11 +45,11 @@ public class MaterialLoss extends DataEntity<MaterialLoss> {
}
@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;
}
......
......@@ -15,7 +15,7 @@
</sql>
<sql id="materialLossInfoJoins">
left join t_wh_ledger_info ledgerInfo on a.ledger_info_id = ledgerInfo.id
</sql>
......
......@@ -5,18 +5,19 @@
<sql id="materialLossColumns">
a.id AS "id",
a.number AS "number",
a.operator AS "operator",
a.operator AS "operator.id",
a.time AS "time",
a.remarks AS "remarks",
a.create_by AS "createBy.id",
a.create_date AS "createDate",
a.update_by AS "updateBy.id",
a.update_date AS "updateDate",
operator.name AS "operator.name",
a.del_flag AS "delFlag"
</sql>
<sql id="materialLossJoins">
LEFT JOIN sys_user operator ON operator.id = a.operator
</sql>
......@@ -85,7 +86,7 @@
) VALUES (
#{id},
#{number},
#{operator},
#{operator.id},
#{time},
#{remarks},
#{createBy.id},
......@@ -99,7 +100,7 @@
<update id="update">
UPDATE t_wh_material_loss SET
number = #{number},
operator = #{operator},
operator = #{operator.id},
time = #{time},
remarks = #{remarks},
update_by = #{updateBy.id},
......
......@@ -92,7 +92,7 @@ public class MaterialLossService extends CrudService<MaterialLossMapper, Materia
materialLossInfoMapper.delete(new MaterialLossInfo(materialLoss));
}
@Transactional(readOnly = false)
public String createLYDH() {
public String createPKDH() {
String pkdh = CodeUtil.code("PKDH", StaticNumSeq.PKDH);
return pkdh;
}
......@@ -100,7 +100,7 @@ public class MaterialLossService extends CrudService<MaterialLossMapper, Materia
@Transactional(readOnly = false)
public void delivery(MaterialLoss materialLoss) {
if(materialLoss.getNumber() == null || Objects.equals(materialLoss.getNumber(), "")){
materialLoss.setNumber(this.createLYDH());
materialLoss.setNumber(this.createPKDH());
}
this.save(materialLoss);
Outbound outbound = new Outbound();
......@@ -132,16 +132,14 @@ public class MaterialLossService extends CrudService<MaterialLossMapper, Materia
}catch (Exception e){
System.out.println(e.getMessage());
}
String sql1 = "UPDATE t_wh_ledger SET num = num - 1, sum = "+ledger.getSum()+ " WHERE id = " + ledger.getId() ;
this.executeUpdateSql(sql1);
ledgerService.save(ledger);
}
}
String sql = "UPDATE t_wh_ledger_info SET del_flag = 1 WHERE id = " + ledgerInfoId ;
ledgerInfoMapper.deleteByLogic(ledgerInfoId);
outboundInfo.setId("");
outboundInfo.setOutbound(outbound);
outboundInfo.setLedgerInfo(one.getLedgerInfo());
outboundInfoList.add(outboundInfo);
this.executeUpdateSql(sql);
}
outbound.setOutboundInfoList(outboundInfoList);
outboundService.save(outbound);
......
......@@ -11,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
......@@ -21,7 +22,7 @@ public class MaterialRequisition extends DataEntity<MaterialRequisition> {
private static final long serialVersionUID = 1L;
private String number; // 领用单号
private String operator; // 操作人
private User operator; // 操作人
// private String receiver; // 领用人
private Office office; // 领用机构
private Date time; // 领用时间
......@@ -45,11 +46,11 @@ public class MaterialRequisition extends DataEntity<MaterialRequisition> {
}
@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;
}
......
......@@ -6,6 +6,7 @@ package com.jeeplus.modules.warehouse.materialrequisition.entity;
import com.jeeplus.core.persistence.DataEntity;
import com.jeeplus.common.utils.excel.annotation.ExcelField;
import com.jeeplus.modules.sys.entity.User;
import com.jeeplus.modules.warehouse.ledger.entity.LedgerInfo;
/**
......@@ -17,7 +18,7 @@ public class MaterialRequisitionInfo extends DataEntity<MaterialRequisitionInfo>
private static final long serialVersionUID = 1L;
private MaterialRequisition materialRequisition; // 物资领用主表ID
private String receiver; // 领用人
private User receiver; // 领用人
private LedgerInfo ledgerInfo; // 物资台账明细ID
public MaterialRequisitionInfo() {
......@@ -46,11 +47,11 @@ public class MaterialRequisitionInfo extends DataEntity<MaterialRequisitionInfo>
return ledgerInfo;
}
@ExcelField(title="领用人", align=2, sort=3)
public String getReceiver() {
public User getReceiver() {
return receiver;
}
public void setReceiver(String receiver) {
public void setReceiver(User receiver) {
this.receiver = receiver;
}
......
......@@ -6,17 +6,18 @@
a.id AS "id",
a.material_requisition_id AS "materialRequisition.id",
a.ledger_info_id AS "ledgerInfo.id",
a.receiver AS "receiver",
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"
a.del_flag AS "delFlag",
receiver.name AS "receiver.name"
</sql>
<sql id="materialRequisitionInfoJoins">
LEFT JOIN sys_user receiver ON receiver.id = a.receiver
</sql>
......@@ -39,6 +40,9 @@
<if test="materialRequisition != null and materialRequisition.id != null and materialRequisition.id != ''">
AND a.material_requisition_id = #{materialRequisition.id}
</if>
<if test="receiver != null and receiver.id != null and receiver.id != ''">
AND a.receiver = #{receiver.id}
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
......@@ -88,7 +92,7 @@
) VALUES (
#{id},
#{materialRequisition.id},
#{receiver},
#{receiver.id},
#{ledgerInfo.id},
#{createBy.id},
#{createDate},
......@@ -103,7 +107,7 @@
UPDATE t_wh_material_requisition_info SET
material_requisition_id = #{materialRequisition.id},
ledger_info_id = #{ledgerInfo.id},
receiver = #{receiver},
receiver = #{receiver.id},
update_by = #{updateBy.id},
update_date = #{updateDate},
remarks = #{remarks}
......
......@@ -5,7 +5,7 @@
<sql id="materialRequisitionColumns">
a.id AS "id",
a.number AS "number",
a.operator AS "operator",
a.operator AS "operator.id",
a.collecting_office_id AS "office.id",
a.time AS "time",
a.create_by AS "createBy.id",
......@@ -14,11 +14,12 @@
a.update_date AS "updateDate",
a.del_flag AS "delFlag",
a.remarks AS "remarks",
operator.name AS "operator.name",
office.name AS "office.name"
</sql>
<sql id="materialRequisitionJoins">
LEFT JOIN sys_user operator ON operator.id = a.operator
LEFT JOIN sys_office office ON office.id = a.collecting_office_id
</sql>
......@@ -42,8 +43,8 @@
<if test="number != null and number != ''">
AND a.number = #{number}
</if>
<if test="operator != null and operator != ''">
AND a.operator = #{operator}
<if test="operator != null and operator.id != null and operator.id != ''">
AND a.operator = #{operator.id}
</if>
</where>
<choose>
......@@ -91,7 +92,7 @@
) VALUES (
#{id},
#{number},
#{operator},
#{operator.id},
#{office.id},
#{time},
#{createBy.id},
......@@ -106,7 +107,7 @@
<update id="update">
UPDATE t_wh_material_requisition SET
number = #{number},
operator = #{operator},
operator = #{operator.id},
collecting_office_id = #{office.id},
time = #{time},
update_by = #{updateBy.id},
......
......@@ -131,16 +131,14 @@ public class MaterialRequisitionService extends CrudService<MaterialRequisitionM
}catch (Exception e){
System.out.println(e.getMessage());
}
String sql1 = "UPDATE t_wh_ledger SET num = num - 1, sum = "+ledger.getSum()+ " WHERE id = " + ledger.getId() ;
this.executeUpdateSql(sql1);
ledgerService.save(ledger);
}
}
String sql = "UPDATE t_wh_ledger_info SET del_flag = 1 WHERE id = " + ledgerInfoId ;
ledgerInfoMapper.deleteByLogic(ledgerInfoId);
outboundInfo.setId("");
outboundInfo.setOutbound(outbound);
outboundInfo.setLedgerInfo(one.getLedgerInfo());
outboundInfoList.add(outboundInfo);
this.executeUpdateSql(sql);
}
outbound.setOutboundInfoList(outboundInfoList);
outboundService.save(outbound);
......
......@@ -10,6 +10,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
......@@ -23,7 +24,7 @@ public class Outbound extends DataEntity<Outbound> {
private String relationId; // 相关表单ID
private Date outboundTime; // 出库时间
private String type; // 出库分类
private String operator; // 操作人
private User operator; // 操作人
private Date beginOutboundTime; // 开始 出库时间
private Date endOutboundTime; // 结束 出库时间
private List<OutboundInfo> outboundInfoList = Lists.newArrayList(); // 子表列表
......@@ -74,11 +75,11 @@ public class Outbound extends DataEntity<Outbound> {
}
@ExcelField(title="操作人", align=2, sort=5)
public String getOperator() {
public User getOperator() {
return operator;
}
public void setOperator(String operator) {
public void setOperator(User operator) {
this.operator = operator;
}
......
......@@ -15,7 +15,7 @@
</sql>
<sql id="outboundInfoJoins">
left join t_wh_ledger_info ledgerInfo on a.ledger_info_id = ledgerInfo.id
</sql>
......
......@@ -8,17 +8,18 @@
a.relation_id AS "relationId",
a.outbound_time AS "outboundTime",
a.type AS "type",
a.operator AS "operator",
a.operator AS "operator.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",
operator.name AS "operator.name",
a.del_flag AS "delFlag"
</sql>
<sql id="outboundJoins">
LEFT JOIN sys_user operator ON operator.id = a.operator
</sql>
......@@ -103,7 +104,7 @@
#{relationId},
#{outboundTime},
#{type},
#{operator},
#{operator.id},
#{createBy.id},
#{createDate},
#{updateBy.id},
......@@ -119,7 +120,7 @@
relation_id = #{relationId},
outbound_time = #{outboundTime},
type = #{type},
operator = #{operator},
operator = #{operator.id},
update_by = #{updateBy.id},
update_date = #{updateDate},
remarks = #{remarks}
......
......@@ -5,6 +5,8 @@ package com.jeeplus.modules.warehouse.profitwarehousing.service;
import java.util.List;
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.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -42,7 +44,11 @@ public class ProfitWarehousingService extends CrudService<ProfitWarehousingMappe
public Page<ProfitWarehousing> findPage(Page<ProfitWarehousing> page, ProfitWarehousing profitWarehousing) {
return super.findPage(page, profitWarehousing);
}
@Transactional(readOnly = false)
public String createPYDH() {
String pydh = CodeUtil.code("PYDH", StaticNumSeq.PYDH);
return pydh;
}
@Transactional(readOnly = false)
public void save(ProfitWarehousing profitWarehousing) {
super.save(profitWarehousing);
......
......@@ -13,11 +13,11 @@
a.update_by AS "updateBy.id",
a.update_date AS "updateDate",
a.del_flag AS "delFlag",
w.name AS "warehouse.name"
warehouse.name AS "warehouse.name"
</sql>
<sql id="shelvesJoins">
left join t_wh_warehouse w on a.warehouse_id = w.id
left join t_wh_warehouse warehouse on a.warehouse_id = warehouse.id
</sql>
......@@ -31,13 +31,34 @@
<select id="findList" resultType="Shelves" >
SELECT
<include refid="shelvesColumns"/>
a.id AS "id",
a.name AS "name",
a.number AS "number",
a.warehouse_id AS "warehouse.id",
a.remarks AS "remarks",
a.create_by AS "createBy.id",
a.create_date AS "createDate",
a.update_by AS "updateBy.id",
a.update_date AS "updateDate",
a.del_flag AS "delFlag",
warehouse.name AS "warehouse.name"
FROM t_wh_shelves a
<include refid="shelvesJoins"/>
<where>
a.del_flag = #{DEL_FLAG_NORMAL}
${dataScope}
<if test="number != null and number != ''">
AND a.number = #{number}
</if>
<if test="warehouse != null and warehouse.id != null and warehouse.id != ''">
AND a.warehouse_id = #{warehouse.id}
</if>
<if test="name != null and name != ''">
AND a.name LIKE
<if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
<if test="dbName == 'mssql'">'%'+#{name}+'%'</if>
<if test="dbName == 'mysql'">concat('%',#{name},'%')</if>
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
......
......@@ -110,10 +110,10 @@ $(document).ready(function() {
}
,{
field: 'operator',
field: 'operator.name',
title: '操作人',
sortable: true,
sortName: 'operator'
sortName: 'operator.name'
}
,{
......
......@@ -82,7 +82,11 @@
<div class="form-group">
<label class="col-sm-2 control-label">操作人:</label>
<div class="col-sm-10">
<form:input path="operator" htmlEscape="false" class="form-control "/>
<div class="col-sm-10">
<sys:userselect id="operator" name="operator.id" value="${materialRequisition.operator.id}" labelName="operator.name" labelValue="${materialRequisition.operator.name}"
cssClass="form-control "/>
</div>
<%-- <form:input path="operator" htmlEscape="false" class="form-control "/>--%>
</div>
</div>
......@@ -149,7 +153,7 @@
</td>
<td>
<input id="materialRequisitionInfoList{{idx}}_receiver" name="materialRequisitionInfoList[{{idx}}].receiver" type="text" value="{{row.receiver}}" class="form-control "/>
<input id="materialRequisitionInfoList{{idx}}_receiver" name="materialRequisitionInfoList[{{idx}}].receiver" type="text" value="{{row.receiver.id}}" class="form-control "/>
</td>
<td>
......
......@@ -110,10 +110,10 @@ $(document).ready(function() {
}
,{
field: 'operator',
field: 'operator.name',
title: '操作人',
sortable: true,
sortName: 'operator'
sortName: 'operator.name'
}
,{
......@@ -321,7 +321,7 @@ $(document).ready(function() {
{{row.ledgerInfo.id}}
</td>
<td>
{{row.receiver}}
{{row.receiver.name}}
</td>
<td>
{{row.remarks}}
......
......@@ -134,10 +134,10 @@ $(document).ready(function() {
}
,{
field: 'operator',
field: 'operator.name',
title: '操作人',
sortable: true,
sortName: 'operator'
sortName: 'operator.name'
}
,{
......
......@@ -113,14 +113,10 @@ $(document).ready(function() {
}
,{
field: 'warehouse.id',
field: 'warehouse.name',
title: '仓库id',
sortable: true,
sortName: 'warehouse.id',
formatter:function(value, row , index){
return jp.getDictLabel(${fns:toJson(fns:getDictList(''))}, value, "-");
}
sortName: 'warehouse.name'
}
,{
field: 'remarks',
......
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