#
luxiaotao1123
2020-06-29 4e4e1fcf869ccd460640210794cecbe3f710d70d
#
4个文件已修改
84 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/controller/MobileController.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/MobileService.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/waitPakin/waitPakin.js 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/MobileController.java
@@ -3,6 +3,9 @@
import com.core.annotations.ManagerAuth;
import com.core.common.R;
import com.zy.asrs.entity.param.CombParam;
import com.zy.asrs.service.MobileService;
import com.zy.common.web.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@@ -13,7 +16,10 @@
 */
@RestController
@RequestMapping("mobile")
public class MobileController {
public class MobileController extends BaseController  {
    @Autowired
    private MobileService mobileService;
    /**
     * 组托
@@ -21,7 +27,7 @@
    @RequestMapping("/comb/auth")
    @ManagerAuth(memo = "组托")
    public R comb(@RequestBody CombParam combParam){
        mobileService.comb(combParam, getUserId());
        return R.ok();
    }
src/main/java/com/zy/asrs/service/MobileService.java
@@ -1,4 +1,13 @@
package com.zy.asrs.service;
import com.zy.asrs.entity.param.CombParam;
public interface MobileService {
    /**
     * 组托
     * @param param
     */
    void comb(CombParam param, Long userId);
}
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -1,10 +1,66 @@
package com.zy.asrs.service.impl;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.core.common.BaseRes;
import com.core.common.Cools;
import com.core.exception.CoolException;
import com.zy.asrs.entity.MatCode;
import com.zy.asrs.entity.WaitPakin;
import com.zy.asrs.entity.param.CombParam;
import com.zy.asrs.service.MatCodeService;
import com.zy.asrs.service.MobileService;
import com.zy.asrs.service.WaitPakinService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
/**
 * 移动端服务核心类
 * Created by vincent on 2020/6/28
 */
@Service
public class MobileServiceImpl implements MobileService {
    @Autowired
    private MatCodeService matCodeService;
    @Autowired
    private WaitPakinService waitPakinService;
    @Override
    @Transactional
    public void comb(CombParam param, Long userId) {
        if (Cools.isEmpty(param.getBarcode()) || param.getCombMats().isEmpty()) {
            throw new CoolException(BaseRes.PARAM);
        }
        int count = waitPakinService.selectCount(new EntityWrapper<WaitPakin>().
                eq("barcode", param.getBarcode()).eq("status", "N"));
        if (count > 0) {
            throw new CoolException("箱号数据已存在");
        }
        for (CombParam.CombMat combMat : param.getCombMats()) {
            MatCode matCode = matCodeService.selectById(combMat.getMatNo());
            if (Cools.isEmpty(matCode)) {
                throw new CoolException("物料数据错误");
            }
            WaitPakin waitPakin = new WaitPakin(
                    param.getBarcode(),    // 托盘码
                    matCode.getMatNo(),    // 物料编码
                    matCode.getMatName(),    // 物料描述
                    combMat.getCount(),    // 数量
                    matCode.getStr1(),    // 单位
                    "N",    // 状态
                    "",    // 备注
                    new Date(),    // 修改时间
                    userId,    // 修改人员
                    new Date(),    // 添加时间
                    userId    // 创建者
            );
            if (!waitPakinService.insert(waitPakin)) {
                throw new CoolException("保存数据失败");
            }
        }
    }
}
src/main/webapp/static/js/waitPakin/waitPakin.js
@@ -20,13 +20,18 @@
        cols: [[
            {type: 'checkbox'}
//            ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80}
            ,{field: 'id', align: 'center',title: '编号'}
            ,{field: 'id', align: 'center',title: '编号', sort: true}
            ,{field: 'barcode', align: 'center',title: '托盘码'}
            ,{field: 'matnr', align: 'center',title: '物料编码'}
            ,{field: 'maktx', align: 'center',title: '物料描述'}
            ,{field: 'anfme', align: 'center',title: '数量'}
            ,{field: 'unit', align: 'center',title: '单位'}
            ,{field: 'status', align: 'center',title: '状态'}
            ,{field: 'status', align: 'center',title: '状态', templet:function(row){
                    var html = "<input value='status' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'";
                    if(row.inEnable === 'Y'){html += " checked ";}
                    html += ">";
                    return html;
                }}
            ,{field: 'memo', align: 'center',title: '备注'}
            ,{field: 'modiTime$', align: 'center',title: '修改时间', hide: true}
            ,{field: 'modiUser$', align: 'center',title: '修改人员', hide: true}