优化收款单
This commit is contained in:
@@ -51,6 +51,7 @@ public class AccountItemController {
|
||||
item.put("accountName", ai.getAccountName());
|
||||
item.put("inOutItemId", ai.getInOutItemId());
|
||||
item.put("inOutItemName", ai.getInOutItemName());
|
||||
item.put("billNumber", ai.getBillNumber());
|
||||
BigDecimal eachAmount = ai.getEachAmount();
|
||||
item.put("eachAmount", (eachAmount.compareTo(BigDecimal.ZERO))==-1 ? BigDecimal.ZERO.subtract(eachAmount): eachAmount);
|
||||
item.put("remark", ai.getRemark());
|
||||
|
||||
@@ -11,6 +11,8 @@ public class AccountItem {
|
||||
|
||||
private Long inOutItemId;
|
||||
|
||||
private Long billId;
|
||||
|
||||
private BigDecimal eachAmount;
|
||||
|
||||
private String remark;
|
||||
@@ -51,6 +53,14 @@ public class AccountItem {
|
||||
this.inOutItemId = inOutItemId;
|
||||
}
|
||||
|
||||
public Long getBillId() {
|
||||
return billId;
|
||||
}
|
||||
|
||||
public void setBillId(Long billId) {
|
||||
this.billId = billId;
|
||||
}
|
||||
|
||||
public BigDecimal getEachAmount() {
|
||||
return eachAmount;
|
||||
}
|
||||
|
||||
@@ -345,6 +345,66 @@ public class AccountItemExample {
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andBillIdIsNull() {
|
||||
addCriterion("bill_id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andBillIdIsNotNull() {
|
||||
addCriterion("bill_id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andBillIdEqualTo(Long value) {
|
||||
addCriterion("bill_id =", value, "billId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andBillIdNotEqualTo(Long value) {
|
||||
addCriterion("bill_id <>", value, "billId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andBillIdGreaterThan(Long value) {
|
||||
addCriterion("bill_id >", value, "billId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andBillIdGreaterThanOrEqualTo(Long value) {
|
||||
addCriterion("bill_id >=", value, "billId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andBillIdLessThan(Long value) {
|
||||
addCriterion("bill_id <", value, "billId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andBillIdLessThanOrEqualTo(Long value) {
|
||||
addCriterion("bill_id <=", value, "billId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andBillIdIn(List<Long> values) {
|
||||
addCriterion("bill_id in", values, "billId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andBillIdNotIn(List<Long> values) {
|
||||
addCriterion("bill_id not in", values, "billId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andBillIdBetween(Long value1, Long value2) {
|
||||
addCriterion("bill_id between", value1, value2, "billId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andBillIdNotBetween(Long value1, Long value2) {
|
||||
addCriterion("bill_id not between", value1, value2, "billId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andEachAmountIsNull() {
|
||||
addCriterion("each_amount is null");
|
||||
return (Criteria) this;
|
||||
|
||||
@@ -8,6 +8,8 @@ public class AccountItemVo4List extends AccountItem {
|
||||
|
||||
private String inOutItemName;
|
||||
|
||||
private String billNumber;
|
||||
|
||||
public String getAccountName() {
|
||||
return accountName;
|
||||
}
|
||||
@@ -23,4 +25,12 @@ public class AccountItemVo4List extends AccountItem {
|
||||
public void setInOutItemName(String inOutItemName) {
|
||||
this.inOutItemName = inOutItemName;
|
||||
}
|
||||
|
||||
public String getBillNumber() {
|
||||
return billNumber;
|
||||
}
|
||||
|
||||
public void setBillNumber(String billNumber) {
|
||||
this.billNumber = billNumber;
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@ import com.jsh.erp.datasource.mappers.AccountItemMapperEx;
|
||||
import com.jsh.erp.datasource.vo.AccountItemVo4List;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.exception.JshException;
|
||||
import com.jsh.erp.service.depotHead.DepotHeadService;
|
||||
import com.jsh.erp.service.log.LogService;
|
||||
import com.jsh.erp.service.user.UserService;
|
||||
import com.jsh.erp.utils.StringUtil;
|
||||
@@ -34,13 +35,14 @@ public class AccountItemService {
|
||||
|
||||
@Resource
|
||||
private AccountItemMapper accountItemMapper;
|
||||
|
||||
@Resource
|
||||
private AccountItemMapperEx accountItemMapperEx;
|
||||
@Resource
|
||||
private LogService logService;
|
||||
@Resource
|
||||
private UserService userService;
|
||||
@Resource
|
||||
private DepotHeadService depotHeadService;
|
||||
|
||||
public AccountItem getAccountItem(long id)throws Exception {
|
||||
AccountItem result=null;
|
||||
@@ -199,6 +201,10 @@ public class AccountItemService {
|
||||
if (tempInsertedJson.get("inOutItemId") != null && !tempInsertedJson.get("inOutItemId").equals("")) {
|
||||
accountItem.setInOutItemId(tempInsertedJson.getLong("inOutItemId"));
|
||||
}
|
||||
if (tempInsertedJson.get("billNumber") != null && !tempInsertedJson.get("billNumber").equals("")) {
|
||||
String billNo = tempInsertedJson.getString("billNumber");
|
||||
accountItem.setBillId(depotHeadService.getDepotHead(billNo).getId());
|
||||
}
|
||||
if (tempInsertedJson.get("eachAmount") != null && !tempInsertedJson.get("eachAmount").equals("")) {
|
||||
BigDecimal eachAmount = tempInsertedJson.getBigDecimal("eachAmount");
|
||||
if (type.equals("付款")) {
|
||||
|
||||
@@ -670,4 +670,19 @@ public class DepotHeadService {
|
||||
public BigDecimal getBuyAndSaleRetailStatistics(String type, String subType, Integer hasSupplier, String beginTime, String endTime) {
|
||||
return depotHeadMapperEx.getBuyAndSaleRetailStatistics(type, subType, hasSupplier, beginTime, endTime);
|
||||
}
|
||||
|
||||
public DepotHead getDepotHead(String number)throws Exception {
|
||||
DepotHead depotHead = new DepotHead();
|
||||
try{
|
||||
DepotHeadExample example = new DepotHeadExample();
|
||||
example.createCriteria().andNumberEqualTo(number).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||
List<DepotHead> list = depotHeadMapper.selectByExample(example);
|
||||
if(null!=list && list.size()>0) {
|
||||
depotHead = list.get(0);
|
||||
}
|
||||
}catch(Exception e){
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return depotHead;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
<result column="header_id" jdbcType="BIGINT" property="headerId" />
|
||||
<result column="account_id" jdbcType="BIGINT" property="accountId" />
|
||||
<result column="in_out_item_id" jdbcType="BIGINT" property="inOutItemId" />
|
||||
<result column="bill_id" jdbcType="BIGINT" property="billId" />
|
||||
<result column="each_amount" jdbcType="DECIMAL" property="eachAmount" />
|
||||
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||
<result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
|
||||
@@ -70,7 +71,8 @@
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id, header_id, account_id, in_out_item_id, each_amount, remark, tenant_id, delete_flag
|
||||
id, header_id, account_id, in_out_item_id, bill_id, each_amount, remark, tenant_id,
|
||||
delete_flag
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.AccountItemExample" resultMap="BaseResultMap">
|
||||
select
|
||||
@@ -104,11 +106,13 @@
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.AccountItem">
|
||||
insert into jsh_account_item (id, header_id, account_id,
|
||||
in_out_item_id, each_amount, remark,
|
||||
tenant_id, delete_flag)
|
||||
in_out_item_id, bill_id, each_amount,
|
||||
remark, tenant_id, delete_flag
|
||||
)
|
||||
values (#{id,jdbcType=BIGINT}, #{headerId,jdbcType=BIGINT}, #{accountId,jdbcType=BIGINT},
|
||||
#{inOutItemId,jdbcType=BIGINT}, #{eachAmount,jdbcType=DECIMAL}, #{remark,jdbcType=VARCHAR},
|
||||
#{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR})
|
||||
#{inOutItemId,jdbcType=BIGINT}, #{billId,jdbcType=BIGINT}, #{eachAmount,jdbcType=DECIMAL},
|
||||
#{remark,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.AccountItem">
|
||||
insert into jsh_account_item
|
||||
@@ -125,6 +129,9 @@
|
||||
<if test="inOutItemId != null">
|
||||
in_out_item_id,
|
||||
</if>
|
||||
<if test="billId != null">
|
||||
bill_id,
|
||||
</if>
|
||||
<if test="eachAmount != null">
|
||||
each_amount,
|
||||
</if>
|
||||
@@ -151,6 +158,9 @@
|
||||
<if test="inOutItemId != null">
|
||||
#{inOutItemId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="billId != null">
|
||||
#{billId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="eachAmount != null">
|
||||
#{eachAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
@@ -186,6 +196,9 @@
|
||||
<if test="record.inOutItemId != null">
|
||||
in_out_item_id = #{record.inOutItemId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.billId != null">
|
||||
bill_id = #{record.billId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.eachAmount != null">
|
||||
each_amount = #{record.eachAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
@@ -209,6 +222,7 @@
|
||||
header_id = #{record.headerId,jdbcType=BIGINT},
|
||||
account_id = #{record.accountId,jdbcType=BIGINT},
|
||||
in_out_item_id = #{record.inOutItemId,jdbcType=BIGINT},
|
||||
bill_id = #{record.billId,jdbcType=BIGINT},
|
||||
each_amount = #{record.eachAmount,jdbcType=DECIMAL},
|
||||
remark = #{record.remark,jdbcType=VARCHAR},
|
||||
tenant_id = #{record.tenantId,jdbcType=BIGINT},
|
||||
@@ -229,6 +243,9 @@
|
||||
<if test="inOutItemId != null">
|
||||
in_out_item_id = #{inOutItemId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="billId != null">
|
||||
bill_id = #{billId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="eachAmount != null">
|
||||
each_amount = #{eachAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
@@ -249,6 +266,7 @@
|
||||
set header_id = #{headerId,jdbcType=BIGINT},
|
||||
account_id = #{accountId,jdbcType=BIGINT},
|
||||
in_out_item_id = #{inOutItemId,jdbcType=BIGINT},
|
||||
bill_id = #{billId,jdbcType=BIGINT},
|
||||
each_amount = #{eachAmount,jdbcType=DECIMAL},
|
||||
remark = #{remark,jdbcType=VARCHAR},
|
||||
tenant_id = #{tenantId,jdbcType=BIGINT},
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
<resultMap extends="com.jsh.erp.datasource.mappers.AccountItemMapper.BaseResultMap" id="ResultWithInfoExMap" type="com.jsh.erp.datasource.vo.AccountItemVo4List">
|
||||
<result column="AccountName" jdbcType="VARCHAR" property="accountName" />
|
||||
<result column="InOutItemName" jdbcType="VARCHAR" property="inOutItemName" />
|
||||
<result column="billNumber" jdbcType="VARCHAR" property="billNumber" />
|
||||
</resultMap>
|
||||
|
||||
<select id="selectByConditionAccountItem" parameterType="com.jsh.erp.datasource.entities.AccountItemExample" resultMap="com.jsh.erp.datasource.mappers.AccountItemMapper.BaseResultMap">
|
||||
@@ -47,9 +48,10 @@
|
||||
</select>
|
||||
|
||||
<select id="getDetailList" parameterType="com.jsh.erp.datasource.entities.AccountItemExample" resultMap="ResultWithInfoExMap">
|
||||
select ai.*,a.Name AccountName,ioi.Name InOutItemName
|
||||
select ai.*,a.Name AccountName,ioi.Name InOutItemName, dh.number billNumber
|
||||
from jsh_account_item ai left join jsh_account a on ai.account_id=a.id and ifnull(a.delete_Flag,'0') !='1'
|
||||
left join jsh_in_out_item ioi on ai.in_out_item_id = ioi.id and ifnull(ioi.delete_Flag,'0') !='1'
|
||||
left join jsh_depot_head dh on ai.bill_id = dh.id and ifnull(dh.delete_Flag,'0') !='1'
|
||||
where ai.header_id = #{headerId}
|
||||
and ifnull(ai.delete_flag,'0') !='1'
|
||||
order by ai.id asc
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
</commentGenerator>
|
||||
|
||||
<jdbcConnection driverClass="com.mysql.jdbc.Driver"
|
||||
connectionURL="jdbc:mysql://localhost:3306/jsh_erp_boot?generateSimpleParameterMetadata=true"
|
||||
connectionURL="jdbc:mysql://localhost:3306/jsh_erp?generateSimpleParameterMetadata=true"
|
||||
userId="root" password="123456">
|
||||
</jdbcConnection>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user