增加订单转采购和销售的功能
This commit is contained in:
@@ -51,6 +51,12 @@ public class BusinessConstants {
|
||||
* */
|
||||
public static final String ENABLE_SERIAL_NUMBER_ENABLED = "1";
|
||||
public static final String ENABLE_SERIAL_NUMBER_NOT_ENABLED = "0";
|
||||
/**
|
||||
* 单据状态 billsStatus '0'未审核 '1'审核 '2'已转采购|销售
|
||||
* */
|
||||
public static final String BILLS_STATUS_UN_AUDIT = "0";
|
||||
public static final String BILLS_STATUS_AUDIT = "1";
|
||||
public static final String BILLS_STATUS_SKIP = "2";
|
||||
/**
|
||||
* 出入库分类
|
||||
*采购、采购退货、其它、零售、销售、调拨
|
||||
|
||||
@@ -51,7 +51,7 @@ public class DepotHeadController {
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/batchSetStatus")
|
||||
public String batchSetStatus(@RequestParam("status") Boolean status,
|
||||
public String batchSetStatus(@RequestParam("status") String status,
|
||||
@RequestParam("depotHeadIDs") String depotHeadIDs,
|
||||
HttpServletRequest request) {
|
||||
Map<String, Object> objectMap = new HashMap<String, Object>();
|
||||
@@ -64,20 +64,12 @@ public class DepotHeadController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 单据编号生成接口,规则:查找当前类型单据下的当天最大的单据号,并加1
|
||||
* @param type
|
||||
* @param subType
|
||||
* @param beginTime
|
||||
* @param endTime
|
||||
* 单据编号生成接口
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/buildNumber")
|
||||
public BaseResponseInfo buildNumber(@RequestParam("type") String type,
|
||||
@RequestParam("subType") String subType,
|
||||
@RequestParam("beginTime") String beginTime,
|
||||
@RequestParam("endTime") String endTime,
|
||||
HttpServletRequest request) {
|
||||
public BaseResponseInfo buildNumber(HttpServletRequest request) {
|
||||
BaseResponseInfo res = new BaseResponseInfo();
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
try {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,103 +1,96 @@
|
||||
package com.jsh.erp.datasource.mappers;
|
||||
|
||||
import com.jsh.erp.datasource.entities.DepotHead;
|
||||
import com.jsh.erp.datasource.entities.DepotHeadExample;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
import com.jsh.erp.datasource.vo.DepotHeadVo4InDetail;
|
||||
import com.jsh.erp.datasource.vo.DepotHeadVo4InOutMCount;
|
||||
import com.jsh.erp.datasource.vo.DepotHeadVo4List;
|
||||
import com.jsh.erp.datasource.vo.DepotHeadVo4StatementAccount;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface DepotHeadMapper {
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_depothead
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int countByExample(DepotHeadExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_depothead
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int deleteByExample(DepotHeadExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_depothead
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_depothead
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int insert(DepotHead record);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_depothead
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int insertSelective(DepotHead record);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_depothead
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
List<DepotHead> selectByExample(DepotHeadExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_depothead
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
DepotHead selectByPrimaryKey(Long id);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_depothead
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int updateByExampleSelective(@Param("record") DepotHead record, @Param("example") DepotHeadExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_depothead
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int updateByExample(@Param("record") DepotHead record, @Param("example") DepotHeadExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_depothead
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int updateByPrimaryKeySelective(DepotHead record);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_depothead
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int updateByPrimaryKey(DepotHead record);
|
||||
package com.jsh.erp.datasource.mappers;
|
||||
|
||||
import com.jsh.erp.datasource.entities.DepotHead;
|
||||
import com.jsh.erp.datasource.entities.DepotHeadExample;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface DepotHeadMapper {
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_depothead
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int countByExample(DepotHeadExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_depothead
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int deleteByExample(DepotHeadExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_depothead
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_depothead
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int insert(DepotHead record);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_depothead
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int insertSelective(DepotHead record);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_depothead
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
List<DepotHead> selectByExample(DepotHeadExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_depothead
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
DepotHead selectByPrimaryKey(Long id);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_depothead
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int updateByExampleSelective(@Param("record") DepotHead record, @Param("example") DepotHeadExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_depothead
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int updateByExample(@Param("record") DepotHead record, @Param("example") DepotHeadExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_depothead
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int updateByPrimaryKeySelective(DepotHead record);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_depothead
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int updateByPrimaryKey(DepotHead record);
|
||||
}
|
||||
@@ -59,7 +59,9 @@ public class DepotHeadVo4List {
|
||||
|
||||
private Integer accountday;
|
||||
|
||||
private Boolean status;
|
||||
private String status;
|
||||
|
||||
private String linknumber;
|
||||
|
||||
private String projectName;
|
||||
|
||||
@@ -291,14 +293,22 @@ public class DepotHeadVo4List {
|
||||
this.accountday = accountday;
|
||||
}
|
||||
|
||||
public Boolean getStatus() {
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Boolean status) {
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getLinknumber() {
|
||||
return linknumber;
|
||||
}
|
||||
|
||||
public void setLinknumber(String linknumber) {
|
||||
this.linknumber = linknumber;
|
||||
}
|
||||
|
||||
public String getProjectName() {
|
||||
return projectName;
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ public class DepotHeadService {
|
||||
depotHead.setOperpersonname(uName);
|
||||
}
|
||||
depotHead.setCreatetime(new Timestamp(System.currentTimeMillis()));
|
||||
depotHead.setStatus(false);
|
||||
depotHead.setStatus(BusinessConstants.BILLS_STATUS_UN_AUDIT);
|
||||
return depotHeadMapper.insert(depotHead);
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ public class DepotHeadService {
|
||||
}
|
||||
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public int batchSetStatus(Boolean status, String depotHeadIDs) {
|
||||
public int batchSetStatus(String status, String depotHeadIDs) {
|
||||
List<Long> ids = StringUtil.strToLongList(depotHeadIDs);
|
||||
DepotHead depotHead = new DepotHead();
|
||||
depotHead.setStatus(status);
|
||||
@@ -275,7 +275,7 @@ public class DepotHeadService {
|
||||
User userInfo=userService.getCurrentUser();
|
||||
depotHead.setOperpersonname(userInfo==null?null:userInfo.getUsername());
|
||||
depotHead.setCreatetime(new Timestamp(System.currentTimeMillis()));
|
||||
depotHead.setStatus(false);
|
||||
depotHead.setStatus(BusinessConstants.BILLS_STATUS_UN_AUDIT);
|
||||
depotHeadMapperEx.adddepotHead(depotHead);
|
||||
/**入库和出库处理预付款信息*/
|
||||
if(BusinessConstants.PAY_TYPE_PREPAID.equals(depotHead.getPaytype())){
|
||||
@@ -285,6 +285,14 @@ public class DepotHeadService {
|
||||
}
|
||||
/**入库和出库处理单据子表信息*/
|
||||
depotItemService.saveDetials(inserted,deleted,updated,depotHead.getId());
|
||||
/**如果关联单据号非空则更新订单的状态为2 */
|
||||
if(depotHead.getLinknumber()!=null) {
|
||||
DepotHead depotHeadOrders = new DepotHead();
|
||||
depotHeadOrders.setStatus(BusinessConstants.BILLS_STATUS_SKIP);
|
||||
DepotHeadExample example = new DepotHeadExample();
|
||||
example.createCriteria().andNumberEqualTo(depotHead.getLinknumber());
|
||||
depotHeadMapper.updateByExampleSelective(depotHeadOrders, example);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* create by: cjl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jsh.erp.datasource.mappers.DepotHeadMapper">
|
||||
<resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.DepotHead">
|
||||
<!--
|
||||
@@ -33,7 +33,8 @@
|
||||
<result column="OtherMoneyList" jdbcType="VARCHAR" property="othermoneylist" />
|
||||
<result column="OtherMoneyItem" jdbcType="VARCHAR" property="othermoneyitem" />
|
||||
<result column="AccountDay" jdbcType="INTEGER" property="accountday" />
|
||||
<result column="Status" jdbcType="BIT" property="status" />
|
||||
<result column="Status" jdbcType="VARCHAR" property="status" />
|
||||
<result column="LinkNumber" jdbcType="VARCHAR" property="linknumber" />
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<!--
|
||||
@@ -109,7 +110,8 @@
|
||||
Id, Type, SubType, ProjectId, DefaultNumber, Number, OperPersonName, CreateTime,
|
||||
OperTime, OrganId, HandsPersonId, AccountId, ChangeAmount, AllocationProjectId, TotalPrice,
|
||||
PayType, Remark, Salesman, AccountIdList, AccountMoneyList, Discount, DiscountMoney,
|
||||
DiscountLastMoney, OtherMoney, OtherMoneyList, OtherMoneyItem, AccountDay, Status
|
||||
DiscountLastMoney, OtherMoney, OtherMoneyList, OtherMoneyItem, AccountDay, Status,
|
||||
LinkNumber
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.DepotHeadExample" resultMap="BaseResultMap">
|
||||
<!--
|
||||
@@ -171,7 +173,7 @@
|
||||
AccountIdList, AccountMoneyList, Discount,
|
||||
DiscountMoney, DiscountLastMoney, OtherMoney,
|
||||
OtherMoneyList, OtherMoneyItem, AccountDay,
|
||||
Status)
|
||||
Status, LinkNumber)
|
||||
values (#{id,jdbcType=BIGINT}, #{type,jdbcType=VARCHAR}, #{subtype,jdbcType=VARCHAR},
|
||||
#{projectid,jdbcType=BIGINT}, #{defaultnumber,jdbcType=VARCHAR}, #{number,jdbcType=VARCHAR},
|
||||
#{operpersonname,jdbcType=VARCHAR}, #{createtime,jdbcType=TIMESTAMP}, #{opertime,jdbcType=TIMESTAMP},
|
||||
@@ -181,7 +183,7 @@
|
||||
#{accountidlist,jdbcType=VARCHAR}, #{accountmoneylist,jdbcType=VARCHAR}, #{discount,jdbcType=DECIMAL},
|
||||
#{discountmoney,jdbcType=DECIMAL}, #{discountlastmoney,jdbcType=DECIMAL}, #{othermoney,jdbcType=DECIMAL},
|
||||
#{othermoneylist,jdbcType=VARCHAR}, #{othermoneyitem,jdbcType=VARCHAR}, #{accountday,jdbcType=INTEGER},
|
||||
#{status,jdbcType=BIT})
|
||||
#{status,jdbcType=VARCHAR}, #{linknumber,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.DepotHead">
|
||||
<!--
|
||||
@@ -274,6 +276,9 @@
|
||||
<if test="status != null">
|
||||
Status,
|
||||
</if>
|
||||
<if test="linknumber != null">
|
||||
LinkNumber,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
@@ -358,7 +363,10 @@
|
||||
#{accountday,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
#{status,jdbcType=BIT},
|
||||
#{status,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="linknumber != null">
|
||||
#{linknumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
@@ -461,7 +469,10 @@
|
||||
AccountDay = #{record.accountday,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.status != null">
|
||||
Status = #{record.status,jdbcType=BIT},
|
||||
Status = #{record.status,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.linknumber != null">
|
||||
LinkNumber = #{record.linknumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null">
|
||||
@@ -501,7 +512,8 @@
|
||||
OtherMoneyList = #{record.othermoneylist,jdbcType=VARCHAR},
|
||||
OtherMoneyItem = #{record.othermoneyitem,jdbcType=VARCHAR},
|
||||
AccountDay = #{record.accountday,jdbcType=INTEGER},
|
||||
Status = #{record.status,jdbcType=BIT}
|
||||
Status = #{record.status,jdbcType=VARCHAR},
|
||||
LinkNumber = #{record.linknumber,jdbcType=VARCHAR}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
@@ -592,7 +604,10 @@
|
||||
AccountDay = #{accountday,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
Status = #{status,jdbcType=BIT},
|
||||
Status = #{status,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="linknumber != null">
|
||||
LinkNumber = #{linknumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where Id = #{id,jdbcType=BIGINT}
|
||||
@@ -629,7 +644,8 @@
|
||||
OtherMoneyList = #{othermoneylist,jdbcType=VARCHAR},
|
||||
OtherMoneyItem = #{othermoneyitem,jdbcType=VARCHAR},
|
||||
AccountDay = #{accountday,jdbcType=INTEGER},
|
||||
Status = #{status,jdbcType=BIT}
|
||||
Status = #{status,jdbcType=VARCHAR},
|
||||
LinkNumber = #{linknumber,jdbcType=VARCHAR}
|
||||
where Id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -293,7 +293,7 @@
|
||||
AccountIdList, AccountMoneyList, Discount,
|
||||
DiscountMoney, DiscountLastMoney, OtherMoney,
|
||||
OtherMoneyList, OtherMoneyItem, AccountDay,
|
||||
Status)
|
||||
Status, LinkNumber)
|
||||
values (#{type,jdbcType=VARCHAR}, #{subtype,jdbcType=VARCHAR},
|
||||
#{projectid,jdbcType=BIGINT}, #{defaultnumber,jdbcType=VARCHAR}, #{number,jdbcType=VARCHAR},
|
||||
#{operpersonname,jdbcType=VARCHAR}, #{createtime,jdbcType=TIMESTAMP}, #{opertime,jdbcType=TIMESTAMP},
|
||||
@@ -303,7 +303,7 @@
|
||||
#{accountidlist,jdbcType=VARCHAR}, #{accountmoneylist,jdbcType=VARCHAR}, #{discount,jdbcType=DECIMAL},
|
||||
#{discountmoney,jdbcType=DECIMAL}, #{discountlastmoney,jdbcType=DECIMAL}, #{othermoney,jdbcType=DECIMAL},
|
||||
#{othermoneylist,jdbcType=VARCHAR}, #{othermoneyitem,jdbcType=VARCHAR}, #{accountday,jdbcType=INTEGER},
|
||||
#{status,jdbcType=BIT})
|
||||
#{status,jdbcType=VARCHAR}, #{linknumber,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<update id="updatedepotHead" parameterType="com.jsh.erp.datasource.entities.DepotHead">
|
||||
update jsh_depothead
|
||||
@@ -384,7 +384,10 @@
|
||||
AccountDay = #{accountday,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
Status = #{status,jdbcType=BIT},
|
||||
Status = #{status,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="linknumber != null">
|
||||
LinkNumber = #{linknumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where Id = #{id,jdbcType=BIGINT}
|
||||
|
||||
Reference in New Issue
Block a user