星空对接接口开发

This commit is contained in:
16358 2025-06-13 16:53:45 +08:00
parent 2086c976dd
commit 69b485985d
5 changed files with 113 additions and 79 deletions

View File

@ -29,6 +29,14 @@ public interface IPoundappliService extends IService<Poundappli>
*/ */
public List<Poundappli> selectPoundappliList(Poundappli poundappli); public List<Poundappli> selectPoundappliList(Poundappli poundappli);
/**
* 新增过磅申请通过mapper层调用
*
* @param poundappli 过磅申请
* @return 结果
*/
public int insertPoundappliDpi(Poundappli poundappli);
/** /**
* 新增过磅申请 * 新增过磅申请
* *

View File

@ -46,12 +46,26 @@ public class PoundappliServiceImpl extends ServiceImpl<PoundappliMapper, Poundap
} }
/** /**
* 新增过磅申请 * 新增过磅申请通过mapper层调用
* *
* @param poundappli 过磅申请 * @param poundappli 过磅申请
* @return 结果 * @return 结果
*/ */
@Override @Override
public int insertPoundappliDpi(Poundappli poundappli)
{
poundappli.initAddFields(poundappli);
int i = poundappliMapper.insertPoundappli(poundappli);
return i;
}
/**
* 新增过磅申请
*
* @param poundappli 过磅申请
* @return 结果
*/
@Override
public int insertPoundappli(Poundappli poundappli) public int insertPoundappli(Poundappli poundappli)
{ {
poundappli.initAddFields(poundappli); poundappli.initAddFields(poundappli);

View File

@ -9,7 +9,6 @@ import com.ruoyi.system.service.ISysConfigService;
import com.ruoyi.system.service.ISysDictTypeService; import com.ruoyi.system.service.ISysDictTypeService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.IOException; import java.io.IOException;
import java.io.InputStreamReader; import java.io.InputStreamReader;
@ -17,7 +16,6 @@ import java.io.OutputStream;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.net.HttpURLConnection; import java.net.HttpURLConnection;
import java.net.URL; import java.net.URL;
import java.time.Instant;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.ZoneId; import java.time.ZoneId;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
@ -130,7 +128,6 @@ public class ApiTask {
for (SysDictData sysDictData : oaFormid) { for (SysDictData sysDictData : oaFormid) {
String dictValue = sysDictData.getDictValue(); String dictValue = sysDictData.getDictValue();
String oaData = getOAData(dictValue); String oaData = getOAData(dictValue);
System.out.println(oaData);
if (oaData != null && !oaData.isEmpty()){ if (oaData != null && !oaData.isEmpty()){
if (oaData.contains("ErrorCode")){ if (oaData.contains("ErrorCode")){
errorLog.append(errorCount++ + ""+ "获取"+ sysDictData.getDictLabel() + "数据失败!:" + oaData + "\n"); errorLog.append(errorCount++ + ""+ "获取"+ sysDictData.getDictLabel() + "数据失败!:" + oaData + "\n");
@ -271,10 +268,11 @@ public class ApiTask {
// 3. 保存过磅申请 // 3. 保存过磅申请
Poundappli poundappli = new Poundappli(); Poundappli poundappli = new Poundappli();
poundappli.setBllstate("1");//过磅状态
poundappli.setBsndt(date); poundappli.setBsndt(date);
poundappli.setUsrcode(billNo); poundappli.setUsrcode(billNo);
poundappli.setCarno(carno); poundappli.setCarno(carno);
poundappli.setSendunitid(Long.valueOf(company)); poundappli.setSendunitname(company);
poundappli.setItmname(materialName); poundappli.setItmname(materialName);
poundappli.setSpecification(specification); poundappli.setSpecification(specification);
poundappli.setSrccleanmqty(new BigDecimal(weight)); poundappli.setSrccleanmqty(new BigDecimal(weight));
@ -284,6 +282,7 @@ public class ApiTask {
poundappli.setSrcbillusrcode(sourceBillNo); poundappli.setSrcbillusrcode(sourceBillNo);
poundappli.setOabilltype(formid);//星空单据类型 poundappli.setOabilltype(formid);//星空单据类型
poundappli.setSrcbilltype("发货通知单");//来源单据类型 poundappli.setSrcbilltype("发货通知单");//来源单据类型
poundappliService.insertPoundappli(poundappli); poundappliService.insertPoundappli(poundappli);
} }
} }

View File

@ -90,78 +90,78 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<insert id="insertPoundappli" parameterType="Poundappli"> <insert id="insertPoundappli" parameterType="Poundappli">
INSERT INTO t_data_poundappli insert IGNORE into t_data_poundappli
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if> <if test="id != null">id,</if>
<if test="bllstate != null">bllstate,</if> <if test="bllstate != null">bllstate,</if>
<if test="usrcode != null and usrcode != ''">usrcode,</if> <if test="usrcode != null and usrcode != ''">usrcode,</if>
<if test="bsndt != null">bsndt,</if> <if test="bsndt != null">bsndt,</if>
<if test="carno != null">carno,</if> <if test="carno != null">carno,</if>
<if test="itmname != null">itmname,</if> <if test="itmname != null">itmname,</if>
<if test="specification != null">specification,</if> <if test="specification != null">specification,</if>
<if test="sendunitid != null">sendunitid,</if> <if test="sendunitid != null">sendunitid,</if>
<if test="sendunitname != null">sendunitname,</if> <if test="sendunitname != null">sendunitname,</if>
<if test="recentname != null">recentname,</if> <if test="recentname != null">recentname,</if>
<if test="trnentname != null">trnentname,</if> <if test="trnentname != null">trnentname,</if>
<if test="srcpunbll != null">srcpunbll,</if> <if test="srcpunbll != null">srcpunbll,</if>
<if test="srcwghmqty != null">srcwghmqty,</if> <if test="srcwghmqty != null">srcwghmqty,</if>
<if test="srcempmqty != null">srcempmqty,</if> <if test="srcempmqty != null">srcempmqty,</if>
<if test="srccleanmqty != null">srccleanmqty,</if> <if test="srccleanmqty != null">srccleanmqty,</if>
<if test="srcbsndt != null">srcbsndt,</if> <if test="srcbsndt != null">srcbsndt,</if>
<if test="msrunit != null">msrunit,</if> <if test="msrunit != null">msrunit,</if>
<if test="msrname != null">msrname,</if> <if test="msrname != null">msrname,</if>
<if test="itmno != null">itmno,</if> <if test="itmno != null">itmno,</if>
<if test="cardriver != null">cardriver,</if> <if test="cardriver != null">cardriver,</if>
<if test="poundid != null">poundid,</if> <if test="poundid != null">poundid,</if>
<if test="poundname != null">poundname,</if> <if test="poundname != null">poundname,</if>
<if test="srcbillusrcode != null">srcbillusrcode,</if> <if test="srcbillusrcode != null">srcbillusrcode,</if>
<if test="crtorgid != null">crtorgid,</if> <if test="crtorgid != null">crtorgid,</if>
<if test="isinuse != null">isinuse,</if> <if test="isinuse != null">isinuse,</if>
<if test="crtdt != null">crtdt,</if> <if test="crtdt != null">crtdt,</if>
<if test="crtopr != null">crtopr,</if> <if test="crtopr != null">crtopr,</if>
<if test="lstedtdt != null">lstedtdt,</if> <if test="lstedtdt != null">lstedtdt,</if>
<if test="lstedtopr != null">lstedtopr,</if> <if test="lstedtopr != null">lstedtopr,</if>
<if test="fid != null">fid,</if> <if test="fid != null">fid,</if>
<if test="fentity_fentryid != null">fentity_fentryid,</if> <if test="fentity_fentryid != null">fentity_fentryid,</if>
<if test="oabilltype != null">oabilltype,</if> <if test="oabilltype != null">oabilltype,</if>
<if test="remark != null">remark,</if> <if test="remark != null">remark,</if>
</trim> </trim>
<trim prefix="SELECT " suffix=" FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM t_data_poundappli WHERE fentity_fentryid = #{fentity_fentryid})"> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if><if test="id == null">NULL,</if> <if test="id != null">#{id},</if>
<if test="bllstate != null">#{bllstate},</if><if test="bllstate == null">NULL,</if> <if test="bllstate != null">#{bllstate},</if>
<if test="usrcode != null and usrcode != ''">#{usrcode},</if><if test="usrcode == null or usrcode == ''">NULL,</if> <if test="usrcode != null and usrcode != ''">#{usrcode},</if>
<if test="bsndt != null">#{bsndt},</if><if test="bsndt == null">NULL,</if> <if test="bsndt != null">#{bsndt},</if>
<if test="carno != null">#{carno},</if><if test="carno == null">NULL,</if> <if test="carno != null">#{carno},</if>
<if test="itmname != null">#{itmname},</if><if test="itmname == null">NULL,</if> <if test="itmname != null">#{itmname},</if>
<if test="specification != null">#{specification},</if><if test="specification == null">NULL,</if> <if test="specification != null">#{specification},</if>
<if test="sendunitid != null">#{sendunitid},</if><if test="sendunitid == null">NULL,</if> <if test="sendunitid != null">#{sendunitid},</if>
<if test="sendunitname != null">#{sendunitname},</if><if test="sendunitname == null">NULL,</if> <if test="sendunitname != null">#{sendunitname},</if>
<if test="recentname != null">#{recentname},</if><if test="recentname == null">NULL,</if> <if test="recentname != null">#{recentname},</if>
<if test="trnentname != null">#{trnentname},</if><if test="trnentname == null">NULL,</if> <if test="trnentname != null">#{trnentname},</if>
<if test="srcpunbll != null">#{srcpunbll},</if><if test="srcpunbll == null">NULL,</if> <if test="srcpunbll != null">#{srcpunbll},</if>
<if test="srcwghmqty != null">#{srcwghmqty},</if><if test="srcwghmqty == null">NULL,</if> <if test="srcwghmqty != null">#{srcwghmqty},</if>
<if test="srcempmqty != null">#{srcempmqty},</if><if test="srcempmqty == null">NULL,</if> <if test="srcempmqty != null">#{srcempmqty},</if>
<if test="srccleanmqty != null">#{srccleanmqty},</if><if test="srccleanmqty == null">NULL,</if> <if test="srccleanmqty != null">#{srccleanmqty},</if>
<if test="srcbsndt != null">#{srcbsndt},</if><if test="srcbsndt == null">NULL,</if> <if test="srcbsndt != null">#{srcbsndt},</if>
<if test="msrunit != null">#{msrunit},</if><if test="msrunit == null">NULL,</if> <if test="msrunit != null">#{msrunit},</if>
<if test="msrname != null">#{msrname},</if><if test="msrname == null">NULL,</if> <if test="msrname != null">#{msrname},</if>
<if test="itmno != null">#{itmno},</if><if test="itmno == null">NULL,</if> <if test="itmno != null">#{itmno},</if>
<if test="cardriver != null">#{cardriver},</if><if test="cardriver == null">NULL,</if> <if test="cardriver != null">#{cardriver},</if>
<if test="poundid != null">#{poundid},</if><if test="poundid == null">NULL,</if> <if test="poundid != null">#{poundid},</if>
<if test="poundname != null">#{poundname},</if><if test="poundname == null">NULL,</if> <if test="poundname != null">#{poundname},</if>
<if test="srcbillusrcode != null">#{srcbillusrcode},</if><if test="srcbillusrcode == null">NULL,</if> <if test="srcbillusrcode != null">#{srcbillusrcode},</if>
<if test="crtorgid != null">#{crtorgid},</if><if test="crtorgid == null">NULL,</if> <if test="crtorgid != null">#{crtorgid},</if>
<if test="isinuse != null">#{isinuse},</if><if test="isinuse == null">NULL,</if> <if test="isinuse != null">#{isinuse},</if>
<if test="crtdt != null">#{crtdt},</if><if test="crtdt == null">NULL,</if> <if test="crtdt != null">#{crtdt},</if>
<if test="crtopr != null">#{crtopr},</if><if test="crtopr == null">NULL,</if> <if test="crtopr != null">#{crtopr},</if>
<if test="lstedtdt != null">#{lstedtdt},</if><if test="lstedtdt == null">NULL,</if> <if test="lstedtdt != null">#{lstedtdt},</if>
<if test="lstedtopr != null">#{lstedtopr},</if><if test="lstedtopr == null">NULL,</if> <if test="lstedtopr != null">#{lstedtopr},</if>
<if test="fid != null">#{fid},</if><if test="fid == null">NULL,</if> <if test="fid != null">#{fid},</if>
<if test="fentity_fentryid != null">#{fentity_fentryid},</if><if test="fentity_fentryid == null">NULL,</if> <if test="fentity_fentryid != null">#{fentity_fentryid},</if>
<if test="oabilltype != null">#{oabilltype},</if><if test="oabilltype == null">NULL,</if> <if test="oabilltype != null">#{oabilltype},</if>
<if test="remark != null">#{remark},</if><if test="remark == null">NULL,</if> <if test="remark != null">#{remark},</if>
</trim> </trim>
</insert> </insert>
<update id="updatePoundappli" parameterType="Poundappli"> <update id="updatePoundappli" parameterType="Poundappli">

View File

@ -193,7 +193,14 @@ public class BaseEntity implements Serializable
* 初始化新增实体的通用字段 * 初始化新增实体的通用字段
*/ */
public void initAddFields(BaseEntity entity) { public void initAddFields(BaseEntity entity) {
String currentUser = SecurityUtils.getUsername(); // 获取当前登录用户 String currentUser = "admin";
// 获取当前登录用户
try {
currentUser = SecurityUtils.getUsername();
} catch (Exception e) {
//Do nothing
}
Date now = new Date(); Date now = new Date();
entity.setIsinuse("Y"); // 默认启用状态 entity.setIsinuse("Y"); // 默认启用状态
@ -207,7 +214,13 @@ public class BaseEntity implements Serializable
* 更新实体的修改字段 * 更新实体的修改字段
*/ */
public void initUpdateFields(BaseEntity entity) { public void initUpdateFields(BaseEntity entity) {
String currentUser = SecurityUtils.getUsername(); // 获取当前登录用户 String currentUser = "admin";
// 获取当前登录用户
try {
currentUser = SecurityUtils.getUsername();
} catch (Exception e) {
//Do nothing
}
Date now = new Date(); Date now = new Date();
entity.setLstedtdt(now); // 更新最后修改时间 entity.setLstedtdt(now); // 更新最后修改时间