新增 交接

master
wangh 6 months ago
parent f30ae39600
commit 31d48cfdec

@ -1,31 +1,48 @@
<?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">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bgs.system.mapper.BaseLocationInfoMapper">
<resultMap type="BaseLocationInfo" id="BaseLocationInfoResult">
<result property="objId" column="obj_id" />
<result property="locationCode" column="location_code" />
<result property="locationName" column="location_name" />
<result property="localtionType" column="localtion_type" />
<result property="locationDescribe" column="location_describe" />
<result property="storeCode" column="store_code" />
<result property="maxAmount" column="max_amount" />
<result property="usedAmount" column="used_amount" />
<result property="maxVolume" column="max_volume" />
<result property="usedVolume" column="used_volume" />
<result property="locationStatus" column="location_status" />
<result property="isFlag" column="is_flag" />
<result property="remark" column="remark" />
<result property="createdBy" column="created_by" />
<result property="createdTime" column="created_time" />
<result property="updatedBy" column="updated_by" />
<result property="updatedTime" column="updated_time" />
<result property="objId" column="obj_id"/>
<result property="locationCode" column="location_code"/>
<result property="locationName" column="location_name"/>
<result property="localtionType" column="localtion_type"/>
<result property="locationDescribe" column="location_describe"/>
<result property="storeCode" column="store_code"/>
<result property="maxAmount" column="max_amount"/>
<result property="usedAmount" column="used_amount"/>
<result property="maxVolume" column="max_volume"/>
<result property="usedVolume" column="used_volume"/>
<result property="locationStatus" column="location_status"/>
<result property="isFlag" column="is_flag"/>
<result property="remark" column="remark"/>
<result property="createdBy" column="created_by"/>
<result property="createdTime" column="created_time"/>
<result property="updatedBy" column="updated_by"/>
<result property="updatedTime" column="updated_time"/>
</resultMap>
<sql id="selectBaseLocationInfoVo">
select obj_id, location_code, location_name, localtion_type, location_describe, store_code, max_amount, used_amount, max_volume, used_volume, location_status, is_flag, remark, created_by, created_time, updated_by, updated_time from base_location_info
select obj_id,
location_code,
location_name,
localtion_type,
location_describe,
store_code,
max_amount,
used_amount,
max_volume,
used_volume,
location_status,
is_flag,
remark,
created_by,
created_time,
updated_by,
updated_time
from base_location_info
</sql>
@ -50,13 +67,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from base_location_info t1
left join base_basket_info t2 on t1.remark = t2.basket_epc
<where>
<if test="locationCode != null and locationCode != ''"> and t1.location_code = #{locationCode}</if>
<if test="locationName != null and locationName != ''"> and t1.location_name like concat('%', #{locationName}, '%')</if>
<if test="localtionType != null "> and t1.localtion_type = #{localtionType}</if>
<if test="storeCode != null and storeCode != ''"> and t1.store_code = #{storeCode}</if>
<if test="locationStatus != null "> and t1.location_status = #{locationStatus}</if>
<if test="isFlag != null "> and t1.is_flag = #{isFlag}</if>
<if test="params.beginUpdatedTime != null and params.beginUpdatedTime != '' and params.endUpdatedTime != null and params.endUpdatedTime != ''"> and t1.updated_time between #{params.beginUpdatedTime} and #{params.endUpdatedTime}</if>
<if test="locationCode != null and locationCode != ''">and t1.location_code = #{locationCode}</if>
<if test="locationName != null and locationName != ''">and t1.location_name like concat('%',
#{locationName}, '%')
</if>
<if test="localtionType != null ">and t1.localtion_type = #{localtionType}</if>
<if test="storeCode != null and storeCode != ''">and t1.store_code = #{storeCode}</if>
<if test="locationStatus != null ">and t1.location_status = #{locationStatus}</if>
<if test="isFlag != null ">and t1.is_flag = #{isFlag}</if>
<if test="params.beginUpdatedTime != null and params.beginUpdatedTime != '' and params.endUpdatedTime != null and params.endUpdatedTime != ''">
and t1.updated_time between #{params.beginUpdatedTime} and #{params.endUpdatedTime}
</if>
</where>
</select>
@ -84,7 +105,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createdTime != null">created_time,</if>
<if test="updatedBy != null">updated_by,</if>
<if test="updatedTime != null">updated_time,</if>
</trim>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="locationCode != null">#{locationCode},</if>
<if test="locationName != null">#{locationName},</if>
@ -102,7 +123,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createdTime != null">#{createdTime},</if>
<if test="updatedBy != null">#{updatedBy},</if>
<if test="updatedTime != null">#{updatedTime},</if>
</trim>
</trim>
</insert>
<update id="updateBaseLocationInfo" parameterType="BaseLocationInfo">
@ -129,7 +150,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<delete id="deleteBaseLocationInfoByObjId" parameterType="Long">
delete from base_location_info where obj_id = #{objId}
delete
from base_location_info
where obj_id = #{objId}
</delete>
<delete id="deleteBaseLocationInfoByObjIds" parameterType="String">

@ -27,10 +27,11 @@ public class ApiController {
@PostMapping("/bindingSubmit")
public AjaxResult bindingSubmit(@RequestBody BindingSubmitBeen submitBeen) {
List<String> watBills = submitBeen.getWatBills();
String user = submitBeen.getUser();
watBills.forEach(code -> {
String epc = service.selectEpcByWaybill(code);
if (epc == null) {
int i = service.insertLedgerBinding(submitBeen.getEpc(), code);
int i = service.insertLedgerBinding(submitBeen.getEpc(), code, user);
}
});
@ -38,7 +39,6 @@ public class ApiController {
}
@PostMapping("/findBindingList")
public AjaxResult findBindingList(String epc) {
List<String> codes = service.findBindingList(epc);
@ -50,26 +50,36 @@ public class ApiController {
@PostMapping("/deleteBindingList")
public AjaxResult deleteBindingList(String epc) {
int i = service.deleteBindingList(epc);
if (i>0) return AjaxResult.success("全部解绑成功");
if (i > 0) return AjaxResult.success("全部解绑成功");
return AjaxResult.error();
}
@PostMapping("/deleteBindingItem")
public AjaxResult deleteBindingItem(String epc, String code) {
int i = service.deleteBindingItem(epc,code);
if (i==1) return AjaxResult.success("运单:" +code +"解绑成功");
int i = service.deleteBindingItem(epc, code);
if (i == 1) return AjaxResult.success("运单:" + code + "解绑成功");
return AjaxResult.error();
}
@PostMapping("/blueToothSubmit")
public AjaxResult blueToothSubmit(String locationCode, String hkCode) {
int i = service.blueToothSubmit(locationCode,hkCode);
if (i>0){
int i = service.blueToothSubmit(locationCode, hkCode);
if (i > 0) {
return AjaxResult.success();
}
return AjaxResult.error("库位没有维护");
}
@PostMapping("/jion/select")
public AjaxResult jionSelect(String user) {
List<String> list = service.jionSelect(user);
if (list == null || list.isEmpty()) return AjaxResult.error("账号无绑定记录");
return AjaxResult.success(list);
}
/* @GetMapping("/getVersion")
public String getVersion(){
APKVersion apkVersion=service.getVersion();

@ -13,6 +13,15 @@ public class BindingSubmitBeen {
private String number;
private String weight;
private List<String> watBills;
private String user;
public String getUser() {
return user;
}
public void setUser(String user) {
this.user = user;
}
public String getEpc() {
return epc;

@ -14,7 +14,7 @@ public interface ApiMapper {
String selectEpcByWaybill(String code);
int insertLedgerBinding(String epc, String code);
int insertLedgerBinding(String epc, String code,String user);
@ -25,4 +25,6 @@ public interface ApiMapper {
int deleteBindingItem(String epc, String code);
int blueToothSubmit(String locationCode, String hkCode);
List<String> jionSelect(String user);
}

@ -23,8 +23,8 @@ public class ApiService {
return mapper.selectEpcByWaybill(code);
}
public int insertLedgerBinding(String epc, String code) {
return mapper.insertLedgerBinding(epc,code);
public int insertLedgerBinding(String epc, String code, String user) {
return mapper.insertLedgerBinding(epc,code,user);
}
@ -43,4 +43,8 @@ public class ApiService {
public int blueToothSubmit(String locationCode, String hkCode) {
return mapper.blueToothSubmit(locationCode,hkCode);
}
public List<String> jionSelect(String user) {
return mapper.jionSelect(user);
}
}

@ -2,12 +2,12 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bgs.webapi.mapper.ApiMapper">
<!--登陆-->
<select id="selectEpcByWaybill" resultType="string">
select cargo_frame_epc from ledger_instant_binding where waybill_number=#{code} limit 1
</select>
<insert id="insertLedgerBinding">
INSERT INTO ledger_instant_binding (cargo_frame_epc, waybill_number) VALUES (#{param1}, #{param2});
INSERT INTO ledger_instant_binding (cargo_frame_epc, waybill_number,create_by) VALUES (#{param1}, #{param2},#{param3});
</insert>
<select id="findBindingList" resultType="string">
@ -20,6 +20,11 @@
delete from ledger_instant_binding WHERE cargo_frame_epc = #{param1} and waybill_number = #{param2}
</delete>
<update id="blueToothSubmit">
UPDATE base_location_info SET remark = null WHERE remark = #{param2};
UPDATE base_location_info SET remark = #{param2} WHERE location_code = #{param1}
</update>
<select id="jionSelect" resultType="string">
select cargo_frame_epc from ledger_instant_binding where create_by = #{user} group by cargo_frame_epc;
</select>
</mapper>
Loading…
Cancel
Save