Browse Source

修改入库信息

xiaochan 4 years ago
parent
commit
d636a7d48b

+ 48 - 0
src/main/java/thyyxxk/webserver/controller/datamodify/InOrOutOfWarehouseController.java

@@ -0,0 +1,48 @@
+package thyyxxk.webserver.controller.datamodify;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import thyyxxk.webserver.entity.ResultVo;
+import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
+import thyyxxk.webserver.entity.datamodify.InOrOutOfWarehousePojo;
+import thyyxxk.webserver.entity.datamodify.YpInDetl;
+import thyyxxk.webserver.service.datamodify.InOrOutOfWarehouseService;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * 描述: 药品入库或出库查询
+ * </p>
+ *
+ * @author xc
+ * @date 2021-06-01 14:05
+ */
+@RestController
+@RequestMapping("/inOrOutOfWarehouse")
+public class InOrOutOfWarehouseController {
+    private final InOrOutOfWarehouseService service;
+
+    @Autowired
+    public InOrOutOfWarehouseController(InOrOutOfWarehouseService service) {
+        this.service = service;
+    }
+
+    @PostMapping("/queryRuKuXinXi")
+    public ResultVo<Map<String, Object>> queryRuKuXinXi(@RequestBody InOrOutOfWarehousePojo param) {
+        return service.queryRuKuXinXi(param);
+    }
+
+    @GetMapping("/queryCode")
+    public ResultVo<List<GetDropdownBox>> queryCode(@RequestParam("pyCode") String pyCode,
+                                                    @RequestParam("flag") Integer flag) {
+        return service.queryCode(pyCode, flag);
+
+    }
+
+    @PostMapping("/xiuGaiRuKuXinXi")
+    public ResultVo<String> xiuGiRuKuXinXi(@RequestBody YpInDetl param) {
+        return service.xiuGiRuKuXinXi(param);
+    }
+}

+ 51 - 0
src/main/java/thyyxxk/webserver/dao/his/datamodify/InOrOutOfWarehouseDao.java

@@ -0,0 +1,51 @@
+package thyyxxk.webserver.dao.his.datamodify;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
+import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
+import thyyxxk.webserver.entity.datamodify.InOrOutOfWarehousePojo;
+import thyyxxk.webserver.entity.datamodify.YpInDetl;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 描述: 药品入库或出库
+ * </p>
+ *
+ * @author xc
+ * @date 2021-06-01 14:06
+ */
+@Mapper
+public interface InOrOutOfWarehouseDao {
+
+    @Select("<script>" +
+            "select supply_code_name = (select name from yp_zd_supply where code = supply_code), " +
+            "manu_code_name = (select name from yp_zd_manufactory where code = manu_code)," +
+            "purchaser_name = (select  name from a_employee_mi where code = purchaser)," +
+            "charge_code_name = (select  name from yp_zd_dict where isnull(del_flag,0) = 0 " +
+            "and serial = yp_in_detl.serial  and code = charge_code),* " +
+            "from yp_in_detl where in_date &gt;= #{param.startTime} and in_date&lt;=#{param.endTime} " +
+            "<if test=\"param.inDocuNo!=null and param.inDocuNo!=''\">" +
+            "and in_docu_no=#{param.inDocuNo}" +
+            "</if>" +
+            "</script>")
+    List<YpInDetl> queryRuKuXinXi(IPage<InOrOutOfWarehousePojo> page, @Param("param") InOrOutOfWarehousePojo param);
+
+
+    @Select("select code,rtrim(name)name from ${tableName} where py_code like #{pyCode} and isnull(del_flag,0)=0")
+    List<GetDropdownBox> queryCode(@Param("tableName") String tableName,
+                                   @Param("pyCode") String pyCode);
+
+
+    @Update("update yp_in_detl set in_docu_no=#{inDocuNo},supply_code=#{supplyCode},rept_no=#{reptNo}, " +
+            "purchaser=#{purchaser},fp_no=#{fpNo},manu_no=#{manuNo},manu_code=#{manuCode}," +
+            "license_no=#{licenseNo},in_comment=#{inComment}, " +
+            "in_date=#{inDate},sys_date=#{inDate},confirm_date=#{confirmDate}," +
+            "fp_date=#{fpDate},eff_date=#{effDate} " +
+            "where in_docu_no = #{oldInDocuNo} and charge_code = #{chargeCode}")
+    void xiuGiRuKuXinXi(YpInDetl param);
+}

