星空对接接口开发
This commit is contained in:
parent
2086c976dd
commit
69b485985d
|
@ -29,6 +29,14 @@ public interface IPoundappliService extends IService<Poundappli>
|
|||
*/
|
||||
public List<Poundappli> selectPoundappliList(Poundappli poundappli);
|
||||
|
||||
/**
|
||||
* 新增过磅申请(通过mapper层调用)
|
||||
*
|
||||
* @param poundappli 过磅申请
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertPoundappliDpi(Poundappli poundappli);
|
||||
|
||||
/**
|
||||
* 新增过磅申请
|
||||
*
|
||||
|
|
|
@ -45,6 +45,20 @@ public class PoundappliServiceImpl extends ServiceImpl<PoundappliMapper, Poundap
|
|||
return poundappliMapper.selectPoundappliList(poundappli);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增过磅申请(通过mapper层调用)
|
||||
*
|
||||
* @param poundappli 过磅申请
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertPoundappliDpi(Poundappli poundappli)
|
||||
{
|
||||
poundappli.initAddFields(poundappli);
|
||||
int i = poundappliMapper.insertPoundappli(poundappli);
|
||||
return i;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增过磅申请
|
||||
*
|
||||
|
|
|
@ -9,7 +9,6 @@ import com.ruoyi.system.service.ISysConfigService;
|
|||
import com.ruoyi.system.service.ISysDictTypeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
|
@ -17,7 +16,6 @@ import java.io.OutputStream;
|
|||
import java.math.BigDecimal;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
@ -130,7 +128,6 @@ public class ApiTask {
|
|||
for (SysDictData sysDictData : oaFormid) {
|
||||
String dictValue = sysDictData.getDictValue();
|
||||
String oaData = getOAData(dictValue);
|
||||
System.out.println(oaData);
|
||||
if (oaData != null && !oaData.isEmpty()){
|
||||
if (oaData.contains("ErrorCode")){
|
||||
errorLog.append(errorCount++ + "、"+ "获取"+ sysDictData.getDictLabel() + "数据失败!:" + oaData + "\n");
|
||||
|
@ -271,10 +268,11 @@ public class ApiTask {
|
|||
|
||||
// 3. 保存过磅申请
|
||||
Poundappli poundappli = new Poundappli();
|
||||
poundappli.setBllstate("1");//过磅状态
|
||||
poundappli.setBsndt(date);
|
||||
poundappli.setUsrcode(billNo);
|
||||
poundappli.setCarno(carno);
|
||||
poundappli.setSendunitid(Long.valueOf(company));
|
||||
poundappli.setSendunitname(company);
|
||||
poundappli.setItmname(materialName);
|
||||
poundappli.setSpecification(specification);
|
||||
poundappli.setSrccleanmqty(new BigDecimal(weight));
|
||||
|
@ -284,6 +282,7 @@ public class ApiTask {
|
|||
poundappli.setSrcbillusrcode(sourceBillNo);
|
||||
poundappli.setOabilltype(formid);//星空单据类型
|
||||
poundappli.setSrcbilltype("发货通知单");//来源单据类型
|
||||
|
||||
poundappliService.insertPoundappli(poundappli);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -90,7 +90,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
|
||||
<insert id="insertPoundappli" parameterType="Poundappli">
|
||||
INSERT INTO t_data_poundappli
|
||||
insert IGNORE into t_data_poundappli
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="bllstate != null">bllstate,</if>
|
||||
|
@ -126,40 +126,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="oabilltype != null">oabilltype,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="SELECT " suffix=" FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM t_data_poundappli WHERE fentity_fentryid = #{fentity_fentryid})">
|
||||
<if test="id != null">#{id},</if><if test="id == null">NULL,</if>
|
||||
<if test="bllstate != null">#{bllstate},</if><if test="bllstate == null">NULL,</if>
|
||||
<if test="usrcode != null and usrcode != ''">#{usrcode},</if><if test="usrcode == null or usrcode == ''">NULL,</if>
|
||||
<if test="bsndt != null">#{bsndt},</if><if test="bsndt == null">NULL,</if>
|
||||
<if test="carno != null">#{carno},</if><if test="carno == null">NULL,</if>
|
||||
<if test="itmname != null">#{itmname},</if><if test="itmname == null">NULL,</if>
|
||||
<if test="specification != null">#{specification},</if><if test="specification == null">NULL,</if>
|
||||
<if test="sendunitid != null">#{sendunitid},</if><if test="sendunitid == null">NULL,</if>
|
||||
<if test="sendunitname != null">#{sendunitname},</if><if test="sendunitname == null">NULL,</if>
|
||||
<if test="recentname != null">#{recentname},</if><if test="recentname == null">NULL,</if>
|
||||
<if test="trnentname != null">#{trnentname},</if><if test="trnentname == null">NULL,</if>
|
||||
<if test="srcpunbll != null">#{srcpunbll},</if><if test="srcpunbll == null">NULL,</if>
|
||||
<if test="srcwghmqty != null">#{srcwghmqty},</if><if test="srcwghmqty == null">NULL,</if>
|
||||
<if test="srcempmqty != null">#{srcempmqty},</if><if test="srcempmqty == null">NULL,</if>
|
||||
<if test="srccleanmqty != null">#{srccleanmqty},</if><if test="srccleanmqty == null">NULL,</if>
|
||||
<if test="srcbsndt != null">#{srcbsndt},</if><if test="srcbsndt == null">NULL,</if>
|
||||
<if test="msrunit != null">#{msrunit},</if><if test="msrunit == null">NULL,</if>
|
||||
<if test="msrname != null">#{msrname},</if><if test="msrname == null">NULL,</if>
|
||||
<if test="itmno != null">#{itmno},</if><if test="itmno == null">NULL,</if>
|
||||
<if test="cardriver != null">#{cardriver},</if><if test="cardriver == null">NULL,</if>
|
||||
<if test="poundid != null">#{poundid},</if><if test="poundid == null">NULL,</if>
|
||||
<if test="poundname != null">#{poundname},</if><if test="poundname == null">NULL,</if>
|
||||
<if test="srcbillusrcode != null">#{srcbillusrcode},</if><if test="srcbillusrcode == null">NULL,</if>
|
||||
<if test="crtorgid != null">#{crtorgid},</if><if test="crtorgid == null">NULL,</if>
|
||||
<if test="isinuse != null">#{isinuse},</if><if test="isinuse == null">NULL,</if>
|
||||
<if test="crtdt != null">#{crtdt},</if><if test="crtdt == null">NULL,</if>
|
||||
<if test="crtopr != null">#{crtopr},</if><if test="crtopr == null">NULL,</if>
|
||||
<if test="lstedtdt != null">#{lstedtdt},</if><if test="lstedtdt == null">NULL,</if>
|
||||
<if test="lstedtopr != null">#{lstedtopr},</if><if test="lstedtopr == null">NULL,</if>
|
||||
<if test="fid != null">#{fid},</if><if test="fid == null">NULL,</if>
|
||||
<if test="fentity_fentryid != null">#{fentity_fentryid},</if><if test="fentity_fentryid == null">NULL,</if>
|
||||
<if test="oabilltype != null">#{oabilltype},</if><if test="oabilltype == null">NULL,</if>
|
||||
<if test="remark != null">#{remark},</if><if test="remark == null">NULL,</if>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="bllstate != null">#{bllstate},</if>
|
||||
<if test="usrcode != null and usrcode != ''">#{usrcode},</if>
|
||||
<if test="bsndt != null">#{bsndt},</if>
|
||||
<if test="carno != null">#{carno},</if>
|
||||
<if test="itmname != null">#{itmname},</if>
|
||||
<if test="specification != null">#{specification},</if>
|
||||
<if test="sendunitid != null">#{sendunitid},</if>
|
||||
<if test="sendunitname != null">#{sendunitname},</if>
|
||||
<if test="recentname != null">#{recentname},</if>
|
||||
<if test="trnentname != null">#{trnentname},</if>
|
||||
<if test="srcpunbll != null">#{srcpunbll},</if>
|
||||
<if test="srcwghmqty != null">#{srcwghmqty},</if>
|
||||
<if test="srcempmqty != null">#{srcempmqty},</if>
|
||||
<if test="srccleanmqty != null">#{srccleanmqty},</if>
|
||||
<if test="srcbsndt != null">#{srcbsndt},</if>
|
||||
<if test="msrunit != null">#{msrunit},</if>
|
||||
<if test="msrname != null">#{msrname},</if>
|
||||
<if test="itmno != null">#{itmno},</if>
|
||||
<if test="cardriver != null">#{cardriver},</if>
|
||||
<if test="poundid != null">#{poundid},</if>
|
||||
<if test="poundname != null">#{poundname},</if>
|
||||
<if test="srcbillusrcode != null">#{srcbillusrcode},</if>
|
||||
<if test="crtorgid != null">#{crtorgid},</if>
|
||||
<if test="isinuse != null">#{isinuse},</if>
|
||||
<if test="crtdt != null">#{crtdt},</if>
|
||||
<if test="crtopr != null">#{crtopr},</if>
|
||||
<if test="lstedtdt != null">#{lstedtdt},</if>
|
||||
<if test="lstedtopr != null">#{lstedtopr},</if>
|
||||
<if test="fid != null">#{fid},</if>
|
||||
<if test="fentity_fentryid != null">#{fentity_fentryid},</if>
|
||||
<if test="oabilltype != null">#{oabilltype},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
|
|
@ -193,7 +193,14 @@ public class BaseEntity implements Serializable
|
|||
* 初始化新增实体的通用字段
|
||||
*/
|
||||
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();
|
||||
|
||||
entity.setIsinuse("Y"); // 默认启用状态
|
||||
|
@ -207,7 +214,13 @@ public class BaseEntity implements Serializable
|
|||
* 更新实体的修改字段
|
||||
*/
|
||||
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();
|
||||
|
||||
entity.setLstedtdt(now); // 更新最后修改时间
|
||||
|
|
Loading…
Reference in New Issue