浏览代码

更xinjiekou ,fix bug

wangzhinan 3 年之前
父节点
当前提交
b299c367e4

+ 23 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/a1entity/Mediicinedevice.java

@ -160,9 +160,32 @@ public class Mediicinedevice extends UuidIdentityEntityWithOperator implements S
     */
    private String cargoCapacity;
    //层数
    private String layer;
    /**
     * 列数
     */
    private String wayer;
    public Mediicinedevice() {
    }
    public String getLayer() {
        return layer;
    }
    public void setLayer(String layer) {
        this.layer = layer;
    }
    public String getWayer() {
        return wayer;
    }
    public void setWayer(String wayer) {
        this.wayer = wayer;
    }
    public String getEquClass() {
        return equClass;

+ 2 - 2
svr/svr-base/src/main/java/com/yihu/jw/base/service/a3service/MedicineStockUpService.java

@ -302,7 +302,7 @@ public class MedicineStockUpService extends BaseJpaService<Mediicinestockup, Med
                "    tmd.equ_num as equNum,\n" +
                "    tmu.name as replenishErName\n" +
                "FROM\n" +
                "    t_mediicine_stockrecord AS t left join t_mediicine_device tmd on replenish_equ = tmd.id left join t_mediicine_user tmu on t.replenish_er = tmu.id  where 1=1";
                "    t_mediicine_stockrecord AS t left join t_mediicine_device tmd on replenish_equ = tmd.id left join t_mediicine_user tmu on t.replenish_er = tmu.id  where 1=1 and tmd.del = 1";
        String conditionSql = "";
        //社区
@ -333,7 +333,7 @@ public class MedicineStockUpService extends BaseJpaService<Mediicinestockup, Med
                "   from " +
                "     t_mediicine_stockrecord t left join t_mediicine_device tmd on replenish_equ = tmd.id left join t_mediicine_user tmu on t.replenish_er = tmu.id  " +
                "  where " +
                "  1=1   " +
                "  1=1  and tmd.del = 1  " +
                conditionSql;
        Logger.getAnonymousLogger().info("finalCountSql="+countSql);
        int count = jdbcTemplate.queryForObject(countSql,Integer.class);

+ 22 - 12
svr/svr-base/src/main/java/com/yihu/jw/base/service/a3service/MedicineUserService.java

@ -373,7 +373,9 @@ public class MedicineUserService extends BaseJpaService<Mediicineuser, Mediicine
                "    t.aisles as aisles,\n" +
                "    t.capacity as capacity,\n" +
                "    t.ratio as ratio,\n" +
                "    t.cargo_capacity as cargoCapacity\n" +
                "    t.cargo_capacity as cargoCapacity,\n" +
                "    t.layer as layer,\n" +
                "    t.wayer as wayer\n" +
                "FROM\n" +
                "    t_mediicine_device AS t where 1=1\n";
@ -497,12 +499,14 @@ public class MedicineUserService extends BaseJpaService<Mediicineuser, Mediicine
                "    t.aisles as aisles,\n" +
                "    t.capacity as capacity,\n" +
                "    t.ratio as ratio,\n" +
                "    t.cargo_capacity as cargoCapacity\n" +
                "    t.cargo_capacity as cargoCapacity,\n" +
                "    t.layer as layer,\n" +
                "    t.wayer as wayer\n" +
                "FROM\n" +
                "    t_mediicine_device AS t where\n";
                "    t_mediicine_device AS t where t.del = 1\n";
//        String conditionSql = " t.id in (select du.device_id from t_mediicine_device_user du where del = 1 and ',"+userId+",' LIKE CONCAT('%,',du.user_id,',%'))";
        String conditionSql = " t.id in (select du.device_id from t_mediicine_device_user du where del = 1 and du.user_id = '" + userId + "'";
        String conditionSql = " and t.id in (select du.device_id from t_mediicine_device_user du where del = 1 and du.user_id = '" + userId + "'";
        sql = sql + conditionSql;
@ -625,7 +629,7 @@ public class MedicineUserService extends BaseJpaService<Mediicineuser, Mediicine
        JSONObject result = new JSONObject();
        JSONObject jsonObject = new JSONObject();
        String sql = "select count(1) from t_mediicine_device a";
        String sql = "select count(1) from t_mediicine_device a where a.del = 1";
        int count = jdbcTemplate.queryForObject(sql,Integer.class);
        jsonObject.put("count", count);
        result.put("response",ConstantUtils.SUCCESS);
@ -646,7 +650,7 @@ public class MedicineUserService extends BaseJpaService<Mediicineuser, Mediicine
     */
    public JSONObject countOnline() throws Exception{
        JSONObject result = new JSONObject();
        String sql = "select count(1) from t_mediicine_device a where a.status = 1";
        String sql = "select count(1) from t_mediicine_device a where a.del = 1 and a.status = 1";
        int count = jdbcTemplate.queryForObject(sql,Integer.class);
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("count",count);
@ -757,11 +761,13 @@ public class MedicineUserService extends BaseJpaService<Mediicineuser, Mediicine
                "\tt.aisles as aisles,\n" +
                "\tt.capacity as capacity,\n" +
                "\tt.ratio as ratio,\n" +
                "\tt.cargo_capacity as cargoCapacity\n" +
                "\tt.cargo_capacity as cargoCapacity,\n" +
                "\tt.layer as layer,\n" +
                "\tt.wayer as wayer\n" +
                "FROM\n" +
                "\tt_mediicine_device t\n" +
                "LEFT JOIN t_mediicinecabinet_inventory tmi ON t.id = tmi.id_device\n" +
                "WHERE 1=1\n" ;
                "WHERE 1=1 and t.del = 1 \n" ;
        if (!StringUtils.isEmpty(replenishEr)) {
            sql +=" AND t.id in (select device_id from t_mediicine_device_user tmdu left join t_mediicine_user tmu on tmdu.user_id = tmu.id where tmdu.del = 1 and CONCAT(tmu.name,tmu.account) like '%" + replenishEr + "%')\n";
        }
@ -841,9 +847,11 @@ public class MedicineUserService extends BaseJpaService<Mediicineuser, Mediicine
                "    t.aisles AS aisles,\n" +
                "    t.capacity AS capacity,\n" +
                "    t.ratio AS ratio,\n" +
                "    t.cargo_capacity AS cargoCapacity\n" +
                "    t.cargo_capacity AS cargoCapacity,\n" +
                "    t.layer AS layer,\n" +
                "    t.wayer AS wayer\n" +
                "FROM\n" +
                "    t_mediicine_device AS t WHERE ',"+ ids +",' LIKE CONCAT('%,',t.id,',%')";
                "    t_mediicine_device AS t WHERE t.del = 1 and  ',"+ ids +",' LIKE CONCAT('%,',t.id,',%')";
        String sencordSql = "SELECT\n" +
                "\ttmi.layer_no AS layerNo,\n" +
                "\ttmi.wayer_no AS wayerNo,\n" +
@ -959,9 +967,11 @@ public class MedicineUserService extends BaseJpaService<Mediicineuser, Mediicine
                "    t.aisles AS aisles,\n" +
                "    t.capacity AS capacity,\n" +
                "    t.ratio AS ratio,\n" +
                "    t.cargo_capacity AS cargoCapacity\n" +
                "    t.cargo_capacity AS cargoCapacity,\n" +
                "    t.layer AS layer,\n" +
                "    t.wayer AS wayer\n" +
                "FROM\n" +
                "    t_mediicine_device AS t WHERE 1=1";
                "    t_mediicine_device AS t WHERE 1=1 and t.del = 1";
        if (!StringUtils.isEmpty(deviceId)) {
            sql += " AND t.id = '" + deviceId + "'";

+ 26 - 14
svr/svr-base/src/main/java/com/yihu/jw/base/service/a3service/MedicinedeviceService.java

@ -333,7 +333,9 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi
                "    t.aisles as aisles,\n" +
                "    t.capacity as capacity,\n" +
                "    t.ratio as ratio,\n" +
                "    t.cargo_capacity as cargoCapacity\n" +
                "    t.cargo_capacity as cargoCapacity,\n" +
                "    t.layer as layer,\n" +
                "    t.wayer as wayer\n" +
                "FROM\n" +
                "    t_mediicine_device AS t where 1=1 AND t.del = 1\n";
@ -376,7 +378,7 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi
                "   from " +
                "     t_mediicine_device t " +
                "  where " +
                "  1=1   " +
                "  1=1  and t.del = 1  " +
                conditionSql;
        Logger.getAnonymousLogger().info("finalCountSql="+countSql);
        int count = jdbcTemplate.queryForObject(countSql,Integer.class);
@ -428,7 +430,9 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi
                "    t.aisles as aisles,\n" +
                "    t.capacity as capacity,\n" +
                "    t.ratio as ratio,\n" +
                "    t.cargo_capacity as cargoCapacity\n" +
                "    t.cargo_capacity as cargoCapacity,\n" +
                "    t.layer as layer,\n" +
                "    t.wayer as wayer\n" +
                "FROM\n" +
                "    t_mediicine_device AS t where 1=1\n";
@ -552,12 +556,14 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi
                "    t.aisles as aisles,\n" +
                "    t.capacity as capacity,\n" +
                "    t.ratio as ratio,\n" +
                "    t.cargo_capacity as cargoCapacity\n" +
                "    t.cargo_capacity as cargoCapacity,\n" +
                "    t.layer as layer,\n" +
                "    t.wayer as wayer\n" +
                "FROM\n" +
                "    t_mediicine_device AS t where\n";
                "    t_mediicine_device AS t where t.del = 1\n";
//        String conditionSql = " t.id in (select du.device_id from t_mediicine_device_user du where del = 1 and ',"+userId+",' LIKE CONCAT('%,',du.user_id,',%'))";
        String conditionSql = " t.id in (select du.device_id from t_mediicine_device_user du where del = 1 and du.user_id = '" + userId + "'";
        String conditionSql = " and t.id in (select du.device_id from t_mediicine_device_user du where del = 1 and du.user_id = '" + userId + "'";
        sql = sql + conditionSql;
@ -680,7 +686,7 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi
        JSONObject result = new JSONObject();
        JSONObject jsonObject = new JSONObject();
        String sql = "select count(1) from t_mediicine_device a";
        String sql = "select count(1) from t_mediicine_device a where a.del = 1";
        int count = jdbcTemplate.queryForObject(sql,Integer.class);
        jsonObject.put("count", count);
        result.put("response",ConstantUtils.SUCCESS);
@ -701,7 +707,7 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi
     */
    public JSONObject countOnline() throws Exception{
        JSONObject result = new JSONObject();
        String sql = "select count(1) from t_mediicine_device a where a.status = 1";
        String sql = "select count(1) from t_mediicine_device a where a.del = 1 and a.status = 1";
        int count = jdbcTemplate.queryForObject(sql,Integer.class);
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("count",count);
@ -812,11 +818,13 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi
                "\tt.aisles as aisles,\n" +
                "\tt.capacity as capacity,\n" +
                "\tt.ratio as ratio,\n" +
                "\tt.cargo_capacity as cargoCapacity\n" +
                "\tt.cargo_capacity as cargoCapacity,\n" +
                "\tt.layer as layer,\n" +
                "\tt.wayer as wayer\n" +
                "FROM\n" +
                "\tt_mediicine_device t\n" +
                "LEFT JOIN t_mediicinecabinet_inventory tmi ON t.id = tmi.id_device\n" +
                "WHERE 1=1\n" ;
                "WHERE 1=1 and t.del = 1\n" ;
        if (!StringUtils.isEmpty(replenishEr)) {
            sql +=" AND t.id in (select device_id from t_mediicine_device_user tmdu left join t_mediicine_user tmu on tmdu.user_id = tmu.id where tmdu.del = 1 and CONCAT(tmu.name,tmu.account) like '%" + replenishEr + "%')\n";
        }
@ -896,9 +904,11 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi
                "    t.aisles AS aisles,\n" +
                "    t.capacity AS capacity,\n" +
                "    t.ratio AS ratio,\n" +
                "    t.cargo_capacity AS cargoCapacity\n" +
                "    t.cargo_capacity AS cargoCapacity,\n" +
                "    t.layer AS layer,\n" +
                "    t.wayer AS wayer\n" +
                "FROM\n" +
                "    t_mediicine_device AS t WHERE ',"+ ids +",' LIKE CONCAT('%,',t.id,',%')";
                "    t_mediicine_device AS t WHERE t.del = 1 and ',"+ ids +",' LIKE CONCAT('%,',t.id,',%')";
        String sencordSql = "SELECT\n" +
                "\ttmi.layer_no AS layerNo,\n" +
                "\ttmi.wayer_no AS wayerNo,\n" +
@ -1014,9 +1024,11 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi
                "    t.aisles AS aisles,\n" +
                "    t.capacity AS capacity,\n" +
                "    t.ratio AS ratio,\n" +
                "    t.cargo_capacity AS cargoCapacity\n" +
                "    t.cargo_capacity AS cargoCapacity,\n" +
                "    t.layer AS layer,\n" +
                "    t.wayer AS wayer\n" +
                "FROM\n" +
                "    t_mediicine_device AS t WHERE 1=1";
                "    t_mediicine_device AS t WHERE 1=1 and t.del = 1";
        if (!StringUtils.isEmpty(deviceId)) {
            sql += " AND t.id = '" + deviceId + "'";