+ 21 - 0
src/main/java/thyyxxk/webserver/entity/datamodify/InOrOutOfWarehousePojo.java

@@ -0,0 +1,21 @@
+package thyyxxk.webserver.entity.datamodify;
+
+import lombok.Data;
+
+/**
+ * <p>
+ * 描述: 入库或出库查询的实体类
+ * </p>
+ *
+ * @author xc
+ * @date 2021-06-01 14:53
+ */
+@Data
+public class InOrOutOfWarehousePojo {
+    private String startTime;
+    private String endTime;
+    private String inDocuNo;
+    private String drawNo;
+    private long currentPage;
+    private long pageSize;
+}

+ 276 - 0
src/main/java/thyyxxk/webserver/entity/datamodify/YpInDetl.java

@@ -0,0 +1,276 @@
+package thyyxxk.webserver.entity.datamodify;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+public class YpInDetl implements Serializable {
+
+    private static final long serialVersionUID = 1477736585168728950L;
+
+    private String supplyCodeName;
+    private String manuCodeName;
+    private String purchaserName;
+    private String chargeCodeName;
+
+    private String oldInDocuNo;
+
+
+    /**
+     * inDate
+     */
+    private Date inDate;
+
+    /**
+     * inSeri
+     */
+    private Integer inSeri;
+
+    /**
+     * chargeCode
+     */
+    private String chargeCode;
+
+    /**
+     * serial
+     */
+    private String serial;
+
+    /**
+     * packRetprice
+     */
+    private Double packRetprice;
+
+    /**
+     * newRetprice
+     */
+    private Double newRetprice;
+
+    /**
+     * buyPrice
+     */
+    private Double buyPrice;
+
+    /**
+     * buyAmt
+     */
+    private Double buyAmt;
+
+    /**
+     * effDate
+     */
+    private Date effDate;
+
+    /**
+     * manuNo
+     */
+    private String manuNo;
+
+    /**
+     * reptNo
+     */
+    private String reptNo;
+
+    /**
+     * inDocuNo
+     */
+    private String inDocuNo;
+
+    /**
+     * supplyCoop
+     */
+    private String supplyCoop;
+
+    /**
+     * manufacture
+     */
+    private String manufacture;
+
+    /**
+     * licenseNo
+     */
+    private String licenseNo;
+
+    /**
+     * purchaser
+     */
+    private String purchaser;
+
+    /**
+     * checker
+     */
+    private String checker;
+
+    /**
+     * comment
+     */
+    private String comment;
+
+    /**
+     * pczSign
+     */
+    private String pczSign;
+
+    /**
+     * acctSign
+     */
+    private String acctSign;
+
+    /**
+     * stockAmount
+     */
+    private Double stockAmount;
+
+    /**
+     * fixPrice
+     */
+    private Double fixPrice;
+
+    /**
+     * groupNo
+     */
+    private String groupNo;
+
+    /**
+     * printFlag
+     */
+    private String printFlag;
+
+    /**
+     * checkFlag
+     */
+    private String checkFlag;
+
+    /**
+     * acctDate
+     */
+    private Date acctDate;
+
+    /**
+     * currentStock
+     */
+    private Double currentStock;
+
+    /**
+     * kl
+     */
+    private Double kl;
+
+    /**
+     * sysDate
+     */
+    private Date sysDate;
+
+    /**
+     * fprq
+     */
+    private Date fprq;
+
+    /**
+     * hg
+     */
+    private String hg;
+
+    /**
+     * inDateOut
+     */
+    private Date inDateOut;
+
+    /**
+     * inSeriOut
+     */
+    private Integer inSeriOut;
+
+    /**
+     * manuCode
+     */
+    private String manuCode;
+
+    /**
+     * supplyCode
+     */
+    private String supplyCode;
+
+    /**
+     * inComment
+     */
+    private String inComment;
+
+    /**
+     * inType
+     */
+    private String inType;
+
+    /**
+     * confirmFlag
+     */
+    private String confirmFlag;
+
+    /**
+     * confirmId
+     */
+    private String confirmId;
+
+    /**
+     * confirmDate
+     */
+    private Date confirmDate;
+
+    /**
+     * acctType
+     */
+    private String acctType;
+
+    /**
+     * acctId
+     */
+    private String acctId;
+
+    /**
+     * inputId
+     */
+    private String inputId;
+
+    /**
+     * fpDate
+     */
+    private Date fpDate;
+
+    /**
+     * fpNo
+     */
+    private String fpNo;
+
+    /**
+     * hgFlag
+     */
+    private String hgFlag;
+
+    /**
+     * serialTh
+     */
+    private Integer serialTh;
+
+    /**
+     * reptDate
+     */
+    private Date reptDate;
+
+    /**
+     * producingDate
+     */
+    private Date producingDate;
+
+    /**
+     * acceptId
+     */
+    private String acceptId;
+
+    /**
+     * avgPrice
+     */
+    private Double avgPrice;
+
+}

