This commit is contained in:
linfso 2024-05-11 18:57:59 +08:00
parent 6d93e14b5e
commit c53ef17ae6
5 changed files with 87 additions and 31 deletions

View File

@ -2,7 +2,7 @@
* @Project: emis * @Project: emis
* @Title: EmisBrand.java * @Title: EmisBrand.java
* @author linfso * @author linfso
* @date 2023-12-14 13:02:47 * @date 2024-05-11 10:57:00
* @Copyright: ShangHai Duta 2022 All rights reserved. * @Copyright: ShangHai Duta 2022 All rights reserved.
* @version v1.0 * @version v1.0
* @Description: <p> 品牌 实体类 </p> * @Description: <p> 品牌 实体类 </p>
@ -17,6 +17,7 @@ import com.xdadan.erp.common.annotation.Excel;
import com.xdadan.erp.common.core.domain.BaseEntity; import com.xdadan.erp.common.core.domain.BaseEntity;
import com.xdadan.erp.common.core.domain.TreeEntity; import com.xdadan.erp.common.core.domain.TreeEntity;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import lombok.Data; import lombok.Data;
@ -25,7 +26,7 @@ import lombok.Data;
* @ClassName EmisBrand * @ClassName EmisBrand
* @Description 品牌 * @Description 品牌
* @author linfso * @author linfso
* @date 2023-12-14 13:02:47 * @date 2024-05-11 10:57:00
*/ */
@Data @Data
public class EmisBrand extends BaseEntity public class EmisBrand extends BaseEntity
@ -44,11 +45,11 @@ public class EmisBrand extends BaseEntity
private String logo; private String logo;
/* url */ /* url */
private String url; private String url;
/* 排序 */
private Integer sortOrder;
/* 0-未开放 1-开放 */ /* 0-未开放 1-开放 */
private Integer status; private Integer status;
/* 品牌图片(多图;号隔开) */ /* 品牌图片(多图;号隔开) */
private String brandImg; private String brandImg;
/* order_num */
private Integer orderNum;
} }

View File

@ -0,0 +1,19 @@
package com.xdadan.erp.emis.domain.enumtype;
public enum TransType {
EXPRESS_TRANS("1","快递"),
AIR_TRANS("2","空运"),
LAND_TRANS("3","陆运"),
SEA_TRANS("4","海运"),
TRAIN_TRANS("5","铁路");
public String typeCode;
public String typeName;
TransType(String typeCode, String typeName) {
this.typeCode = typeCode;
this.typeName = typeName;
}
}

View File

@ -24,6 +24,7 @@ import com.googlecode.aviator.AviatorEvaluator;
import com.xdadan.erp.common.utils.DateUtils; import com.xdadan.erp.common.utils.DateUtils;
import com.xdadan.erp.common.utils.DictUtils; import com.xdadan.erp.common.utils.DictUtils;
import com.xdadan.erp.emis.domain.*; import com.xdadan.erp.emis.domain.*;
import com.xdadan.erp.emis.domain.enumtype.TransType;
import com.xdadan.erp.emis.domain.exception.EmisBizError; import com.xdadan.erp.emis.domain.exception.EmisBizError;
import com.xdadan.erp.emis.domain.enumtype.EmisBizErrorType; import com.xdadan.erp.emis.domain.enumtype.EmisBizErrorType;
import com.xdadan.erp.emis.domain.vo.*; import com.xdadan.erp.emis.domain.vo.*;
@ -629,10 +630,21 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
double volumeWeight=0.0D; double volumeWeight=0.0D;
if(!StringUtils.isEmpty(emisTransLine.getMeterRate())) { if(!StringUtils.isEmpty(emisTransLine.getMeterRate())) {
// 特殊计泡处理
// 6000 167
// 3333 300
if("6000".equals(emisTransLine.getMeterRate())){
volumeWeight=167.0f*totalVolume;
}else if("3333".equals(emisTransLine.getMeterRate())){
volumeWeight=300.0f*totalVolume;
}else{
volumeWeight=totalVolume * (1000000 / Double.valueOf(emisTransLine.getMeterRate())); volumeWeight=totalVolume * (1000000 / Double.valueOf(emisTransLine.getMeterRate()));
DecimalFormat df = new DecimalFormat("#.#####"); DecimalFormat df = new DecimalFormat("#.#####");
volumeWeight= Double.parseDouble(df.format(volumeWeight)); volumeWeight= Double.parseDouble(df.format(volumeWeight));
} }
}
emisWaybill.setVolumeWeight(BigDecimal.valueOf(volumeWeight)); emisWaybill.setVolumeWeight(BigDecimal.valueOf(volumeWeight));
emisWaybill.setMeterType(emisTransLine.getMeterRate()); emisWaybill.setMeterType(emisTransLine.getMeterRate());
} }

