| | |
| | | @ExcelProperty("数量") |
| | | private Double anfme; |
| | | |
| | | @ApiModelProperty(value= "盘点数量") |
| | | @ExcelProperty("盘点数量") |
| | | private Double number; |
| | | |
| | | @ApiModelProperty(value= "商品编号") |
| | | @ExcelProperty("商品编号") |
| | | private String matnr; |
| | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.zy.asrs.entity.CheckDetl; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.mapper.CheckDetlMapper; |
| | | import com.zy.asrs.service.ApiLogService; |
| | | import com.zy.asrs.service.CheckDetlService; |
| | |
| | | @Service |
| | | @Slf4j |
| | | public class CheckDetlServiceImpl extends ServiceImpl<CheckDetlMapper, CheckDetl> implements CheckDetlService { |
| | | @Value("${erp.address.URL}") |
| | | @Value("${erp.newaddress.UPLOADURL}") |
| | | //端口 |
| | | private String URL; |
| | | @Value("${erp.address.outaddressSubmit}") |
| | | //上报出入库地址 |
| | | private String outaddressSubmit; |
| | | @Value("${erp.newaddress.uploadaddressSubmit}") |
| | | private String uploadAddress; |
| | | @Autowired |
| | | private CheckDetlService checkDetlService; |
| | | @Autowired |
| | |
| | | public void upload(List<CheckDetl> list) { |
| | | Date now = new Date(); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | |
| | | |
| | | // 构建主单 JSON 数据 |
| | | JSONObject requestBody = new JSONObject(); |
| | | requestBody.put("createTime", sdf.format(now)); |
| | | if (!list.isEmpty()) { |
| | | CheckDetl first = list.get(0); |
| | | requestBody.put("orderNo", first.getOrderNo()); |
| | | } |
| | | // 构建物料列表 |
| | | JSONArray matList = new JSONArray(); |
| | | |
| | | for(CheckDetl checkDetl : list) { |
| | | JSONObject mat = new JSONObject(); |
| | | mat.put("detailId", checkDetl.getDetailId()); |
| | | mat.put("orderNo", checkDetl.getOrderNo()); |
| | | mat.put("matnr", checkDetl.getMatnr()); |
| | | mat.put("anfme", checkDetl.getAnfme()); |
| | | mat.put("number", checkDetl.getNumber()); |
| | | matList.add(mat); |
| | | } |
| | | requestBody.put("data", matList); |
| | |
| | | String response = ""; |
| | | boolean success = false; |
| | | try { |
| | | HashMap<String, Object> headers = new HashMap<>(); |
| | | // cookie |
| | | headers.put("Cookie", loginAuthenticationHandler.start().getContent()); |
| | | |
| | | response = new HttpHandler.Builder() |
| | | .setHeaders(headers) |
| | | .setUri(URL) |
| | | .setPath(outaddressSubmit) // 设置你的接口路径 |
| | | .setPath(uploadAddress) // 设置你的接口路径 |
| | | .setJson(requestBody.toJSONString()) |
| | | .build() |
| | | .doPost(); |
| | |
| | | try { |
| | | apiLogService.save( |
| | | "盘点上报", |
| | | URL + outaddressSubmit, |
| | | URL + uploadAddress, |
| | | null, |
| | | "127.0.0.1", |
| | | requestBody.toJSONString(), |
| | |
| | | if (diff != 0) { |
| | | CheckDetl checkDetl = new CheckDetl(); |
| | | checkDetl.setOrderNo(param.getOrderNo()); |
| | | checkDetl.setAnfme(diff); //这里记录差值 |
| | | checkDetl.setAnfme(matParam.getAnfme()); //账面数量 |
| | | checkDetl.setNumber(LKAnfme); |
| | | checkDetl.setMatnr(matParam.getMatnr()); |
| | | checkDetl.setMaktx(matParam.getMaktx()); |
| | | checkDetl.setSpecs(matParam.getSpecs()); |
| | |
| | | //登录地址 |
| | | private String loginaddress; |
| | | |
| | | @Value("${erp.login.acctID}") |
| | | @Value("${erp.login.sAcctID}") |
| | | //账号ID |
| | | private String acctID; |
| | | |
| | | @Value("${erp.login.username}") |
| | | @Value("${erp.login.sUserId}") |
| | | //账号 |
| | | private String username; |
| | | |
| | | @Value("${erp.login.password}") |
| | | @Value("${erp.login.sPassword}") |
| | | //密码 |
| | | private String password; |
| | | |
| | |
| | | outaddressSubmit: K3Cloud/Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Submit.common.kdsvc |
| | | #结果上报(审核)单地址 |
| | | outaddressAudit: K3CLOUD/Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Audit.common.kdsvc |
| | | # 地址 |
| | | newaddress: |
| | | #单据上报地址 |
| | | URL: http://10.10.0.59:33117 |
| | | #单据提交 |
| | | orderaddressSubmit: api/U8Voucher |
| | | #盘点上报地址 |
| | | UPLOADURL: http://10.10.0.10:2501 |
| | | # 盘点地址 |
| | | uploadaddressSubmit: api/CheckVouch/pypk |
| | | |
| | | |
| | | # 登录账号管理 |
| | | login : |
| | | acctID: "647e849ab6fa0f" |
| | | username: "llw" |
| | | password: "666666" |
| | | lcid: 2052 |
| | | sAcctID: "999" |
| | | sUserId: "demo" |
| | | sPassword: "DEMO" |
| | | sServer: "10.1.9.20" |
| | | lcid: 1234 |
| | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.zy.asrs.entity.CheckDetl"> |
| | | <result column="anfme" property="anfme"/> |
| | | <result column="number" property="number"/> |
| | | <result column="matnr" property="matnr"/> |
| | | <result column="maktx" property="maktx"/> |
| | | <result column="specs" property="specs"/> |
| | |
| | | |
| | | <resultMap id="CheckResultMap" type="com.zy.asrs.entity.CheckDetl"> |
| | | <result column="anfme" property="anfme" /> |
| | | <result column="number" property="number"/> |
| | | <result column="matnr" property="matnr" /> |
| | | <result column="maktx" property="maktx" /> |
| | | <result column="specs" property="specs" /> |
| | | <result column="batch" property="batch" /> |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="order_no" property="orderNo"/> |
| | | <result column="detail_id" property="detailId"/> |
| | | </resultMap> |
| | | |
| | | <sql id="batchSeq"> |
| | |
| | | <if test="specs!=null and specs!='' "> |
| | | and a.specs like '%' + #{specs} + '%' |
| | | </if> |
| | | <if test="order_no!=null and order_no!='' "> |
| | | and a.order_no like '%' + #{order_no} + '%' |
| | | <if test="orderNo!=null and orderNo!='' "> |
| | | and a.order_no like '%' + #{orderNo} + '%' |
| | | </if> |
| | | <if test="detail_id!=null and detail_id!='' "> |
| | | and a.detail_id like '%' + #{detail_id} + '%' |
| | | </if> |
| | | </sql> |
| | | |
| | |
| | | a.specs, |
| | | a.batch, |
| | | a.create_time, |
| | | a.order_no |
| | | a.order_no, |
| | | a.detail_id, |
| | | a.number |
| | | from asr_check_detl a |
| | | where 1=1 |
| | | <include refid="stockOutCondition" /> |
| | |
| | | cols: [[ |
| | | {type: 'checkbox'}, |
| | | {field: 'orderNo', align: 'center',title: '盘点单编号', style: 'font-weight: bold'}, |
| | | {field: 'anfme', align: 'center',title: '盘点盈亏', style: 'font-weight: bold'}, |
| | | {field: 'anfme', align: 'center',title: '账面数量', style: 'font-weight: bold'}, |
| | | {field: 'number', align: 'center',title: '盘点数量', style: 'font-weight: bold'}, |
| | | {field: 'createTime$', align: 'center',title: '创建时间', style: 'font-weight: bold'}, |
| | | {field: 'matnr', align: 'center',title: '商品编号', style: 'font-weight: bold'}, |
| | | {field: 'maktx', align: 'center',title: '商品名称', style: 'font-weight: bold'}, |
| | |
| | | <input class="layui-input" type="text" name="matnr" placeholder="商品编号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="orderNo" placeholder="盘点编号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <!-- 待添加 --> |
| | | <div id="data-search-btn" class="layui-btn-container layui-form-item" style="display: inline-block"> |
| | | <button id="search" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="search">搜索 |