+ 72 - 0
src/main/java/thyyxxk/webserver/service/datamodify/InOrOutOfWarehouseService.java

@@ -0,0 +1,72 @@
+package thyyxxk.webserver.service.datamodify;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import thyyxxk.webserver.config.exception.ExceptionEnum;
+import thyyxxk.webserver.constants.Capacity;
+import thyyxxk.webserver.dao.his.datamodify.InOrOutOfWarehouseDao;
+import thyyxxk.webserver.entity.ResultVo;
+import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
+import thyyxxk.webserver.entity.datamodify.InOrOutOfWarehousePojo;
+import thyyxxk.webserver.entity.datamodify.YpInDetl;
+import thyyxxk.webserver.utils.ResultVoUtil;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * 描述: 药品入库或出库
+ * </p>
+ *
+ * @author xc
+ * @date 2021-06-01 14:07
+ */
+@Service
+@Slf4j
+public class InOrOutOfWarehouseService {
+    private final InOrOutOfWarehouseDao dao;
+
+    @Autowired
+    public InOrOutOfWarehouseService(InOrOutOfWarehouseDao dao) {
+        this.dao = dao;
+    }
+
+    public ResultVo<Map<String, Object>> queryRuKuXinXi(InOrOutOfWarehousePojo param) {
+        System.out.println(param);
+        IPage<InOrOutOfWarehousePojo> page = new Page<>(param.getCurrentPage(), param.getPageSize());
+        List<YpInDetl> list = dao.queryRuKuXinXi(page, param);
+        if (list.size() > 0) {
+            Map<String, Object> map = new HashMap<>(Capacity.TWO);
+            map.put("data", list);
+            map.put("total", page.getTotal());
+            return ResultVoUtil.success(map);
+        }
+        return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST);
+    }
+
+    public ResultVo<List<GetDropdownBox>> queryCode(String pyCode, Integer flag) {
+        if (flag == 1) {
+            //供应商
+            return ResultVoUtil.success(dao.queryCode("yp_zd_supply", pyCode.toUpperCase() + "%"));
+        } else if (flag == 2) {
+            //采购员
+            return ResultVoUtil.success(dao.queryCode("a_employee_mi", pyCode.toUpperCase() + "%"));
+        } else if (flag == 3) {
+            //生产厂家
+            return ResultVoUtil.success(dao.queryCode("yp_zd_manufactory", pyCode.toUpperCase() + "%"));
+        }
+        return ResultVoUtil.fail(ExceptionEnum.INTERNAL_SERVER_ERROR);
+
+    }
+
+    public ResultVo<String> xiuGiRuKuXinXi(YpInDetl param) {
+        dao.xiuGiRuKuXinXi(param);
+        log.info("修改入库信息:数据{},根据入库单号和药品编码", param);
+        return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION, "修改成功");
+    }
+}