View File

@ -79,7 +79,12 @@ public class WaybillHelper {
// 1 小数进1 ,抹零+1 // 1 小数进1 ,抹零+1
else if("3".equals(carryType)){ else if("3".equals(carryType)){
setteldWeight=Math.ceil(weight); setteldWeight=Math.ceil(weight);
}else{ }
// 抹零 取整
else if("4".equals(carryType)){
setteldWeight=Math.floor(weight);
}
else{
setteldWeight=weight; setteldWeight=weight;
} }
@ -184,19 +189,27 @@ public class WaybillHelper {
// System.out.println(d); // System.out.println(d);
try { try {
//
// long startAll = System.currentTimeMillis();
//
// for(int i=0;i<100;i++) {
// long start = System.currentTimeMillis();
// JSONObject rst = WaybillHelper.parseChinaAddress("13818415183 孙丹 广西壮族自治区南宁市西乡塘区衡阳街道广西省南宁市衡阳西路34号大院"+i);
// System.out.println(rst);
// long end4 = System.currentTimeMillis();
// System.out.println("escape time single:" + (end4 - start) + "ms");
// }
// long endAll = System.currentTimeMillis();
long startAll = System.currentTimeMillis(); // System.out.println("All escape time:" + (endAll - startAll) + "ms");
for(int i=0;i<100;i++) { // 6000 167
long start = System.currentTimeMillis(); // 3333 300
JSONObject rst = WaybillHelper.parseChinaAddress("13818415183 孙丹 广西壮族自治区南宁市西乡塘区衡阳街道广西省南宁市衡阳西路34号大院"+i); // 5000 0.1
System.out.println(rst); float volumeWeight=166.667f;
long end4 = System.currentTimeMillis(); System.out.println(WaybillHelper.calcSettledWeight(volumeWeight,"3"));
System.out.println("escape time single:" + (end4 - start) + "ms"); System.out.println(WaybillHelper.calcSettledWeight(volumeWeight,"4"));
}
long endAll = System.currentTimeMillis();
System.out.println("All escape time:" + (endAll - startAll) + "ms");
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();

View File

@ -4,6 +4,7 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xdadan.erp.emis.mapper.EmisBrandMapper"> <mapper namespace="com.xdadan.erp.emis.mapper.EmisBrandMapper">
<resultMap type="EmisBrand" id="EmisBrandResult"> <resultMap type="EmisBrand" id="EmisBrandResult">
<result property="id" column="id" /> <result property="id" column="id" />
<result property="code" column="code" /> <result property="code" column="code" />
@ -11,9 +12,9 @@
<result property="nameEn" column="name_en" /> <result property="nameEn" column="name_en" />
<result property="logo" column="logo" /> <result property="logo" column="logo" />
<result property="url" column="url" /> <result property="url" column="url" />
<result property="sortOrder" column="sort_order" />
<result property="status" column="status" /> <result property="status" column="status" />
<result property="brandImg" column="brand_img" /> <result property="brandImg" column="brand_img" />
<result property="orderNum" column="order_num" />
<result property="remark" column="remark" /> <result property="remark" column="remark" />
<result property="tenantId" column="tenant_id" /> <result property="tenantId" column="tenant_id" />
<result property="delFlag" column="del_flag" /> <result property="delFlag" column="del_flag" />
@ -21,24 +22,26 @@
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
<result property="createSite" column="create_site" />
<result property="updateSite" column="update_site" />
</resultMap> </resultMap>
<sql id="selectEmisBrandVo"> <sql id="selectEmisBrandVo">
select id, code, name, name_en, logo, url, sort_order, status, brand_img, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time from emis_brand select id, code, name, name_en, logo, url, status, brand_img, order_num, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_brand
</sql> </sql>
<select id="selectEmisBrandList" parameterType="EmisBrand" resultMap="EmisBrandResult"> <select id="selectEmisBrandList" parameterType="EmisBrand" resultMap="EmisBrandResult">
<include refid="selectEmisBrandVo"/> <include refid="selectEmisBrandVo"/>
<where> <where>
<if test="id != null "> and id = #{id}</if> <if test="id != null "> and id = #{id}</if>
<if test="code != null and code != ''"> and code=#{code}</if> <if test="code != null and code != ''"> and code like concat('%', #{code}, '%')</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if> <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="nameEn != null and nameEn != ''"> and name_en like concat('%', #{nameEn}, '%')</if> <if test="nameEn != null and nameEn != ''"> and name_en like concat('%', #{nameEn}, '%')</if>
<if test="logo != null and logo != ''"> and logo like concat('%', #{logo}, '%')</if> <if test="logo != null and logo != ''"> and logo like concat('%', #{logo}, '%')</if>
<if test="url != null and url != ''"> and url like concat('%', #{url}, '%')</if> <if test="url != null and url != ''"> and url like concat('%', #{url}, '%')</if>
<if test="sortOrder != null "> and sort_order = #{sortOrder}</if>
<if test="status != null "> and status = #{status}</if> <if test="status != null "> and status = #{status}</if>
<if test="brandImg != null and brandImg != ''"> and brand_img like concat('%', #{brandImg}, '%')</if> <if test="brandImg != null and brandImg != ''"> and brand_img like concat('%', #{brandImg}, '%')</if>
<if test="orderNum != null "> and order_num = #{orderNum}</if>
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if> <if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
<if test="tenantId != null and tenantId != ''"> and tenant_id like concat('%', #{tenantId}, '%')</if> <if test="tenantId != null and tenantId != ''"> and tenant_id like concat('%', #{tenantId}, '%')</if>
<if test="delFlag != null and delFlag != ''"> and del_flag like concat('%', #{delFlag}, '%')</if> <if test="delFlag != null and delFlag != ''"> and del_flag like concat('%', #{delFlag}, '%')</if>
@ -46,12 +49,14 @@
<if test="createTime != null "> and create_time = #{createTime}</if> <if test="createTime != null "> and create_time = #{createTime}</if>
<if test="updateBy != null and updateBy != ''"> and update_by like concat('%', #{updateBy}, '%')</if> <if test="updateBy != null and updateBy != ''"> and update_by like concat('%', #{updateBy}, '%')</if>
<if test="updateTime != null "> and update_time = #{updateTime}</if> <if test="updateTime != null "> and update_time = #{updateTime}</if>
<if test="createSite != null and createSite != ''"> and create_site like concat('%', #{createSite}, '%')</if>
<if test="updateSite != null and updateSite != ''"> and update_site like concat('%', #{updateSite}, '%')</if>
</where> </where>
order by create_time desc order by create_time desc
</select> </select>
<select id="selectEmisBrandById" parameterType="Long" resultMap="EmisBrandResult"> <select id="selectEmisBrandById" parameterType="Long" resultMap="EmisBrandResult">
select id, code, name, name_en, logo, url, sort_order, status, brand_img, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time select id, code, name, name_en, logo, url, status, brand_img, order_num, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
from emis_brand a from emis_brand a
where a.id = #{id} where a.id = #{id}
</select> </select>
@ -65,9 +70,9 @@
<if test="nameEn != null and nameEn != ''">name_en,</if> <if test="nameEn != null and nameEn != ''">name_en,</if>
<if test="logo != null and logo != ''">logo,</if> <if test="logo != null and logo != ''">logo,</if>
<if test="url != null and url != ''">url,</if> <if test="url != null and url != ''">url,</if>
<if test="sortOrder != null">sort_order,</if>
<if test="status != null">status,</if> <if test="status != null">status,</if>
<if test="brandImg != null and brandImg != ''">brand_img,</if> <if test="brandImg != null and brandImg != ''">brand_img,</if>
<if test="orderNum != null">order_num,</if>
<if test="remark != null and remark != ''">remark,</if> <if test="remark != null and remark != ''">remark,</if>
<if test="tenantId != null and tenantId != ''">tenant_id,</if> <if test="tenantId != null and tenantId != ''">tenant_id,</if>
<if test="delFlag != null and delFlag != ''">del_flag,</if> <if test="delFlag != null and delFlag != ''">del_flag,</if>
@ -75,6 +80,8 @@
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
<if test="updateBy != null and updateBy != ''">update_by,</if> <if test="updateBy != null and updateBy != ''">update_by,</if>
<if test="updateTime != null">update_time,</if> <if test="updateTime != null">update_time,</if>
<if test="createSite != null and createSite != ''">create_site,</if>
<if test="updateSite != null and updateSite != ''">update_site,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if> <if test="id != null">#{id},</if>
@ -83,9 +90,9 @@
<if test="nameEn != null and nameEn != ''">#{nameEn},</if> <if test="nameEn != null and nameEn != ''">#{nameEn},</if>
<if test="logo != null and logo != ''">#{logo},</if> <if test="logo != null and logo != ''">#{logo},</if>
<if test="url != null and url != ''">#{url},</if> <if test="url != null and url != ''">#{url},</if>
<if test="sortOrder != null">#{sortOrder},</if>
<if test="status != null">#{status},</if> <if test="status != null">#{status},</if>
<if test="brandImg != null and brandImg != ''">#{brandImg},</if> <if test="brandImg != null and brandImg != ''">#{brandImg},</if>
<if test="orderNum != null">#{orderNum},</if>
<if test="remark != null and remark != ''">#{remark},</if> <if test="remark != null and remark != ''">#{remark},</if>
<if test="tenantId != null and tenantId != ''">#{tenantId},</if> <if test="tenantId != null and tenantId != ''">#{tenantId},</if>
<if test="delFlag != null and delFlag != ''">#{delFlag},</if> <if test="delFlag != null and delFlag != ''">#{delFlag},</if>
@ -93,6 +100,8 @@
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
<if test="updateBy != null and updateBy != ''">#{updateBy},</if> <if test="updateBy != null and updateBy != ''">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if> <if test="updateTime != null">#{updateTime},</if>
<if test="createSite != null and createSite != ''">#{createSite},</if>
<if test="updateSite != null and updateSite != ''">#{updateSite},</if>
</trim> </trim>
</insert> </insert>
@ -104,9 +113,9 @@
<if test="nameEn != null and nameEn != ''">name_en = #{nameEn},</if> <if test="nameEn != null and nameEn != ''">name_en = #{nameEn},</if>
<if test="logo != null and logo != ''">logo = #{logo},</if> <if test="logo != null and logo != ''">logo = #{logo},</if>
<if test="url != null and url != ''">url = #{url},</if> <if test="url != null and url != ''">url = #{url},</if>
<if test="sortOrder != null">sort_order = #{sortOrder},</if>
<if test="status != null">status = #{status},</if> <if test="status != null">status = #{status},</if>
<if test="brandImg != null and brandImg != ''">brand_img = #{brandImg},</if> <if test="brandImg != null and brandImg != ''">brand_img = #{brandImg},</if>
<if test="orderNum != null">order_num = #{orderNum},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if> <if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="tenantId != null and tenantId != ''">tenant_id = #{tenantId},</if> <if test="tenantId != null and tenantId != ''">tenant_id = #{tenantId},</if>
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if> <if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
@ -114,16 +123,18 @@
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createSite != null and createSite != ''">create_site = #{createSite},</if>
<if test="updateSite != null and updateSite != ''">update_site = #{updateSite},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>
<delete id="deleteEmisBrandById" parameterType="Long"> <delete id="deleteEmisBrandById" parameterType="Long">
delete from emis_brand where id = #{id} update emis_brand set del_flag='1' where id = #{id}
</delete> </delete>
<delete id="deleteEmisBrandByIds" parameterType="String"> <delete id="deleteEmisBrandByIds" parameterType="String">
delete from emis_brand where id in update emis_brand set del_flag='1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>